lsst.obs.base
19.0.0-56-g64d9981+3
|
Public Member Functions | |
def | __init__ (self) |
def | __str__ (self) |
def | addRule (self, KeyHandler handler, Optional[str] instrument=None, Optional[str] datasetTypeName=None, Iterable[str] gen2keys=(), bool consume=True) |
def | addGenericInstrumentRules (self, str instrumentName, str calibFilterType="physical_filter", str detectorKey="ccd", str exposureKey="visit") |
def | makeMatching (self, str datasetTypeName, Dict[str, type] gen2keys, Optional[str] instrument=None, Optional[BaseSkyMap] skyMap=None, Optional[str] skyMapName=None) |
A class that manages a system of rules for translating Gen2 data IDs to Gen3 data IDs, and uses these to construct translators for particular dataset types.
Definition at line 281 of file translators.py.
def lsst.obs.base.gen2to3.translators.TranslatorFactory.__init__ | ( | self | ) |
Definition at line 286 of file translators.py.
def lsst.obs.base.gen2to3.translators.TranslatorFactory.__str__ | ( | self | ) |
Definition at line 302 of file translators.py.
def lsst.obs.base.gen2to3.translators.TranslatorFactory.addGenericInstrumentRules | ( | self, | |
str | instrumentName, | ||
str | calibFilterType = "physical_filter" , |
||
str | detectorKey = "ccd" , |
||
str | exposureKey = "visit" |
||
) |
Add translation rules that depend on some properties of the instrument but are otherwise generic. Parameters ---------- instrument : `str` The short (dimension) name of the instrument that conversion is going to be run on. calibFilterType : `str`, optional One of ``physical_filter`` or ``abstract_filter``, indicating which of those the gen2 calibRegistry uses as the ``filter`` key. detectorKey : `str`, optional The gen2 key used to identify what in gen3 is `detector`. exposureKey : `str`, optional The gen2 key used to identify what in gen3 is `exposure`.
Definition at line 391 of file translators.py.
def lsst.obs.base.gen2to3.translators.TranslatorFactory.addRule | ( | self, | |
KeyHandler | handler, | ||
Optional[str] | instrument = None , |
||
Optional[str] | datasetTypeName = None , |
||
Iterable[str] | gen2keys = () , |
||
bool | consume = True |
||
) |
Add a KeyHandler and an associated matching rule. Parameters ---------- handler : `KeyHandler` A KeyHandler instance to add to a Translator when this rule matches. instrument : `str` Gen3 instrument name the Gen2 repository must be associated with for this rule to match, or None to match any instrument. datasetTypeName : `str` Name of the DatasetType this rule matches, or None to match any DatasetType. gen2Keys : sequence Sequence of Gen2 data ID keys that must all be present for this rule to match. consume : `bool` or `tuple` If True (default), remove all entries in gen2keys from the set of keys being matched to in order to prevent less-specific handlers from matching them. May also be a `tuple` listing only the keys to consume.
Definition at line 316 of file translators.py.
def lsst.obs.base.gen2to3.translators.TranslatorFactory.makeMatching | ( | self, | |
str | datasetTypeName, | ||
Dict[str, type] | gen2keys, | ||
Optional[str] | instrument = None , |
||
Optional[BaseSkyMap] | skyMap = None , |
||
Optional[str] | skyMapName = None |
||
) |
Construct a Translator appropriate for instances of the given dataset. Parameters ---------- datasetTypeName : `str` Name of the dataset type. gen2keys: `dict` Keys of a Gen2 data ID for this dataset. instrument: `str`, optional Name of the Gen3 instrument dimension for translated data IDs. skyMap: `~lsst.skymap.BaseSkyMap`, optional The skymap instance that defines any tract/patch data IDs. `~lsst.skymap.BaseSkyMap` instances. skyMapName : `str`, optional Gen3 SkyMap Dimension name to be associated with any tract or patch Dimensions. Returns ------- translator : `Translator` A translator whose translate() method can be used to transform Gen2 data IDs to Gen3 dataIds.
Definition at line 455 of file translators.py.