22 __all__ = (
"Instrument",
"makeExposureRecordFromObsInfo",
"makeVisitRecordFromObsInfo",
23 "addUnboundedCalibrationLabel")
26 from datetime
import datetime
27 from abc
import ABCMeta, abstractmethod
31 """Base class for instrument-specific logic for the Gen3 Butler. 33 Concrete instrument subclasses should be directly constructable with no 38 """Paths to config files to read for specific Tasks. 40 The paths in this list should contain files of the form `task.py`, for 41 each of the Tasks that requires special configuration. 47 """`~lsst.obs.base.FilterDefinitionCollection`, defining the filters 59 raise NotImplementedError()
63 """Retrieve the cameraGeom representation of this instrument. 65 This is a temporary API that should go away once obs_ packages have 66 a standardized approach to writing versioned cameras to a Gen3 repo. 68 raise NotImplementedError()
72 """Insert instrument, physical_filter, and detector entries into a 75 raise NotImplementedError()
77 def _registerFilters(self, registry):
78 """Register the physical and abstract filter Dimension relationships. 79 This should be called in the ``register`` implementation. 83 registry : `lsst.daf.butler.core.Registry` 84 The registry to add dimensions to. 86 registry.insertDimensionData(
91 "name": filter.physical_filter,
92 "abstract_filter": filter.abstract_filter,
100 """Return the Formatter class that should be used to read a particular 105 dataId : `DataCoordinate` 106 Dimension-based ID for the raw file or files being ingested. 110 formatter : `Formatter` class 111 Class to be used that reads the file into an 112 `lsst.afw.image.Exposure` instance. 114 raise NotImplementedError()
118 """Write human-curated calibration Datasets to the given Butler with 119 the appropriate validity ranges. 121 This is a temporary API that should go away once obs_ packages have 122 a standardized approach to this problem. 124 raise NotImplementedError()
127 """Apply instrument-specific overrides for a task config. 132 Name of the object being configured; typically the _DefaultName 134 config : `lsst.pex.config.Config` 135 Config instance to which overrides should be applied. 138 path = os.path.join(root, f
"{name}.py")
139 if os.path.exists(path):
144 """Construct an exposure DimensionRecord from 145 `astro_metadata_translator.ObservationInfo`. 149 obsInfo : `astro_metadata_translator.ObservationInfo` 150 A `~astro_metadata_translator.ObservationInfo` object corresponding to 152 universe : `DimensionUniverse` 153 Set of all known dimensions. 157 record : `DimensionRecord` 158 A record containing exposure metadata, suitable for insertion into 161 dimension = universe[
"exposure"]
162 return dimension.RecordClass.fromDict({
163 "instrument": obsInfo.instrument,
164 "id": obsInfo.exposure_id,
165 "name": obsInfo.observation_id,
166 "datetime_begin": obsInfo.datetime_begin.to_datetime(),
167 "datetime_end": obsInfo.datetime_end.to_datetime(),
168 "exposure_time": obsInfo.exposure_time.to_value(
"s"),
169 "dark_time": obsInfo.dark_time.to_value(
"s"),
170 "observation_type": obsInfo.observation_type,
171 "physical_filter": obsInfo.physical_filter,
172 "visit": obsInfo.visit_id,
177 """Construct a visit `DimensionRecord` from 178 `astro_metadata_translator.ObservationInfo`. 182 obsInfo : `astro_metadata_translator.ObservationInfo` 183 A `~astro_metadata_translator.ObservationInfo` object corresponding to 185 universe : `DimensionUniverse` 186 Set of all known dimensions. 187 region : `lsst.sphgeom.Region`, optional 188 Spatial region for the visit. 192 record : `DimensionRecord` 193 A record containing visit metadata, suitable for insertion into a 196 dimension = universe[
"visit"]
197 return dimension.RecordClass.fromDict({
198 "instrument": obsInfo.instrument,
199 "id": obsInfo.visit_id,
200 "name": obsInfo.observation_id,
201 "datetime_begin": obsInfo.datetime_begin.to_datetime(),
202 "datetime_end": obsInfo.datetime_end.to_datetime(),
203 "exposure_time": obsInfo.exposure_time.to_value(
"s"),
204 "physical_filter": obsInfo.physical_filter,
210 """Add a special 'unbounded' calibration_label dimension entry for the 211 given camera that is valid for any exposure. 213 If such an entry already exists, this function just returns a `DataId` 214 for the existing entry. 218 registry : `Registry` 219 Registry object in which to insert the dimension entry. 220 instrumentName : `str` 221 Name of the instrument this calibration label is associated with. 226 New or existing data ID for the unbounded calibration. 228 d = dict(instrument=instrumentName, calibration_label=
"unbounded")
230 return registry.expandDataId(d)
234 entry[
"datetime_begin"] = datetime.min
235 entry[
"datetime_end"] = datetime.max
236 registry.insertDimensionData(
"calibration_label", entry)
237 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)