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. 88 if filter.abstract_filter
is None:
89 abstract_filter = filter.physical_filter
91 abstract_filter = filter.abstract_filter
93 registry.insertDimensionData(
"physical_filter",
95 "name": filter.physical_filter,
96 "abstract_filter": abstract_filter
101 """Return the Formatter class that should be used to read a particular 106 dataId : `DataCoordinate` 107 Dimension-based ID for the raw file or files being ingested. 111 formatter : `Formatter` class 112 Class to be used that reads the file into an 113 `lsst.afw.image.Exposure` instance. 115 raise NotImplementedError()
119 """Write human-curated calibration Datasets to the given Butler with 120 the appropriate validity ranges. 122 This is a temporary API that should go away once obs_ packages have 123 a standardized approach to this problem. 125 raise NotImplementedError()
128 """Apply instrument-specific overrides for a task config. 133 Name of the object being configured; typically the _DefaultName 135 config : `lsst.pex.config.Config` 136 Config instance to which overrides should be applied. 139 path = os.path.join(root, f
"{name}.py")
140 if os.path.exists(path):
145 """Construct an exposure DimensionRecord from 146 `astro_metadata_translator.ObservationInfo`. 150 obsInfo : `astro_metadata_translator.ObservationInfo` 151 A `~astro_metadata_translator.ObservationInfo` object corresponding to 153 universe : `DimensionUniverse` 154 Set of all known dimensions. 158 record : `DimensionRecord` 159 A record containing exposure metadata, suitable for insertion into 162 dimension = universe[
"exposure"]
163 return dimension.RecordClass.fromDict({
164 "instrument": obsInfo.instrument,
165 "id": obsInfo.exposure_id,
166 "name": obsInfo.observation_id,
167 "group": obsInfo.exposure_group,
168 "datetime_begin": obsInfo.datetime_begin.to_datetime(),
169 "datetime_end": obsInfo.datetime_end.to_datetime(),
170 "exposure_time": obsInfo.exposure_time.to_value(
"s"),
171 "dark_time": obsInfo.dark_time.to_value(
"s"),
172 "observation_type": obsInfo.observation_type,
173 "physical_filter": obsInfo.physical_filter,
174 "visit": obsInfo.visit_id,
179 """Construct a visit `DimensionRecord` from 180 `astro_metadata_translator.ObservationInfo`. 184 obsInfo : `astro_metadata_translator.ObservationInfo` 185 A `~astro_metadata_translator.ObservationInfo` object corresponding to 187 universe : `DimensionUniverse` 188 Set of all known dimensions. 189 region : `lsst.sphgeom.Region`, optional 190 Spatial region for the visit. 194 record : `DimensionRecord` 195 A record containing visit metadata, suitable for insertion into a 198 dimension = universe[
"visit"]
199 return dimension.RecordClass.fromDict({
200 "instrument": obsInfo.instrument,
201 "id": obsInfo.visit_id,
202 "name": obsInfo.observation_id,
203 "datetime_begin": obsInfo.datetime_begin.to_datetime(),
204 "datetime_end": obsInfo.datetime_end.to_datetime(),
205 "exposure_time": obsInfo.exposure_time.to_value(
"s"),
206 "physical_filter": obsInfo.physical_filter,
212 """Add a special 'unbounded' calibration_label dimension entry for the 213 given camera that is valid for any exposure. 215 If such an entry already exists, this function just returns a `DataId` 216 for the existing entry. 220 registry : `Registry` 221 Registry object in which to insert the dimension entry. 222 instrumentName : `str` 223 Name of the instrument this calibration label is associated with. 228 New or existing data ID for the unbounded calibration. 230 d = dict(instrument=instrumentName, calibration_label=
"unbounded")
232 return registry.expandDataId(d)
236 entry[
"datetime_begin"] = datetime.min
237 entry[
"datetime_end"] = datetime.max
238 registry.insertDimensionData(
"calibration_label", entry)
239 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)