LSSTApplications  20.0.0
LSSTDataManagementBasePackage
Classes | Functions
lsst.pipe.tasks.coaddBase Namespace Reference

Classes

class  CoaddBaseConfig
 Configuration parameters for CoaddBaseTask. More...
 
class  CoaddBaseTask
 Base class for coaddition. More...
 
class  CoaddTaskRunner
 
class  SelectDataIdContainer
 A dataId container for inputs to be selected. More...
 

Functions

def getSkyInfo (coaddName, patchRef)
 Return the SkyMap, tract and patch information, wcs, and outer bbox of the patch to be coadded. More...
 
def makeSkyInfo (skyMap, tractId, patchId)
 
def scaleVariance (maskedImage, maskPlanes, log=None)
 Scale the variance in a maskedImage. More...
 
def makeCoaddSuffix (warpType="direct")
 

Function Documentation

◆ getSkyInfo()

def lsst.pipe.tasks.coaddBase.getSkyInfo (   coaddName,
  patchRef 
)

Return the SkyMap, tract and patch information, wcs, and outer bbox of the patch to be coadded.

Parameters
[in]coaddNamecoadd name; typically one of deep or goodSeeing
[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 geom Box2I

Definition at line 261 of file coaddBase.py.

261 def getSkyInfo(coaddName, patchRef):
262  """!
263  @brief Return the SkyMap, tract and patch information, wcs, and outer bbox of the patch to be coadded.
264 
265  @param[in] coaddName coadd name; typically one of deep or goodSeeing
266  @param[in] patchRef data reference for sky map. Must include keys "tract" and "patch"
267 
268  @return pipe_base Struct containing:
269  - skyMap: sky map
270  - tractInfo: information for chosen tract of sky map
271  - patchInfo: information about chosen patch of tract
272  - wcs: WCS of tract
273  - bbox: outer bbox of patch, as an geom Box2I
274  """
275  skyMap = patchRef.get(coaddName + "Coadd_skyMap")
276  return makeSkyInfo(skyMap, patchRef.dataId["tract"], patchRef.dataId["patch"])
277 
278 

◆ makeCoaddSuffix()

def lsst.pipe.tasks.coaddBase.makeCoaddSuffix (   warpType = "direct")
Return coadd suffix for warpType

Parameters
----------
warpType : string
    Either 'direct' or 'psfMatched'

Returns
-------
CoaddSuffix : `string`

Definition at line 336 of file coaddBase.py.

336 def makeCoaddSuffix(warpType="direct"):
337  """Return coadd suffix for warpType
338 
339  Parameters
340  ----------
341  warpType : string
342  Either 'direct' or 'psfMatched'
343 
344  Returns
345  -------
346  CoaddSuffix : `string`
347  """
348  suffix = "" if warpType == "direct" else warpType[0].upper() + warpType[1:]
349  return suffix

◆ makeSkyInfo()

def lsst.pipe.tasks.coaddBase.makeSkyInfo (   skyMap,
  tractId,
  patchId 
)
Return SkyInfo Struct

Constructs SkyInfo used by coaddition tasks for multiple
patchId formats.

Parameters
----------
skyMap : `lsst.skyMap.SkyMap`
tractId : int
patchId : str or int or tuple of int
    Either Gen2-style comma delimited string (e.g. '4,5'),
    tuple of integers (e.g (4, 5), Gen3-style integer.

Definition at line 279 of file coaddBase.py.

279 def makeSkyInfo(skyMap, tractId, patchId):
280  """Return SkyInfo Struct
281 
282  Constructs SkyInfo used by coaddition tasks for multiple
283  patchId formats.
284 
285  Parameters
286  ----------
287  skyMap : `lsst.skyMap.SkyMap`
288  tractId : int
289  patchId : str or int or tuple of int
290  Either Gen2-style comma delimited string (e.g. '4,5'),
291  tuple of integers (e.g (4, 5), Gen3-style integer.
292  """
293  tractInfo = skyMap[tractId]
294 
295  if isinstance(patchId, str) and ',' in patchId:
296  # patch format is "xIndex,yIndex"
297  patchIndex = tuple(int(i) for i in patchId.split(","))
298  else:
299  patchIndex = patchId
300 
301  patchInfo = tractInfo.getPatchInfo(patchIndex)
302 
303  return pipeBase.Struct(
304  skyMap=skyMap,
305  tractInfo=tractInfo,
306  patchInfo=patchInfo,
307  wcs=tractInfo.getWcs(),
308  bbox=patchInfo.getOuterBBox(),
309  )
310 
311 

◆ scaleVariance()

def lsst.pipe.tasks.coaddBase.scaleVariance (   maskedImage,
  maskPlanes,
  log = None 
)

Scale the variance in a maskedImage.

The variance plane in a convolved or warped image (or a coadd derived from warped images) does not accurately reflect the noise properties of the image because variance has been lost to covariance. This function attempts to correct for this by scaling the variance plane to match the observed variance in the image. This is not perfect (because we're not tracking the covariance) but it's simple and is often good enough.

Deprecated:
Use the ScaleVarianceTask instead.
Parameters
maskedImageMaskedImage to operate on; variance will be scaled
maskPlanesList of mask planes for pixels to reject
logLog for reporting the renormalization factor; or None
Returns
renormalisation factor

Definition at line 312 of file coaddBase.py.

312 def scaleVariance(maskedImage, maskPlanes, log=None):
313  """!
314  @brief Scale the variance in a maskedImage
315 
316  The variance plane in a convolved or warped image (or a coadd derived
317  from warped images) does not accurately reflect the noise properties of
318  the image because variance has been lost to covariance. This function
319  attempts to correct for this by scaling the variance plane to match
320  the observed variance in the image. This is not perfect (because we're
321  not tracking the covariance) but it's simple and is often good enough.
322 
323  @deprecated Use the ScaleVarianceTask instead.
324 
325  @param maskedImage MaskedImage to operate on; variance will be scaled
326  @param maskPlanes List of mask planes for pixels to reject
327  @param log Log for reporting the renormalization factor; or None
328  @return renormalisation factor
329  """
330  config = ScaleVarianceTask.ConfigClass()
331  config.maskPlanes = maskPlanes
332  task = ScaleVarianceTask(config=config, name="scaleVariance", log=log)
333  return task.run(maskedImage)
334 
335 
lsst.pipe.tasks.coaddBase.scaleVariance
def scaleVariance(maskedImage, maskPlanes, log=None)
Scale the variance in a maskedImage.
Definition: coaddBase.py:312
lsst.pipe.tasks.coaddBase.getSkyInfo
def getSkyInfo(coaddName, patchRef)
Return the SkyMap, tract and patch information, wcs, and outer bbox of the patch to be coadded.
Definition: coaddBase.py:261
lsst.pipe.tasks.coaddBase.makeSkyInfo
def makeSkyInfo(skyMap, tractId, patchId)
Definition: coaddBase.py:279
lsst.pipe.tasks.coaddBase.makeCoaddSuffix
def makeCoaddSuffix(warpType="direct")
Definition: coaddBase.py:336