LSSTApplications  19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
LSSTDataManagementBasePackage
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.obs.test.testMapper.TestMapper Class Reference
Inheritance diagram for lsst.obs.test.testMapper.TestMapper:
lsst.obs.base.cameraMapper.CameraMapper lsst.daf.persistence.mapper.Mapper

Public Member Functions

def __init__ (self, inputPolicy=None, **kwargs)
 
def bypass_ccdExposureId (self, datasetType, pythonType, location, dataId)
 
def bypass_ccdExposureId_bits (self, datasetType, pythonType, location, dataId)
 
def validate (self, dataId)
 
def backup (self, datasetType, dataId)
 
def keys (self)
 
def getKeys (self, datasetType, level)
 
def getDefaultLevel (self)
 
def getDefaultSubLevel (self, level)
 
def getCameraName (cls)
 
def getPackageName (cls)
 
def getGen3Instrument (cls)
 
def getPackageDir (cls)
 
def map_camera (self, dataId, write=False)
 
def bypass_camera (self, datasetType, pythonType, butlerLocation, dataId)
 
def map_expIdInfo (self, dataId, write=False)
 
def bypass_expIdInfo (self, datasetType, pythonType, location, dataId)
 
def std_bfKernel (self, item, dataId)
 
def std_raw (self, item, dataId)
 
def map_skypolicy (self, dataId)
 
def std_skypolicy (self, item, dataId)
 
def getRegistry (self)
 
def getImageCompressionSettings (self, datasetType, dataId)
 
def __new__ (cls, *args, **kwargs)
 
def __getstate__ (self)
 
def __setstate__ (self, state)
 
def queryMetadata (self, datasetType, format, dataId)
 
def getDatasetTypes (self)
 
def map (self, datasetType, dataId, write=False)
 
def canStandardize (self, datasetType)
 
def standardize (self, datasetType, item, dataId)
 

Static Public Member Functions

def getShortCcdName (ccdName)
 

Public Attributes

 doFootprints
 
 filterIdMap
 
 log
 
 root
 
 levels
 
 defaultLevel
 
 defaultSubLevels
 
 rootStorage
 
 registry
 
 calibRegistry
 
 keyDict
 
 cameraDataLocation
 
 camera
 
 filters
 
 makeRawVisitInfo
 
 mappings
 

Static Public Attributes

string packageName = 'obs_test'
 
 MakeRawVisitInfoClass = MakeTestRawVisitInfo
 
 PupilFactoryClass = afwCameraGeom.PupilFactory
 
 translatorClass = None
 

Detailed Description

Camera mapper for the Test camera.

Definition at line 34 of file testMapper.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.obs.test.testMapper.TestMapper.__init__ (   self,
  inputPolicy = None,
**  kwargs 
)

Definition at line 41 of file testMapper.py.

41  def __init__(self, inputPolicy=None, **kwargs):
42  policyFilePath = dafPersist.Policy.defaultPolicyFile(self.packageName, "testMapper.yaml", "policy")
43  policy = dafPersist.Policy(policyFilePath)
44 
45  self.doFootprints = False
46  if inputPolicy is not None:
47  for kw in inputPolicy.paramNames(True):
48  if kw == "doFootprints":
49  self.doFootprints = True
50  else:
51  kwargs[kw] = inputPolicy.get(kw)
52 
53  CameraMapper.__init__(self, policy, policyFilePath, **kwargs)
54  self.filterIdMap = {
55  'u': 0, 'g': 1, 'r': 2, 'i': 3, 'z': 4, 'y': 5, 'i2': 5}
56 
57  # The LSST Filters from L. Jones 04/07/10
58  afwImageUtils.defineFilter('u', 364.59)
59  afwImageUtils.defineFilter('g', 476.31)
60  afwImageUtils.defineFilter('r', 619.42)
61  afwImageUtils.defineFilter('i', 752.06)
62  afwImageUtils.defineFilter('z', 866.85)
63  afwImageUtils.defineFilter('y', 971.68, alias=['y4']) # official y filter
64 

Member Function Documentation

◆ __getstate__()

def lsst.daf.persistence.mapper.Mapper.__getstate__ (   self)
inherited

Definition at line 101 of file mapper.py.

101  def __getstate__(self):
102  return self._arguments
103 

◆ __new__()

def lsst.daf.persistence.mapper.Mapper.__new__ (   cls,
args,
**  kwargs 
)
inherited
Create a new Mapper, saving arguments for pickling.

