lsst.obs.base  20.0.0-73-gf477d90+1f94629e3c
Public Member Functions | Public Attributes | List of all members
lsst.obs.base.gen2to3.translators.TranslatorFactory Class Reference

Public Member Functions

def __init__ (self, Optional[Log] log=None)
 
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)
 

Public Attributes

 log
 

Detailed Description

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.

Parameters
----------
log : `lsst.log.Log`, optional
    A logger for diagnostic messages.

Definition at line 234 of file translators.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.obs.base.gen2to3.translators.TranslatorFactory.__init__ (   self,
Optional[Log]   log = None 
)

Definition at line 244 of file translators.py.

Member Function Documentation

◆ __str__()

def lsst.obs.base.gen2to3.translators.TranslatorFactory.__str__ (   self)

Definition at line 263 of file translators.py.

◆ addGenericInstrumentRules()

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 ``band``, 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 358 of file translators.py.

◆ addRule()

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 277 of file translators.py.

◆ makeMatching()

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 421 of file translators.py.

Member Data Documentation

◆ log

lsst.obs.base.gen2to3.translators.TranslatorFactory.log

Definition at line 261 of file translators.py.


The documentation for this class was generated from the following file: