CalibrationMapping

class lsst.obs.base.CalibrationMapping(datasetType, policy, registry, calibRegistry, calibRoot, dataRoot=None, **kwargs)

Bases: Mapping

CalibrationMapping is a Mapping subclass for calibration-type products.

The difference is that data properties in the query or template can be looked up using a reference Mapping in addition to this one.

CalibrationMapping Policies can contain the following:

reference (string, optional)

a list of tables for finding missing dataset identifier components (including the observation time, if a validity range is required) in the exposure registry; note that the “tables” entry refers to the calibration registry

refCols (string, optional)

a list of dataset properties required from the reference tables for lookups in the calibration registry

validRange (bool)

true if the calibration dataset has a validity range specified by a column in the tables of the reference dataset in the exposure registry) and two columns in the tables of this calibration dataset in the calibration registry)

obsTimeName (string, optional)

the name of the column in the reference dataset tables containing the observation time (default “taiObs”)

validStartName (string, optional)

the name of the column in the calibration dataset tables containing the start of the validity range (default “validStart”)

validEndName (string, optional)

the name of the column in the calibration dataset tables containing the end of the validity range (default “validEnd”)

Parameters:
datasetTypestr

Butler dataset type to be mapped.

policydaf_persistence.Policy

Mapping Policy.

registrylsst.obs.base.Registry

Registry for metadata lookups

calibRegistrylsst.obs.base.Registry

Registry for calibration metadata lookups.

calibRootstr

Path of calibration root directory.

dataRootstr

Path of data root directory; used for outputs only.

Attributes Summary

template

Methods Summary

have(properties, dataId)

Returns whether the provided data identifier has all the properties in the provided list.

keys()

Return the dict of keys and value types required by this mapping.

lookup(properties, dataId)

Look up properties for in a metadata registry given a partial dataset identifier.

map(mapper, dataId[, write])

Standard implementation of map function.

need(properties, dataId)

Ensures all properties in the provided list are present in the data identifier, looking them up as needed.

standardize(mapper, item, dataId)

Default standardization function for calibration datasets.

Attributes Documentation

template

Methods Documentation

have(properties, dataId)

Returns whether the provided data identifier has all the properties in the provided list.

Parameters:
propertieslist of `str

Properties required.

dataIddict

Dataset identifier.

Returns:
bool

True if all properties are present.

keys()

Return the dict of keys and value types required by this mapping.

lookup(properties, dataId)

Look up properties for in a metadata registry given a partial dataset identifier.

Parameters:
propertieslist of str

Properties to look up.

dataIddict

Dataset identifier.

Returns:
list of tuple

Values of properties.

map(mapper, dataId, write=False)

Standard implementation of map function.

Parameters:
mapper: `lsst.daf.persistence.Mapper`

Object to be mapped.

dataId: `dict`

Dataset identifier.

Returns:
lsst.daf.persistence.ButlerLocation

Location of object that was mapped.

need(properties, dataId)

Ensures all properties in the provided list are present in the data identifier, looking them up as needed. This is only possible for the case where the data identifies a single exposure.

Parameters:
propertieslist of str

Properties required.

dataIddict

Partial dataset identifier

Returns:
dict

Copy of dataset identifier with enhanced values.

standardize(mapper, item, dataId)

Default standardization function for calibration datasets.

If the item is of a type that should be standardized, the base class standardizeExposure method is called, otherwise the item is returned unmodified.

Parameters:
mappinglsst.obs.base.Mapping

Mapping object to pass through.

itemobject

Will be standardized if of type lsst.afw.image.Exposure, lsst.afw.image.DecoratedImage, lsst.afw.image.Image or lsst.afw.image.MaskedImage

dataIddict

Dataset identifier

Returns:
lsst.afw.image.Exposure or item

The standardized object.