This is in __new__ instead of __init__ to save the user
from having to save the arguments themselves (either explicitly,
or by calling the super's __init__ with all their
*args,**kwargs.  The resulting pickling system (of __new__,
__getstate__ and __setstate__ is similar to how __reduce__
is usually used, except that we save the user from any
responsibility (except when overriding __new__, but that
is not common).

Definition at line 82 of file mapper.py.

82  def __new__(cls, *args, **kwargs):
83  """Create a new Mapper, saving arguments for pickling.
84 
85  This is in __new__ instead of __init__ to save the user
86  from having to save the arguments themselves (either explicitly,
87  or by calling the super's __init__ with all their
88  *args,**kwargs. The resulting pickling system (of __new__,
89  __getstate__ and __setstate__ is similar to how __reduce__
90  is usually used, except that we save the user from any
91  responsibility (except when overriding __new__, but that
92  is not common).
93  """
94  self = super().__new__(cls)
95  self._arguments = (args, kwargs)
96  return self
97 

◆ __setstate__()

def lsst.daf.persistence.mapper.Mapper.__setstate__ (   self,
  state 
)
inherited

Definition at line 104 of file mapper.py.

104  def __setstate__(self, state):
105  self._arguments = state
106  args, kwargs = state
107  self.__init__(*args, **kwargs)
108 

◆ backup()

def lsst.obs.base.cameraMapper.CameraMapper.backup (   self,
  datasetType,
  dataId 
)
inherited
Rename any existing object with the given type and dataId.

The CameraMapper implementation saves objects in a sequence of e.g.:

- foo.fits
- foo.fits~1
- foo.fits~2

All of the backups will be placed in the output repo, however, and will
not be removed if they are found elsewhere in the _parent chain.  This
means that the same file will be stored twice if the previous version
was found in an input repo.

Reimplemented from lsst.daf.persistence.mapper.Mapper.

Definition at line 599 of file cameraMapper.py.

599  def backup(self, datasetType, dataId):
600  """Rename any existing object with the given type and dataId.
601 
602  The CameraMapper implementation saves objects in a sequence of e.g.:
603 
604  - foo.fits
605  - foo.fits~1
606  - foo.fits~2
607 
608  All of the backups will be placed in the output repo, however, and will
609  not be removed if they are found elsewhere in the _parent chain. This
610  means that the same file will be stored twice if the previous version
611  was found in an input repo.
612  """
613 
614  # Calling PosixStorage directly is not the long term solution in this
615  # function, this is work-in-progress on epic DM-6225. The plan is for
616  # parentSearch to be changed to 'search', and search only the storage
617  # associated with this mapper. All searching of parents will be handled
618  # by traversing the container of repositories in Butler.
619 
620  def firstElement(list):
621  """Get the first element in the list, or None if that can't be
622  done.
623  """
624  return list[0] if list is not None and len(list) else None
625 
626  n = 0
627  newLocation = self.map(datasetType, dataId, write=True)
628  newPath = newLocation.getLocations()[0]
629  path = dafPersist.PosixStorage.search(self.root, newPath, searchParents=True)
630  path = firstElement(path)
631  oldPaths = []
632  while path is not None:
633  n += 1
634  oldPaths.append((n, path))
635  path = dafPersist.PosixStorage.search(self.root, "%s~%d" % (newPath, n), searchParents=True)
636  path = firstElement(path)
637  for n, oldPath in reversed(oldPaths):
638  self.rootStorage.copyFile(oldPath, "%s~%d" % (newPath, n))
639 

◆ bypass_camera()

def lsst.obs.base.cameraMapper.CameraMapper.bypass_camera (   self,
  datasetType,
  pythonType,
  butlerLocation,
  dataId 
)
inherited
Return the (preloaded) camera object.

Definition at line 751 of file cameraMapper.py.

751  def bypass_camera(self, datasetType, pythonType, butlerLocation, dataId):
752  """Return the (preloaded) camera object.
753  """
754  if self.camera is None:
755  raise RuntimeError("No camera dataset available.")
756  return self.camera
757 

◆ bypass_ccdExposureId()

def lsst.obs.test.testMapper.TestMapper.bypass_ccdExposureId (   self,
  datasetType,
  pythonType,
  location,
  dataId 
)

Definition at line 101 of file testMapper.py.

101  def bypass_ccdExposureId(self, datasetType, pythonType, location, dataId):
102  return self._computeCcdExposureId(dataId)
103 

◆ bypass_ccdExposureId_bits()

def lsst.obs.test.testMapper.TestMapper.bypass_ccdExposureId_bits (   self,
  datasetType,
  pythonType,
  location,
  dataId 
)

Definition at line 104 of file testMapper.py.

104  def bypass_ccdExposureId_bits(self, datasetType, pythonType, location, dataId):
105  return 41
106 

◆ bypass_expIdInfo()

def lsst.obs.base.cameraMapper.CameraMapper.bypass_expIdInfo (   self,
  datasetType,
  pythonType,
  location,
  dataId 
)
inherited
Hook to retrieve an lsst.obs.base.ExposureIdInfo for an exposure

Definition at line 769 of file cameraMapper.py.

769  def bypass_expIdInfo(self, datasetType, pythonType, location, dataId):
770  """Hook to retrieve an lsst.obs.base.ExposureIdInfo for an exposure"""
771  expId = self.bypass_ccdExposureId(datasetType, pythonType, location, dataId)
772  expBits = self.bypass_ccdExposureId_bits(datasetType, pythonType, location, dataId)
773  return ExposureIdInfo(expId=expId, expBits=expBits)
774 

◆ canStandardize()

def lsst.daf.persistence.mapper.Mapper.canStandardize (   self,
  datasetType 
)
inherited
Return true if this mapper can standardize an object of the given
dataset type.

Definition at line 165 of file mapper.py.

165  def canStandardize(self, datasetType):
166  """Return true if this mapper can standardize an object of the given
167  dataset type."""
168 
169  return hasattr(self, 'std_' + datasetType)
170 

◆ getCameraName()

def lsst.obs.base.cameraMapper.CameraMapper.getCameraName (   cls)
inherited
Return the name of the camera that this CameraMapper is for.

Definition at line 694 of file cameraMapper.py.

694  def getCameraName(cls):
695  """Return the name of the camera that this CameraMapper is for."""
696  className = str(cls)
697  className = className[className.find('.'):-1]
698  m = re.search(r'(\w+)Mapper', className)
699  if m is None:
700  m = re.search(r"class '[\w.]*?(\w+)'", className)
701  name = m.group(1)
702  return name[:1].lower() + name[1:] if name else ''
703 

◆ getDatasetTypes()

def lsst.daf.persistence.mapper.Mapper.getDatasetTypes (   self)
inherited
Return a list of the mappable dataset types.

Definition at line 126 of file mapper.py.

126  def getDatasetTypes(self):
127  """Return a list of the mappable dataset types."""
128 
129  list = []
130  for attr in dir(self):
131  if attr.startswith("map_"):
132  list.append(attr[4:])
133  return list
134 

◆ getDefaultLevel()

def lsst.obs.base.cameraMapper.CameraMapper.getDefaultLevel (   self)
inherited

Definition at line 685 of file cameraMapper.py.

685  def getDefaultLevel(self):
686  return self.defaultLevel
687 

◆ getDefaultSubLevel()

def lsst.obs.base.cameraMapper.CameraMapper.getDefaultSubLevel (   self,
  level 
)
inherited

Definition at line 688 of file cameraMapper.py.

688  def getDefaultSubLevel(self, level):
689  if level in self.defaultSubLevels:
690  return self.defaultSubLevels[level]
691  return None
692 

◆ getGen3Instrument()

def lsst.obs.base.cameraMapper.CameraMapper.getGen3Instrument (   cls)
inherited
Return the gen3 Instrument class equivalent for this gen2 Mapper.

Returns
-------
instr : `type`
    A `~lsst.obs.base.Instrument` class.

Definition at line 712 of file cameraMapper.py.

712  def getGen3Instrument(cls):
713  """Return the gen3 Instrument class equivalent for this gen2 Mapper.
714 
715  Returns
716  -------
717  instr : `type`
718  A `~lsst.obs.base.Instrument` class.
719  """
720  if cls._gen3instrument is None:
721  raise NotImplementedError("Please provide a specific implementation for your instrument"
722  " to enable conversion of this gen2 repository to gen3")
723  if isinstance(cls._gen3instrument, str):
724  # Given a string to convert to an instrument class
725  cls._gen3instrument = doImport(cls._gen3instrument)
726  if not issubclass(cls._gen3instrument, Instrument):
727  raise ValueError(f"Mapper {cls} has declared a gen3 instrument class of {cls._gen3instrument}"
728  " but that is not an lsst.obs.base.Instrument")
729  return cls._gen3instrument
730 

◆ getImageCompressionSettings()

def lsst.obs.base.cameraMapper.CameraMapper.getImageCompressionSettings (   self,
  datasetType,
  dataId 
)
inherited
Stuff image compression settings into a daf.base.PropertySet

This goes into the ButlerLocation's "additionalData", which gets
passed into the boost::persistence framework.

Parameters
----------
datasetType : `str`
    Type of dataset for which to get the image compression settings.
dataId : `dict`
    Dataset identifier.

Returns
-------
additionalData : `lsst.daf.base.PropertySet`
    Image compression settings.

Definition at line 1209 of file cameraMapper.py.

1209  def getImageCompressionSettings(self, datasetType, dataId):
1210  """Stuff image compression settings into a daf.base.PropertySet
1211 
1212  This goes into the ButlerLocation's "additionalData", which gets
1213  passed into the boost::persistence framework.
1214 
1215  Parameters
1216  ----------
1217  datasetType : `str`
1218  Type of dataset for which to get the image compression settings.
1219  dataId : `dict`
1220  Dataset identifier.
1221 
1222  Returns
1223  -------
1224  additionalData : `lsst.daf.base.PropertySet`
1225  Image compression settings.
1226  """
1227  mapping = self.mappings[datasetType]
1228  recipeName = mapping.recipe
1229  storageType = mapping.storage
1230  if storageType not in self._writeRecipes:
1231  return dafBase.PropertySet()
1232  if recipeName not in self._writeRecipes[storageType]:
1233  raise RuntimeError("Unrecognized write recipe for datasetType %s (storage type %s): %s" %
1234  (datasetType, storageType, recipeName))
1235  recipe = self._writeRecipes[storageType][recipeName].deepCopy()
1236  seed = hash(tuple(dataId.items())) % 2**31
1237  for plane in ("image", "mask", "variance"):
1238  if recipe.exists(plane + ".scaling.seed") and recipe.getScalar(plane + ".scaling.seed") == 0:
1239  recipe.set(plane + ".scaling.seed", seed)
1240  return recipe
1241 

◆ getKeys()

def lsst.obs.base.cameraMapper.CameraMapper.getKeys (   self,
  datasetType,
  level 
)
inherited
Return a dict of supported keys and their value types for a given
dataset type at a given level of the key hierarchy.

Parameters
----------
datasetType :  `str`
    Dataset type or None for all dataset types.
level :  `str` or None
    Level or None for all levels or '' for the default level for the
    camera.

Returns
-------
`dict`
    Keys are strings usable in a dataset identifier, values are their
    value types.

Definition at line 650 of file cameraMapper.py.

650  def getKeys(self, datasetType, level):
651  """Return a dict of supported keys and their value types for a given
652  dataset type at a given level of the key hierarchy.
653 
654  Parameters
655  ----------
656  datasetType : `str`
657  Dataset type or None for all dataset types.
658  level : `str` or None
659  Level or None for all levels or '' for the default level for the
660  camera.
661 
662  Returns
663  -------
664  `dict`
665  Keys are strings usable in a dataset identifier, values are their
666  value types.
667  """
668 
669  # not sure if this is how we want to do this. what if None was
670  # intended?
671  if level == '':
672  level = self.getDefaultLevel()
673 
674  if datasetType is None:
675  keyDict = copy.copy(self.keyDict)
676  else:
677  keyDict = self.mappings[datasetType].keys()
678  if level is not None and level in self.levels:
679  keyDict = copy.copy(keyDict)
680  for lev in self.levels[level]:
681  if lev in keyDict:
682  del keyDict[lev]
683  return keyDict
684 

◆ getPackageDir()

def lsst.obs.base.cameraMapper.CameraMapper.getPackageDir (   cls)
inherited
Return the base directory of this package

Reimplemented in lsst.obs.base.test.baseMapper.BaseMapper.

Definition at line 732 of file cameraMapper.py.

732  def getPackageDir(cls):
733  """Return the base directory of this package"""
734  return getPackageDir(cls.getPackageName())
735 

◆ getPackageName()

def lsst.obs.base.cameraMapper.CameraMapper.getPackageName (   cls)
inherited
Return the name of the package containing this CameraMapper.

Definition at line 705 of file cameraMapper.py.

705  def getPackageName(cls):
706  """Return the name of the package containing this CameraMapper."""
707  if cls.packageName is None:
708  raise ValueError('class variable packageName must not be None')
709  return cls.packageName
710 

◆ getRegistry()

def lsst.obs.base.cameraMapper.CameraMapper.getRegistry (   self)
inherited
Get the registry used by this mapper.

Returns
-------
Registry or None
    The registry used by this mapper for this mapper's repository.

Reimplemented from lsst.daf.persistence.mapper.Mapper.

Definition at line 1199 of file cameraMapper.py.

1199  def getRegistry(self):
1200  """Get the registry used by this mapper.
1201 
1202  Returns
1203  -------
1204  Registry or None
1205  The registry used by this mapper for this mapper's repository.
1206  """
1207  return self.registry
1208 

◆ getShortCcdName()

def lsst.obs.base.cameraMapper.CameraMapper.getShortCcdName (   ccdName)
staticinherited
Convert a CCD name to a form useful as a filename

The default implementation converts spaces to underscores.

Definition at line 963 of file cameraMapper.py.

963  def getShortCcdName(ccdName):
964  """Convert a CCD name to a form useful as a filename
965 
966  The default implementation converts spaces to underscores.
967  """
968  return ccdName.replace(" ", "_")
969 

◆ keys()

def lsst.obs.base.cameraMapper.CameraMapper.keys (   self)
inherited
Return supported keys.

Returns
-------
iterable
    List of keys usable in a dataset identifier

Reimplemented from lsst.daf.persistence.mapper.Mapper.

Definition at line 640 of file cameraMapper.py.

640  def keys(self):
641  """Return supported keys.
642 
643  Returns
644  -------
645  iterable
646  List of keys usable in a dataset identifier
647  """
648  return iter(self.keyDict.keys())
649 

◆ map()

def lsst.daf.persistence.mapper.Mapper.map (   self,
  datasetType,
  dataId,
  write = False 
)
inherited
Map a data id using the mapping method for its dataset type.

Parameters
----------
datasetType : string
    The datasetType to map
dataId : DataId instance
    The dataId to use when mapping
write : bool, optional
    Indicates if the map is being performed for a read operation
    (False) or a write operation (True)

Returns
-------
ButlerLocation or a list of ButlerLocation
    The location(s) found for the map operation. If write is True, a
    list is returned. If write is False a single ButlerLocation is
    returned.

Raises
------
NoResults
    If no locaiton was found for this map operation, the derived mapper
    class may raise a lsst.daf.persistence.NoResults exception. Butler
    catches this and will look in the next Repository if there is one.

Definition at line 135 of file mapper.py.

135  def map(self, datasetType, dataId, write=False):
136  """Map a data id using the mapping method for its dataset type.
137 
138  Parameters
139  ----------
140  datasetType : string
141  The datasetType to map
142  dataId : DataId instance
143  The dataId to use when mapping
144  write : bool, optional
145  Indicates if the map is being performed for a read operation
146  (False) or a write operation (True)
147 
148  Returns
149  -------
150  ButlerLocation or a list of ButlerLocation
151  The location(s) found for the map operation. If write is True, a
152  list is returned. If write is False a single ButlerLocation is
153  returned.
154 
155  Raises
156  ------
157  NoResults
158  If no locaiton was found for this map operation, the derived mapper
159  class may raise a lsst.daf.persistence.NoResults exception. Butler
160  catches this and will look in the next Repository if there is one.
161  """
162  func = getattr(self, 'map_' + datasetType)
163  return func(self.validate(dataId), write)
164 

◆ map_camera()

def lsst.obs.base.cameraMapper.CameraMapper.map_camera (   self,
  dataId,
  write = False 
)
inherited
Map a camera dataset.

Definition at line 736 of file cameraMapper.py.

736  def map_camera(self, dataId, write=False):
737  """Map a camera dataset."""
738  if self.camera is None:
739  raise RuntimeError("No camera dataset available.")
740  actualId = self._transformId(dataId)
742  pythonType="lsst.afw.cameraGeom.CameraConfig",
743  cppType="Config",
744  storageName="ConfigStorage",
745  locationList=self.cameraDataLocation or "ignored",
746  dataId=actualId,
747  mapper=self,
748  storage=self.rootStorage
749  )
750 

◆ map_expIdInfo()

def lsst.obs.base.cameraMapper.CameraMapper.map_expIdInfo (   self,
  dataId,
  write = False 
)
inherited

Definition at line 758 of file cameraMapper.py.

758  def map_expIdInfo(self, dataId, write=False):
760  pythonType="lsst.obs.base.ExposureIdInfo",
761  cppType=None,
762  storageName="Internal",
763  locationList="ignored",
764  dataId=dataId,
765  mapper=self,
766  storage=self.rootStorage
767  )
768 

