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 58 raise NotImplementedError()
62 """Retrieve the cameraGeom representation of this instrument. 64 This is a temporary API that should go away once obs_ packages have 65 a standardized approach to writing versioned cameras to a Gen3 repo. 67 raise NotImplementedError()
71 """Insert instrument, physical_filter, and detector entries into a 74 raise NotImplementedError()
76 def _registerFilters(self, registry):
77 """Register the physical and abstract filter Dimension relationships. 78 This should be called in the ``register`` implementation. 82 registry : `lsst.daf.butler.core.Registry` 83 The registry to add dimensions to. 85 registry.insertDimensionData(
90 "name": filter.physical_filter,
91 "abstract_filter": filter.abstract_filter,
99 """Return the Formatter class that should be used to read a particular 104 dataId : `DataCoordinate` 105 Dimension-based ID for the raw file or files being ingested. 109 formatter : `Formatter` class 110 Class to be used that reads the file into an 111 `lsst.afw.image.Exposure` instance. 113 raise NotImplementedError()
117 """Write human-curated calibration Datasets to the given Butler with 118 the appropriate validity ranges. 120 This is a temporary API that should go away once obs_ packages have 121 a standardized approach to this problem. 123 raise NotImplementedError()
126 """Apply instrument-specific overrides for a task config. 131 Name of the object being configured; typically the _DefaultName 133 config : `lsst.pex.config.Config` 134 Config instance to which overrides should be applied. 137 path = os.path.join(root, f
"{name}.py")
138 if os.path.exists(path):
143 """Construct an exposure DimensionRecord from 144 `astro_metadata_translator.ObservationInfo`. 148 obsInfo : `astro_metadata_translator.ObservationInfo` 149 A `~astro_metadata_translator.ObservationInfo` object corresponding to 151 universe : `DimensionUniverse` 152 Set of all known dimensions. 156 record : `DimensionRecord` 157 A record containing exposure metadata, suitable for insertion into 160 dimension = universe[
"exposure"]
161 return dimension.RecordClass.fromDict({
162 "instrument": obsInfo.instrument,
163 "id": obsInfo.exposure_id,
164 "name": obsInfo.observation_id,
165 "datetime_begin": obsInfo.datetime_begin.to_datetime(),
166 "datetime_end": obsInfo.datetime_end.to_datetime(),
167 "exposure_time": obsInfo.exposure_time.to_value(
"s"),
168 "dark_time": obsInfo.dark_time.to_value(
"s"),
169 "observation_type": obsInfo.observation_type,
170 "physical_filter": obsInfo.physical_filter,
171 "visit": obsInfo.visit_id,
176 """Construct a visit `DimensionRecord` from 177 `astro_metadata_translator.ObservationInfo`. 181 obsInfo : `astro_metadata_translator.ObservationInfo` 182 A `~astro_metadata_translator.ObservationInfo` object corresponding to 184 universe : `DimensionUniverse` 185 Set of all known dimensions. 186 region : `lsst.sphgeom.Region`, optional 187 Spatial region for the visit. 191 record : `DimensionRecord` 192 A record containing visit metadata, suitable for insertion into a 195 dimension = universe[
"visit"]
196 return dimension.RecordClass.fromDict({
197 "instrument": obsInfo.instrument,
198 "id": obsInfo.visit_id,
199 "name": obsInfo.observation_id,
200 "datetime_begin": obsInfo.datetime_begin.to_datetime(),
201 "datetime_end": obsInfo.datetime_end.to_datetime(),
202 "exposure_time": obsInfo.exposure_time.to_value(
"s"),
203 "physical_filter": obsInfo.physical_filter,
209 """Add a special 'unbounded' calibration_label dimension entry for the 210 given camera that is valid for any exposure. 212 If such an entry already exists, this function just returns a `DataId` 213 for the existing entry. 217 registry : `Registry` 218 Registry object in which to insert the dimension entry. 219 instrumentName : `str` 220 Name of the instrument this calibration label is associated with. 225 New or existing data ID for the unbounded calibration. 227 d = dict(instrument=instrumentName, calibration_label=
"unbounded")
229 return registry.expandDataId(d)
233 entry[
"datetime_begin"] = datetime.min
234 entry[
"datetime_end"] = datetime.max
235 registry.insertDimensionData(
"calibration_label", entry)
236 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)