LSSTApplications  18.1.0
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 getPackageDir (cls)
 
def map_camera (self, dataId, write=False)
 
def bypass_camera (self, datasetType, pythonType, butlerLocation, dataId)
 
def map_defects (self, dataId, write=False)
 
def bypass_defects (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
 
 defectRegistry
 
 defectPath
 
 filters
 
 makeRawVisitInfo
 
 mappings
 

Static Public Attributes

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

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 
def __init__(self, minimum, dataRange, Q)

Member Function Documentation

◆ __getstate__()

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

Definition at line 104 of file mapper.py.

104  def __getstate__(self):
105  return self._arguments
106 

◆ __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 85 of file mapper.py.

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

◆ __setstate__()

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

Definition at line 107 of file mapper.py.

107  def __setstate__(self, state):
108  self._arguments = state
109  args, kwargs = state
110  self.__init__(*args, **kwargs)
111 

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

Definition at line 566 of file cameraMapper.py.

566  def backup(self, datasetType, dataId):
567  """Rename any existing object with the given type and dataId.
568 
569  The CameraMapper implementation saves objects in a sequence of e.g.:
570 
571  - foo.fits
572  - foo.fits~1
573  - foo.fits~2
574 
575  All of the backups will be placed in the output repo, however, and will
576  not be removed if they are found elsewhere in the _parent chain. This
577  means that the same file will be stored twice if the previous version
578  was found in an input repo.
579  """
580 
581  # Calling PosixStorage directly is not the long term solution in this
582  # function, this is work-in-progress on epic DM-6225. The plan is for
583  # parentSearch to be changed to 'search', and search only the storage
584  # associated with this mapper. All searching of parents will be handled
585  # by traversing the container of repositories in Butler.
586 
587  def firstElement(list):
588  """Get the first element in the list, or None if that can't be
589  done.
590  """
591  return list[0] if list is not None and len(list) else None
592 
593  n = 0
594  newLocation = self.map(datasetType, dataId, write=True)
595  newPath = newLocation.getLocations()[0]
596  path = dafPersist.PosixStorage.search(self.root, newPath, searchParents=True)
597  path = firstElement(path)
598  oldPaths = []
599  while path is not None:
600  n += 1
601  oldPaths.append((n, path))
602  path = dafPersist.PosixStorage.search(self.root, "%s~%d" % (newPath, n), searchParents=True)
603  path = firstElement(path)
604  for n, oldPath in reversed(oldPaths):
605  self.rootStorage.copyFile(oldPath, "%s~%d" % (newPath, n))
606 

◆ bypass_camera()

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

Definition at line 697 of file cameraMapper.py.

697  def bypass_camera(self, datasetType, pythonType, butlerLocation, dataId):
698  """Return the (preloaded) camera object.
699  """
700  if self.camera is None:
701  raise RuntimeError("No camera dataset available.")
702  return self.camera
703 

◆ 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_defects()

def lsst.obs.base.cameraMapper.CameraMapper.bypass_defects (   self,
  datasetType,
  pythonType,
  butlerLocation,
  dataId 
)
inherited
Return a defect based on the butler location returned by map_defects

Parameters
----------
butlerLocation : `lsst.daf.persistence.ButlerLocation`
    locationList = path to defects FITS file
dataId : `dict`
    Butler data ID; "ccd" must be set.

Note: the name "bypass_XXX" means the butler makes no attempt to
convert the ButlerLocation into an object, which is what we want for
now, since that conversion is a bit tricky.

Definition at line 721 of file cameraMapper.py.

721  def bypass_defects(self, datasetType, pythonType, butlerLocation, dataId):
722  """Return a defect based on the butler location returned by map_defects
723 
724  Parameters
725  ----------
726  butlerLocation : `lsst.daf.persistence.ButlerLocation`
727  locationList = path to defects FITS file
728  dataId : `dict`
729  Butler data ID; "ccd" must be set.
730 
731  Note: the name "bypass_XXX" means the butler makes no attempt to
732  convert the ButlerLocation into an object, which is what we want for
733  now, since that conversion is a bit tricky.
734  """
735  detectorName = self._extractDetectorName(dataId)
736  defectsFitsPath = butlerLocation.locationList[0]
737 
738  with fits.open(defectsFitsPath) as hduList:
739  for hdu in hduList[1:]:
740  if hdu.header["name"] != detectorName:
741  continue
742 
743  defectList = []
744  for data in hdu.data:
745  bbox = afwGeom.Box2I(
746  afwGeom.Point2I(int(data['x0']), int(data['y0'])),
747  afwGeom.Extent2I(int(data['width']), int(data['height'])),
748  )
749  defectList.append(afwImage.DefectBase(bbox))
750  return defectList
751 
752  raise RuntimeError("No defects for ccd %s in %s" % (detectorName, defectsFitsPath))
753 
Encapsulate information about a bad portion of a detector.
Definition: Defect.h:41
An integer coordinate rectangle.
Definition: Box.h:54

◆ 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 765 of file cameraMapper.py.

765  def bypass_expIdInfo(self, datasetType, pythonType, location, dataId):
766  """Hook to retrieve an lsst.obs.base.ExposureIdInfo for an exposure"""
767  expId = self.bypass_ccdExposureId(datasetType, pythonType, location, dataId)
768  expBits = self.bypass_ccdExposureId_bits(datasetType, pythonType, location, dataId)
769  return ExposureIdInfo(expId=expId, expBits=expBits)
770 

◆ 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 168 of file mapper.py.

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

◆ getCameraName()

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

Definition at line 660 of file cameraMapper.py.

660  def getCameraName(cls):
661  """Return the name of the camera that this CameraMapper is for."""
662  className = str(cls)
663  className = className[className.find('.'):-1]
664  m = re.search(r'(\w+)Mapper', className)
665  if m is None:
666  m = re.search(r"class '[\w.]*?(\w+)'", className)
667  name = m.group(1)
668  return name[:1].lower() + name[1:] if name else ''
669 

◆ getDatasetTypes()

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

Definition at line 129 of file mapper.py.

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

◆ getDefaultLevel()

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

Definition at line 651 of file cameraMapper.py.

651  def getDefaultLevel(self):
652  return self.defaultLevel
653 

◆ getDefaultSubLevel()

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

Definition at line 654 of file cameraMapper.py.

654  def getDefaultSubLevel(self, level):
655  if level in self.defaultSubLevels:
656  return self.defaultSubLevels[level]
657  return None
658 

◆ 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 1212 of file cameraMapper.py.

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

◆ 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 617 of file cameraMapper.py.

617  def getKeys(self, datasetType, level):
618  """Return a dict of supported keys and their value types for a given
619  dataset type at a given level of the key hierarchy.
620 
621  Parameters
622  ----------
623  datasetType : `str`
624  Dataset type or None for all dataset types.
625  level : `str` or None
626  Level or None for all levels or '' for the default level for the
627  camera.
628 
629  Returns
630  -------
631  `dict`
632  Keys are strings usable in a dataset identifier, values are their
633  value types.
634  """
635 
636  # not sure if this is how we want to do this. what if None was intended?
637  if level == '':
638  level = self.getDefaultLevel()
639 
640  if datasetType is None:
641  keyDict = copy.copy(self.keyDict)
642  else:
643  keyDict = self.mappings[datasetType].keys()
644  if level is not None and level in self.levels:
645  keyDict = copy.copy(keyDict)
646  for l in self.levels[level]:
647  if l in keyDict:
648  del keyDict[l]
649  return keyDict
650 

◆ getPackageDir()

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

Definition at line 678 of file cameraMapper.py.

678  def getPackageDir(cls):
679  """Return the base directory of this package"""
680  return getPackageDir(cls.getPackageName())
681 
std::string getPackageDir(std::string const &packageName)
return the root directory of a setup package
Definition: packaging.cc:33

◆ getPackageName()

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

Definition at line 671 of file cameraMapper.py.

671  def getPackageName(cls):
672  """Return the name of the package containing this CameraMapper."""
673  if cls.packageName is None:
674  raise ValueError('class variable packageName must not be None')
675  return cls.packageName
676 

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

Definition at line 1202 of file cameraMapper.py.

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

◆ 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 965 of file cameraMapper.py.

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

◆ keys()

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

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

Definition at line 607 of file cameraMapper.py.

607  def keys(self):
608  """Return supported keys.
609 
610  Returns
611  -------
612  iterable
613  List of keys usable in a dataset identifier
614  """
615  return iter(self.keyDict.keys())
616 

◆ 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 138 of file mapper.py.

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

◆ map_camera()

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

Definition at line 682 of file cameraMapper.py.

682  def map_camera(self, dataId, write=False):
683  """Map a camera dataset."""
684  if self.camera is None:
685  raise RuntimeError("No camera dataset available.")
686  actualId = self._transformId(dataId)
688  pythonType="lsst.afw.cameraGeom.CameraConfig",
689  cppType="Config",
690  storageName="ConfigStorage",
691  locationList=self.cameraDataLocation or "ignored",
692  dataId=actualId,
693  mapper=self,
694  storage=self.rootStorage
695  )
696 