◆ map_skypolicy()

def lsst.obs.base.cameraMapper.CameraMapper.map_skypolicy (   self,
  dataId 
)
inherited
Map a sky policy.

Definition at line 791 of file cameraMapper.py.

791  def map_skypolicy(self, dataId):
792  """Map a sky policy."""
793  return dafPersist.ButlerLocation("lsst.pex.policy.Policy", "Policy",
794  "Internal", None, None, self,
795  storage=self.rootStorage)
796 

◆ queryMetadata()

def lsst.daf.persistence.mapper.Mapper.queryMetadata (   self,
  datasetType,
  format,
  dataId 
)
inherited
Get possible values for keys given a partial data id.

:param datasetType: see documentation about the use of datasetType
:param key: this is used as the 'level' parameter
:param format:
:param dataId: see documentation about the use of dataId
:return:

Definition at line 112 of file mapper.py.

112  def queryMetadata(self, datasetType, format, dataId):
113  """Get possible values for keys given a partial data id.
114 
115  :param datasetType: see documentation about the use of datasetType
116  :param key: this is used as the 'level' parameter
117  :param format:
118  :param dataId: see documentation about the use of dataId
119  :return:
120  """
121  func = getattr(self, 'query_' + datasetType)
122 
123  val = func(format, self.validate(dataId))
124  return val
125 

