LSSTApplications  19.0.0-14-gb0260a2+1009f50558,20.0.0+089c43b26b,20.0.0+126303c00d,20.0.0+2f3d0e5c40,20.0.0+36ef800059,20.0.0+5efbb753f1,20.0.0+bebc1f60e8,20.0.0+c31f88ab0f,20.0.0+e2e26847c2,20.0.0+f8788d280b,20.0.0-1-g10df615+c10c626ef0,20.0.0-1-g253301a+36ef800059,20.0.0-1-g2b7511a+bebc1f60e8,20.0.0-1-g4d801e7+2364cbef1f,20.0.0-1-g5b95a8c+f41a630bc9,20.0.0-1-g660595b+f45b7d88f4,20.0.0-1-gc96f8cb+4c66cd7cf3,20.0.0-1-gd1c87d7+85c46248f3,20.0.0-1-gedffbd8+f975718b49,20.0.0-13-ge9dc5b3+55648be1db,20.0.0-15-ga86d0f6+bdc7c63f7c,20.0.0-15-gf5872d0+4c66cd7cf3,20.0.0-16-g6fe20a1+a77778c47d,20.0.0-2-g4dae9ad+4c66cd7cf3,20.0.0-2-g7818986+85c46248f3,20.0.0-2-gec03fae+ff10c6d78d,20.0.0-25-g38d2b7ae+bde7f0c6ec,20.0.0-3-g4cc78c6+63636aeed8,20.0.0-3-g6a8623c+55648be1db,20.0.0-3-g750bffe+823a89ab62,20.0.0-4-gfea843c+f45b7d88f4,20.0.0-47-g0830830+f5f993f8be,20.0.0-5-g357b56b+f45b7d88f4,20.0.0-5-gfcebe35+8726ad94da,20.0.0-7-gc818c6e6+aaebb51c78,20.0.0-7-gcda7bf1+2a82aa79eb,20.0.0-9-g61a2a9a3d+14f89e4eca,w.2020.38
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | List of all members
lsst.obs.base.gen2to3.translators.CalibKeyHandler Class Reference
Inheritance diagram for lsst.obs.base.gen2to3.translators.CalibKeyHandler:
lsst.obs.base.gen2to3.translators.KeyHandler

Public Member Functions

def __init__ (self, ccdKey="ccd")
 
Any extract (self, dict gen2id, Optional[BaseSkyMap] skyMap, Optional[str] skyMapName, str datasetTypeName)
 
def __repr__ (self)
 
def translate (self, dict gen2id, dict gen3id, Optional[BaseSkyMap] skyMap, Optional[str] skyMapName, str datasetTypeName)
 

Public Attributes

 ccdKey
 
 dimension
 

Detailed Description

A KeyHandler for master calibration datasets.

Definition at line 223 of file translators.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.obs.base.gen2to3.translators.CalibKeyHandler.__init__ (   self,
  ccdKey = "ccd" 
)

Definition at line 228 of file translators.py.

228  def __init__(self, ccdKey="ccd"):
229  self.ccdKey = ccdKey
230  super().__init__("calibration_label")
231 

Member Function Documentation

◆ __repr__()

def lsst.obs.base.gen2to3.translators.KeyHandler.__repr__ (   self)
inherited

Definition at line 81 of file translators.py.

81  def __repr__(self):
82  return f"{type(self).__name__}({self.dimension}, ...)"
83 

◆ extract()

Any lsst.obs.base.gen2to3.translators.CalibKeyHandler.extract (   self,
dict  gen2id,
Optional[BaseSkyMap skyMap,
Optional[str]  skyMapName,
str  datasetTypeName 
)
Extract a Gen3 data ID value from a Gen2 data ID.

Parameters
----------
gen2id: `dict`
    Gen2 data ID from which to draw key-value pairs from.
skyMap: `BaseSkyMap`, optional
    SkyMap that defines the tracts and patches used in the Gen2 data
    ID, if any.
skyMapName: `str`
    Name of the Gen3 skymap dimension that defines the tracts and
    patches used in the Gen3 data ID.
datasetTypeName: `str`
    Name of the dataset type.

Reimplemented from lsst.obs.base.gen2to3.translators.KeyHandler.

Definition at line 232 of file translators.py.

232  def extract(self, gen2id: dict, skyMap: Optional[BaseSkyMap], skyMapName: Optional[str],
233  datasetTypeName: str) -> Any:
234  # Docstring inherited from KeyHandler.extract.
235  return makeCalibrationLabel(datasetTypeName, gen2id["calibDate"],
236  ccd=gen2id.get(self.ccdKey), filter=gen2id.get("filter"))
237 
238 

◆ translate()

def lsst.obs.base.gen2to3.translators.KeyHandler.translate (   self,
dict  gen2id,
dict  gen3id,
Optional[BaseSkyMap skyMap,
Optional[str]  skyMapName,
str  datasetTypeName 
)
inherited
Update a Gen3 data ID dict with a single key-value pair from a Gen2
data ID.

This method is implemented by the base class and is not expected to
be re-implemented by subclasses.

Parameters
----------
gen2id: `dict`
    Gen2 data ID from which to draw key-value pairs from.
gen3id: `dict`
    Gen3 data ID to update in-place.
skyMap: `BaseSkyMap`, optional
    SkyMap that defines the tracts and patches used in the Gen2 data
    ID, if any.
skyMapName: `str`
    Name of the Gen3 skymap dimension that defines the tracts and
    patches used in the Gen3 data ID.
datasetTypeName: `str`
    Name of the dataset type.

Definition at line 84 of file translators.py.

84  def translate(self, gen2id: dict, gen3id: dict,
85  skyMap: Optional[BaseSkyMap], skyMapName: Optional[str],
86  datasetTypeName: str):
87  """Update a Gen3 data ID dict with a single key-value pair from a Gen2
88  data ID.
89 
90  This method is implemented by the base class and is not expected to
91  be re-implemented by subclasses.
92 
93  Parameters
94  ----------
95  gen2id: `dict`
96  Gen2 data ID from which to draw key-value pairs from.
97  gen3id: `dict`
98  Gen3 data ID to update in-place.
99  skyMap: `BaseSkyMap`, optional
100  SkyMap that defines the tracts and patches used in the Gen2 data
101  ID, if any.
102  skyMapName: `str`
103  Name of the Gen3 skymap dimension that defines the tracts and
104  patches used in the Gen3 data ID.
105  datasetTypeName: `str`
106  Name of the dataset type.
107  """
108  gen3id[self.dimension] = self.extract(gen2id, skyMap=skyMap, skyMapName=skyMapName,
109  datasetTypeName=datasetTypeName)
110 

Member Data Documentation

◆ ccdKey

lsst.obs.base.gen2to3.translators.CalibKeyHandler.ccdKey

Definition at line 229 of file translators.py.

◆ dimension

lsst.obs.base.gen2to3.translators.KeyHandler.dimension
inherited

Definition at line 77 of file translators.py.


The documentation for this class was generated from the following file:
lsst.obs.base.gen2to3.translators.makeCalibrationLabel
str makeCalibrationLabel(str datasetTypeName, str calibDate, Optional[int] ccd=None, Optional[str] filter=None)
Definition: translators.py:36
lsst.pex::exceptions.wrappers.translate
def translate(cpp)
Definition: wrappers.py:144