22 __all__ = (
"Instrument",
"makeExposureRecordFromObsInfo",
"makeVisitRecordFromObsInfo",
23 "addUnboundedCalibrationLabel")
26 from abc
import ABCMeta, abstractmethod
28 from lsst.daf.butler
import TIMESPAN_MIN, TIMESPAN_MAX
32 """Base class for instrument-specific logic for the Gen3 Butler. 34 Concrete instrument subclasses should be directly constructable with no 39 """Paths to config files to read for specific Tasks. 41 The paths in this list should contain files of the form `task.py`, for 42 each of the Tasks that requires special configuration. 48 """`~lsst.obs.base.FilterDefinitionCollection`, defining the filters 60 raise NotImplementedError()
64 """Retrieve the cameraGeom representation of this instrument. 66 This is a temporary API that should go away once obs_ packages have 67 a standardized approach to writing versioned cameras to a Gen3 repo. 69 raise NotImplementedError()
73 """Insert instrument, physical_filter, and detector entries into a 76 raise NotImplementedError()
78 def _registerFilters(self, registry):
79 """Register the physical and abstract filter Dimension relationships. 80 This should be called in the ``register`` implementation. 84 registry : `lsst.daf.butler.core.Registry` 85 The registry to add dimensions to. 89 if filter.abstract_filter
is None:
90 abstract_filter = filter.physical_filter
92 abstract_filter = filter.abstract_filter
94 registry.insertDimensionData(
"physical_filter",
96 "name": filter.physical_filter,
97 "abstract_filter": abstract_filter
102 """Return the Formatter class that should be used to read a particular 107 dataId : `DataCoordinate` 108 Dimension-based ID for the raw file or files being ingested. 112 formatter : `Formatter` class 113 Class to be used that reads the file into an 114 `lsst.afw.image.Exposure` instance. 116 raise NotImplementedError()
120 """Write human-curated calibration Datasets to the given Butler with 121 the appropriate validity ranges. 123 This is a temporary API that should go away once obs_ packages have 124 a standardized approach to this problem. 126 raise NotImplementedError()
129 """Apply instrument-specific overrides for a task config. 134 Name of the object being configured; typically the _DefaultName 136 config : `lsst.pex.config.Config` 137 Config instance to which overrides should be applied. 140 path = os.path.join(root, f
"{name}.py")
141 if os.path.exists(path):
146 """Construct an exposure DimensionRecord from 147 `astro_metadata_translator.ObservationInfo`. 151 obsInfo : `astro_metadata_translator.ObservationInfo` 152 A `~astro_metadata_translator.ObservationInfo` object corresponding to 154 universe : `DimensionUniverse` 155 Set of all known dimensions. 159 record : `DimensionRecord` 160 A record containing exposure metadata, suitable for insertion into 163 dimension = universe[
"exposure"]
164 return dimension.RecordClass.fromDict({
165 "instrument": obsInfo.instrument,
166 "id": obsInfo.exposure_id,
167 "name": obsInfo.observation_id,
168 "group": obsInfo.exposure_group,
169 "datetime_begin": obsInfo.datetime_begin,
170 "datetime_end": obsInfo.datetime_end,
171 "exposure_time": obsInfo.exposure_time.to_value(
"s"),
172 "dark_time": obsInfo.dark_time.to_value(
"s"),
173 "observation_type": obsInfo.observation_type,
174 "physical_filter": obsInfo.physical_filter,
175 "visit": obsInfo.visit_id,
180 """Construct a visit `DimensionRecord` from 181 `astro_metadata_translator.ObservationInfo`. 185 obsInfo : `astro_metadata_translator.ObservationInfo` 186 A `~astro_metadata_translator.ObservationInfo` object corresponding to 188 universe : `DimensionUniverse` 189 Set of all known dimensions. 190 region : `lsst.sphgeom.Region`, optional 191 Spatial region for the visit. 195 record : `DimensionRecord` 196 A record containing visit metadata, suitable for insertion into a 199 dimension = universe[
"visit"]
200 return dimension.RecordClass.fromDict({
201 "instrument": obsInfo.instrument,
202 "id": obsInfo.visit_id,
203 "name": obsInfo.observation_id,
204 "datetime_begin": obsInfo.datetime_begin,
205 "datetime_end": obsInfo.datetime_end,
206 "exposure_time": obsInfo.exposure_time.to_value(
"s"),
207 "physical_filter": obsInfo.physical_filter,
213 """Add a special 'unbounded' calibration_label dimension entry for the 214 given camera that is valid for any exposure. 216 If such an entry already exists, this function just returns a `DataId` 217 for the existing entry. 221 registry : `Registry` 222 Registry object in which to insert the dimension entry. 223 instrumentName : `str` 224 Name of the instrument this calibration label is associated with. 229 New or existing data ID for the unbounded calibration. 231 d = dict(instrument=instrumentName, calibration_label=
"unbounded")
233 return registry.expandDataId(d)
237 entry[
"datetime_begin"] = TIMESPAN_MIN
238 entry[
"datetime_end"] = TIMESPAN_MAX
239 registry.insertDimensionData(
"calibration_label", entry)
240 return registry.expandDataId(d)
def applyConfigOverrides(self, name, config)
def makeExposureRecordFromObsInfo(obsInfo, universe)
def getRawFormatter(self, dataId)
def makeVisitRecordFromObsInfo(obsInfo, universe, region=None)
def filterDefinitions(self)
def __init__(self, args, kwargs)
def register(self, registry)
def addUnboundedCalibrationLabel(registry, instrumentName)
def writeCuratedCalibrations(self, butler)