◆ standardize()

def lsst.daf.persistence.mapper.Mapper.standardize (   self,
  datasetType,
  item,
  dataId 
)
inherited
Standardize an object using the standardization method for its data
set type, if it exists.

Definition at line 171 of file mapper.py.

171  def standardize(self, datasetType, item, dataId):
172  """Standardize an object using the standardization method for its data
173  set type, if it exists."""
174 
175  if hasattr(self, 'std_' + datasetType):
176  func = getattr(self, 'std_' + datasetType)
177  return func(item, self.validate(dataId))
178  return item
179 

◆ std_bfKernel()

def lsst.obs.base.cameraMapper.CameraMapper.std_bfKernel (   self,
  item,
  dataId 
)
inherited
Disable standardization for bfKernel

bfKernel is a calibration product that is numpy array,
unlike other calibration products that are all images;
all calibration images are sent through _standardizeExposure
due to CalibrationMapping, but we don't want that to happen to bfKernel

Definition at line 775 of file cameraMapper.py.

775  def std_bfKernel(self, item, dataId):
776  """Disable standardization for bfKernel
777 
778  bfKernel is a calibration product that is numpy array,
779  unlike other calibration products that are all images;
780  all calibration images are sent through _standardizeExposure
781  due to CalibrationMapping, but we don't want that to happen to bfKernel
782  """
783  return item
784 