◆ map_defects()

def lsst.obs.base.cameraMapper.CameraMapper.map_defects (   self,
  dataId,
  write = False 
)
inherited
Map defects dataset.

Returns
-------
`lsst.daf.butler.ButlerLocation`
    Minimal ButlerLocation containing just the locationList field
    (just enough information that bypass_defects can use it).

Definition at line 704 of file cameraMapper.py.

704  def map_defects(self, dataId, write=False):
705  """Map defects dataset.
706 
707  Returns
708  -------
709  `lsst.daf.butler.ButlerLocation`
710  Minimal ButlerLocation containing just the locationList field
711  (just enough information that bypass_defects can use it).
712  """
713  defectFitsPath = self._defectLookup(dataId=dataId)
714  if defectFitsPath is None:
715  raise RuntimeError("No defects available for dataId=%s" % (dataId,))
716 
717  return dafPersist.ButlerLocation(None, None, None, defectFitsPath,
718  dataId, self,
719  storage=self.rootStorage)
720 

◆ map_expIdInfo()

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

Definition at line 754 of file cameraMapper.py.

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

◆ map_skypolicy()

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

Definition at line 787 of file cameraMapper.py.

787  def map_skypolicy(self, dataId):
788  """Map a sky policy."""
789  return dafPersist.ButlerLocation("lsst.pex.policy.Policy", "Policy",
790  "Internal", None, None, self,
791  storage=self.rootStorage)
792 

