LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
lsst.pipe.tasks.coaddBase.CoaddBaseTask Class Reference
Inheritance diagram for lsst.pipe.tasks.coaddBase.CoaddBaseTask:

Public Member Functions

def __init__
 
def selectExposures
 Select exposures to coadd. More...
 
def getSkyInfo
 Return SkyMap, tract and patch. More...
 
def getCalExp
 Return one "calexp" calibrated exposure. More...
 
def getCoaddDatasetName
 
def getTempExpDatasetName
 
def getBadPixelMask
 
def writeCoaddOutput
 Write a coadd product through the butler. More...
 

Static Public Attributes

 ConfigClass = CoaddBaseConfig
 
 RunnerClass = CoaddTaskRunner
 

Private Member Functions

def _makeArgumentParser
 
def _getConfigName
 
def _getMetadataName
 

Detailed Description

Base class for coaddition.

Subclasses must specify _DefaultName

Definition at line 77 of file coaddBase.py.

Constructor & Destructor Documentation

def lsst.pipe.tasks.coaddBase.CoaddBaseTask.__init__ (   self,
  args,
  kwargs 
)

Definition at line 85 of file coaddBase.py.

85 
86  def __init__(self, *args, **kwargs):
87  pipeBase.Task.__init__(self, *args, **kwargs)
88  self.makeSubtask("select")
89  self.makeSubtask("inputRecorder")

Member Function Documentation

def lsst.pipe.tasks.coaddBase.CoaddBaseTask._getConfigName (   self)
private
Return the name of the config dataset

Definition at line 163 of file coaddBase.py.

164  def _getConfigName(self):
165  """Return the name of the config dataset
166  """
167  return "%s_%s_config" % (self.config.coaddName, self._DefaultName)
def lsst.pipe.tasks.coaddBase.CoaddBaseTask._getMetadataName (   self)
private
Return the name of the metadata dataset

Definition at line 168 of file coaddBase.py.

169  def _getMetadataName(self):
170  """Return the name of the metadata dataset
171  """
172  return "%s_%s_metadata" % (self.config.coaddName, self._DefaultName)
def lsst.pipe.tasks.coaddBase.CoaddBaseTask._makeArgumentParser (   cls)
private
Create an argument parser

Definition at line 153 of file coaddBase.py.

154  def _makeArgumentParser(cls):
155  """Create an argument parser
156  """
157  parser = pipeBase.ArgumentParser(name=cls._DefaultName)
158  parser.add_id_argument("--id", "deepCoadd", help="data ID, e.g. --id tract=12345 patch=1,2",
159  ContainerClass=CoaddDataIdContainer)
160  parser.add_id_argument("--selectId", "calexp", help="data ID, e.g. --selectId visit=6789 ccd=0..9",
161  ContainerClass=SelectDataIdContainer)
162  return parser
def lsst.pipe.tasks.coaddBase.CoaddBaseTask.getBadPixelMask (   self)
Convenience method to provide the bitmask from the mask plane names

Definition at line 173 of file coaddBase.py.

174  def getBadPixelMask(self):
175  """Convenience method to provide the bitmask from the mask plane names"""
176  return afwImage.MaskU.getPlaneBitMask(self.config.badMaskPlanes)
def lsst.pipe.tasks.coaddBase.CoaddBaseTask.getCalExp (   self,
  dataRef,
  bgSubtracted 
)

Return one "calexp" calibrated exposure.

Parameters
[in]dataRefa sensor-level data reference
[in]bgSubtractedreturn calexp with background subtracted? If False get the calexp's background background model and add it to the calexp.
Returns
calibrated exposure

If config.doApplyUberCal, meas_mosaic calibrations will be applied to the returned exposure using applyMosaicResults.

Definition at line 118 of file coaddBase.py.

119  def getCalExp(self, dataRef, bgSubtracted):
120  """!Return one "calexp" calibrated exposure
121 
122  @param[in] dataRef a sensor-level data reference
123  @param[in] bgSubtracted return calexp with background subtracted? If False get the
124  calexp's background background model and add it to the calexp.
125  @return calibrated exposure
126 
127  If config.doApplyUberCal, meas_mosaic calibrations will be applied to
128  the returned exposure using applyMosaicResults.
129  """
130  exposure = dataRef.get("calexp", immediate=True)
131  if not bgSubtracted:
132  background = dataRef.get("calexpBackground", immediate=True)
133  mi = exposure.getMaskedImage()
134  mi += background.getImage()
135  del mi
136  if not self.config.doApplyUberCal:
137  return exposure
138  if applyMosaicResults is None:
139  raise RuntimeError(
140  "Cannot use improved calibrations for %s because meas_mosaic could not be imported."
141  % dataRef.dataId
142  )
143  else:
144  applyMosaicResults(dataRef, calexp=exposure)
145  return exposure
def getCalExp
Return one "calexp" calibrated exposure.
Definition: coaddBase.py:118
def lsst.pipe.tasks.coaddBase.CoaddBaseTask.getCoaddDatasetName (   self)