◆ std_raw()

def lsst.obs.base.cameraMapper.CameraMapper.std_raw (   self,
  item,
  dataId 
)
inherited
Standardize a raw dataset by converting it to an Exposure instead
of an Image

Reimplemented in lsst.obs.decam.decamMapper.DecamMapper.

Definition at line 785 of file cameraMapper.py.

785  def std_raw(self, item, dataId):
786  """Standardize a raw dataset by converting it to an Exposure instead
787  of an Image"""
788  return self._standardizeExposure(self.exposures['raw'], item, dataId,
789  trimmed=False, setVisitInfo=True)
790 

◆ std_skypolicy()

def lsst.obs.base.cameraMapper.CameraMapper.std_skypolicy (   self,
  item,
  dataId 
)
inherited
Standardize a sky policy by returning the one we use.

Definition at line 797 of file cameraMapper.py.

797  def std_skypolicy(self, item, dataId):
798  """Standardize a sky policy by returning the one we use."""
799  return self.skypolicy
800 

◆ validate()

def lsst.obs.test.testMapper.TestMapper.validate (   self,
  dataId 
)
Validate a dataId's contents.

If the dataId is valid, return it.  If an invalid component can be
transformed into a valid one, copy the dataId, fix the component, and
return the copy.  Otherwise, raise an exception.