◆ 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 115 of file mapper.py.

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

◆ 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 174 of file mapper.py.

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

◆ 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 771 of file cameraMapper.py.

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

◆ 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

Definition at line 781 of file cameraMapper.py.

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

◆ 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 793 of file cameraMapper.py.

793  def std_skypolicy(self, item, dataId):
794  """Standardize a sky policy by returning the one we use."""
795  return self.skypolicy
796 

◆ validate()

def lsst.obs.test.testMapper.TestMapper.validate (   self,
  dataId 
)

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 251 of file cameraMapper.py.

◆ camera

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

Definition at line 270 of file cameraMapper.py.

◆ cameraDataLocation

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

Definition at line 269 of file cameraMapper.py.

◆ defaultLevel

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

Definition at line 210 of file cameraMapper.py.

◆ defaultSubLevels

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

Definition at line 211 of file cameraMapper.py.

◆ defectPath

lsst.obs.base.cameraMapper.CameraMapper.defectPath
inherited

Definition at line 276 of file cameraMapper.py.

◆ defectRegistry

lsst.obs.base.cameraMapper.CameraMapper.defectRegistry
inherited

Definition at line 274 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 281 of file cameraMapper.py.

◆ keyDict

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

Definition at line 263 of file cameraMapper.py.

◆ levels

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

Definition at line 205 of file cameraMapper.py.

◆ log

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

Definition at line 191 of file cameraMapper.py.

◆ makeRawVisitInfo

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

Definition at line 288 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 333 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 157 of file cameraMapper.py.

◆ registry

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

Definition at line 243 of file cameraMapper.py.

◆ root

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

Definition at line 194 of file cameraMapper.py.

◆ rootStorage

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

Definition at line 220 of file cameraMapper.py.


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