LsstCam#

class lsst.obs.lsst.LsstCam(collection_prefix: str | None = None)#

Bases: Instrument

Gen3 Butler specialization for the LSST Main Camera.

Parameters#

cameralsst.cameraGeom.Camera

Camera object from which to extract detector information.

filterslist of FilterDefinition

An ordered list of filters to define the set of PhysicalFilters associated with this instrument in the registry.

While both the camera geometry and the set of filters associated with a camera are expected to change with time in general, their Butler Registry representations defined by an Instrument do not. Instead:

  • We only extract names, IDs, and purposes from the detectors in the camera, which should be static information that actually reflects detector “slots” rather than the physical sensors themselves. Because the distinction between physical sensors and slots is unimportant in the vast majority of Butler use cases, we just use “detector” even though the concept really maps better to “detector slot”. Ideally in the future this distinction between static and time-dependent information would be encoded in cameraGeom itself (e.g. by making the time-dependent Detector class inherit from a related class that only carries static content).

  • The Butler Registry is expected to contain physical_filter entries for all filters an instrument has ever had, because we really only care about which filters were used for particular observations, not which filters were available at some point in the past. And changes in individual filters over time will be captured as changes in their TransmissionCurve datasets, not changes in the registry content (which is really just a label). While at present Instrument and Registry do not provide a way to add new physical_filters, they will in the future.

Attributes Summary

configPaths

Built-in immutable sequence.

filterDefinitions

instrument

obsDataPackage

Name of the package containing the text curated calibration files.

policyName

Instrument specific name to use when locating a policy or configuration file in the file system.

visitSystem

Methods Summary

extractDetectorRecord(camGeomDetector)

Create a Gen3 Detector entry dict from a cameraGeom.Detector.

getCamera()

Retrieve the cameraGeom representation of this instrument.

getName()

Return the short (dimension) name for this instrument.

getRawFormatter(dataId)

Return the Formatter class that should be used to read a particular raw file.

group_name_to_group_id(group_name)

Translate the exposure group name to an integer.

register(registry[, update])

Insert instrument, and other relevant records into Registry.

Attributes Documentation

configPaths: Sequence[str]#

Paths to config files to read for specific Tasks.

The paths in this list should contain files of the form task.py, for each of the Tasks that requires special configuration.

filterDefinitions = <lsst.obs.base.filters.FilterDefinitionCollection object>#
instrument = 'LSSTCam'#
obsDataPackage: str | None = 'obs_lsst_data'#

Name of the package containing the text curated calibration files. Usually a obs _data package. If None no curated calibration files will be read. (str)

policyName: str | None = 'lsstCam'#

Instrument specific name to use when locating a policy or configuration file in the file system.

visitSystem = 2#

Methods Documentation

extractDetectorRecord(camGeomDetector)#

Create a Gen3 Detector entry dict from a cameraGeom.Detector.

classmethod getCamera()#

Retrieve the cameraGeom representation of this instrument.

This is a temporary API that should go away once obs packages have a standardized approach to writing versioned cameras to a Gen3 repo.

classmethod getName()#

Return the short (dimension) name for this instrument.

This is not (in general) the same as the class name - it’s what is used as the value of the “instrument” field in data IDs, and is usually an abbreviation of the full name.

getRawFormatter(dataId)#

Return the Formatter class that should be used to read a particular raw file.

Parameters#

dataIdDataId

Dimension-based ID for the raw file or files being ingested.

Returns#

formatterlsst.daf.butler.Formatter class

Class to be used that reads the file into the correct Python object for the raw data.

classmethod group_name_to_group_id(group_name: str) int#

Translate the exposure group name to an integer.

Parameters#

group_namestr

The name of the exposure group.

Returns#

idint

The exposure group name in integer form. This integer might be used as an ID to uniquely identify the group in contexts where a string can not be used.

Notes#

If given a group name that can be directly cast to an integer it returns the integer. If the group name looks like an ISO date the ID returned is seconds since an arbitrary recent epoch. Otherwise the group name is hashed and the first 14 digits of the hash is returned along with the length of the group name.

register(registry, update=False)#

Insert instrument, and other relevant records into Registry.

Parameters#

registrylsst.daf.butler.Registry

Registry client for the data repository to modify.

updatebool, optional

If True (False is default), update existing records if they differ from the new ones.

Raises#

lsst.daf.butler.registry.ConflictingDefinitionError

Raised if any existing record has the same key but a different definition as one being registered.

Notes#

New records can always be added by calling this method multiple times, as long as no existing records have changed (if existing records have changed, update=True must be used). Old records can never be removed by this method.

Implementations should guarantee that registration is atomic (the registry should not be modified if any error occurs) and idempotent at the level of individual dimension entries; new detectors and filters should be added, but changes to any existing record should not be. This can generally be achieved via a block like

with registry.transaction():
    registry.syncDimensionData("instrument", ...)
    registry.syncDimensionData("detector", ...)
    self.registerFilters(registry)