Reimplemented from lsst.daf.persistence.mapper.Mapper.

Definition at line 107 of file testMapper.py.

107  def validate(self, dataId):
108  visit = dataId.get("visit")
109  if visit is not None and not isinstance(visit, int):
110  dataId["visit"] = int(visit)
111  return dataId
112 

Member Data Documentation

◆ calibRegistry

lsst.obs.base.cameraMapper.CameraMapper.calibRegistry
inherited

Definition at line 255 of file cameraMapper.py.

◆ camera

lsst.obs.base.cameraMapper.CameraMapper.camera
inherited

Definition at line 273 of file cameraMapper.py.

◆ cameraDataLocation

lsst.obs.base.cameraMapper.CameraMapper.cameraDataLocation
inherited

Definition at line 272 of file cameraMapper.py.

◆ defaultLevel

lsst.obs.base.cameraMapper.CameraMapper.defaultLevel
inherited

Definition at line 214 of file cameraMapper.py.

◆ defaultSubLevels

lsst.obs.base.cameraMapper.CameraMapper.defaultSubLevels
inherited

Definition at line 215 of file cameraMapper.py.

◆ doFootprints

lsst.obs.test.testMapper.TestMapper.doFootprints

Definition at line 45 of file testMapper.py.

◆ filterIdMap

