DatasetMapping

class lsst.obs.base.DatasetMapping(datasetType, policy, registry, root, **kwargs)

Bases: Mapping

DatasetMapping is a Mapping subclass for non-Exposure datasets that can be retrieved by the standard daf_persistence mechanism.

The differences are that the Storage type must be specified and no Exposure standardization is performed.

The “storage” entry in the Policy is mandatory; the “tables” entry is optional; no “level” entry is allowed.

Parameters:
datasetTypestr

Butler dataset type to be mapped.

policydaf_persistence.Policy

Mapping Policy.

registrylsst.obs.base.Registry

Registry for metadata lookups

rootstr

Path of root directory

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.

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

What 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.