Definition at line 146 of file coaddBase.py.

147  def getCoaddDatasetName(self):
148  return self.config.coaddName + "Coadd"
def lsst.pipe.tasks.coaddBase.CoaddBaseTask.getSkyInfo (   self,
  patchRef 
)

Return SkyMap, tract and patch.

Parameters
[in]patchRefdata reference for sky map. Must include keys "tract" and "patch"
Returns
pipe_base Struct containing:
  • skyMap: sky map
  • tractInfo: information for chosen tract of sky map
  • patchInfo: information about chosen patch of tract
  • wcs: WCS of tract
  • bbox: outer bbox of patch, as an afwGeom Box2I

Definition at line 104 of file coaddBase.py.

105  def getSkyInfo(self, patchRef):
106  """!Return SkyMap, tract and patch
107 
108  @param[in] patchRef data reference for sky map. Must include keys "tract" and "patch"
109 
110  @return pipe_base Struct containing:
111  - skyMap: sky map
112  - tractInfo: information for chosen tract of sky map
113  - patchInfo: information about chosen patch of tract
114  - wcs: WCS of tract
115  - bbox: outer bbox of patch, as an afwGeom Box2I
116  """
117  return getSkyInfo(coaddName=self.config.coaddName, patchRef=patchRef)
def getSkyInfo
Return SkyMap, tract and patch.
Definition: coaddBase.py:104
def lsst.pipe.tasks.coaddBase.CoaddBaseTask.getTempExpDatasetName (   self)

Definition at line 149 of file coaddBase.py.

150  def getTempExpDatasetName(self):
151  return self.config.coaddName + "Coadd_tempExp"
def lsst.pipe.tasks.coaddBase.CoaddBaseTask.selectExposures (   self,
  patchRef,
  skyInfo = None,
  selectDataList = [] 
)

Select exposures to coadd.

Parameters
[in]patchRefdata reference for sky map patch. Must include keys "tract", "patch", plus the camera-specific filter key (e.g. "filter" or "band")
[in]skyInfogeometry for the patch; output from getSkyInfo
Returns
a list of science exposures to coadd, as butler data references

Definition at line 90 of file coaddBase.py.

90 
91  def selectExposures(self, patchRef, skyInfo=None, selectDataList=[]):
92  """!Select exposures to coadd
93 
94  @param[in] patchRef data reference for sky map patch. Must include keys "tract", "patch",
95  plus the camera-specific filter key (e.g. "filter" or "band")
96  @param[in] skyInfo geometry for the patch; output from getSkyInfo
97  @return a list of science exposures to coadd, as butler data references
98  """
99  if skyInfo is None:
100  skyInfo = self.getSkyInfo(patchRef)
101  cornerPosList = afwGeom.Box2D(skyInfo.bbox).getCorners()
102  coordList = [skyInfo.wcs.pixelToSky(pos) for pos in cornerPosList]
103  return self.select.runDataRef(patchRef, coordList, selectDataList=selectDataList).dataRefList
def selectExposures
Select exposures to coadd.
Definition: coaddBase.py:90
def getSkyInfo
Return SkyMap, tract and patch.
Definition: coaddBase.py:104
A floating-point coordinate rectangle geometry.
Definition: Box.h:271
def lsst.pipe.tasks.coaddBase.CoaddBaseTask.writeCoaddOutput (   self,
  dataRef,
  obj,
  suffix = None 
)

Write a coadd product through the butler.

Parameters
[in]dataRefdata reference for coadd
[in,out]objcoadd product to write
[in]suffixsuffix to apply to coadd dataset name

Definition at line 177 of file coaddBase.py.

178  def writeCoaddOutput(self, dataRef, obj, suffix=None):
179  """!Write a coadd product through the butler
180 
181  @param[in] dataRef data reference for coadd
182  @param[in,out] obj coadd product to write
183  @param[in] suffix suffix to apply to coadd dataset name
184  """
185  objName = self.getCoaddDatasetName()
186  if suffix is not None:
187  objName += "_" + suffix
188  self.log.info("Persisting %s" % objName)
189  dataRef.put(obj, objName)
def writeCoaddOutput
Write a coadd product through the butler.
Definition: coaddBase.py:177

Member Data Documentation

lsst.pipe.tasks.coaddBase.CoaddBaseTask.ConfigClass = CoaddBaseConfig
static

Definition at line 82 of file coaddBase.py.

lsst.pipe.tasks.coaddBase.CoaddBaseTask.RunnerClass = CoaddTaskRunner
static

Definition at line 83 of file coaddBase.py.


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