lsst.obs.test.testMapper.TestMapper.filterIdMap

Definition at line 54 of file testMapper.py.

◆ filters

lsst.obs.base.cameraMapper.CameraMapper.filters
inherited

Definition at line 276 of file cameraMapper.py.

◆ keyDict

lsst.obs.base.cameraMapper.CameraMapper.keyDict
inherited

Definition at line 266 of file cameraMapper.py.

◆ levels

lsst.obs.base.cameraMapper.CameraMapper.levels
inherited

Definition at line 209 of file cameraMapper.py.

◆ log

lsst.obs.base.cameraMapper.CameraMapper.log
inherited

Definition at line 195 of file cameraMapper.py.

◆ makeRawVisitInfo

lsst.obs.base.cameraMapper.CameraMapper.makeRawVisitInfo
inherited

Definition at line 283 of file cameraMapper.py.

◆ MakeRawVisitInfoClass

lsst.obs.test.testMapper.TestMapper.MakeRawVisitInfoClass = MakeTestRawVisitInfo
static

Definition at line 39 of file testMapper.py.

◆ mappings

lsst.obs.base.cameraMapper.CameraMapper.mappings
inherited

Definition at line 336 of file cameraMapper.py.

◆ packageName

string lsst.obs.test.testMapper.TestMapper.packageName = 'obs_test'
static

Definition at line 37 of file testMapper.py.

◆ PupilFactoryClass

lsst.obs.base.cameraMapper.CameraMapper.PupilFactoryClass = afwCameraGeom.PupilFactory
staticinherited

Definition at line 182 of file cameraMapper.py.

◆ registry

lsst.obs.base.cameraMapper.CameraMapper.registry
inherited

Definition at line 247 of file cameraMapper.py.

◆ root

lsst.obs.base.cameraMapper.CameraMapper.root
inherited

Definition at line 198 of file cameraMapper.py.

◆ rootStorage

lsst.obs.base.cameraMapper.CameraMapper.rootStorage
inherited

Definition at line 224 of file cameraMapper.py.

◆ translatorClass

lsst.obs.base.cameraMapper.CameraMapper.translatorClass = None
staticinherited

Definition at line 185 of file cameraMapper.py.


The documentation for this class was generated from the following file:
astshim.keyMap.keyMapContinued.keys
def keys(self)
Definition: keyMapContinued.py:6
lsst::utils::getPackageDir
std::string getPackageDir(std::string const &packageName)
return the root directory of a setup package
Definition: packaging.cc:33
lsst::daf::persistence.butlerLocation.ButlerLocation
Definition: butlerLocation.py:148
lsst.pex.config.config.doImport
doImport
Definition: config.py:48
lsst::daf::base::PropertySet
Class for storing generic metadata.
Definition: PropertySet.h:67
lsst::daf::persistence.policy.Policy
Definition: policy.py:48
lsst.pex.config.wrap.validate
validate
Definition: wrap.py:295
astshim.fitsChanContinued.iter
def iter(self)
Definition: fitsChanContinued.py:88