LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Classes | Functions
lsst.pipe.tasks.coaddBase Namespace Reference

Classes

class  CoaddBaseConfig
 Configuration parameters for CoaddBaseTask. More...
 
class  CoaddTaskRunner
 
class  CoaddBaseTask
 Base class for coaddition. More...
 
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")
 
def reorderAndPadList (inputList, inputKeys, outputKeys, padWith=None)
 

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 271 of file coaddBase.py.

271 def getSkyInfo(coaddName, patchRef):
272  """!
273  @brief Return the SkyMap, tract and patch information, wcs, and outer bbox of the patch to be coadded.
274 
275  @param[in] coaddName coadd name; typically one of deep or goodSeeing
276  @param[in] patchRef data reference for sky map. Must include keys "tract" and "patch"
277 
278  @return pipe_base Struct containing:
279  - skyMap: sky map
280  - tractInfo: information for chosen tract of sky map
281  - patchInfo: information about chosen patch of tract
282  - wcs: WCS of tract
283  - bbox: outer bbox of patch, as an geom Box2I
284  """
285  skyMap = patchRef.get(coaddName + "Coadd_skyMap")
286  return makeSkyInfo(skyMap, patchRef.dataId["tract"], patchRef.dataId["patch"])
287 
288 
def makeSkyInfo(skyMap, tractId, patchId)
Definition: coaddBase.py:289
def getSkyInfo(coaddName, patchRef)
Return the SkyMap, tract and patch information, wcs, and outer bbox of the patch to be coadded.
Definition: coaddBase.py:271

◆ 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 346 of file coaddBase.py.

346 def makeCoaddSuffix(warpType="direct"):
347  """Return coadd suffix for warpType
348 
349  Parameters
350  ----------
351  warpType : string
352  Either 'direct' or 'psfMatched'
353 
354  Returns
355  -------
356  CoaddSuffix : `string`
357  """
358  suffix = "" if warpType == "direct" else warpType[0].upper() + warpType[1:]
359  return suffix
360 
361 
def makeCoaddSuffix(warpType="direct")
Definition: coaddBase.py:346

◆ 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 289 of file coaddBase.py.

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

◆ reorderAndPadList()

def lsst.pipe.tasks.coaddBase.reorderAndPadList (   inputList,
  inputKeys,
  outputKeys,
  padWith = None 
)
Match the order of one list to another, padding if necessary

Parameters
----------
inputList : list
    List to be reordered and padded. Elements can be any type.
inputKeys :  iterable
    Iterable of values to be compared with outputKeys.
    Length must match `inputList`
outputKeys : iterable
    Iterable of values to be compared with inputKeys.
padWith :
    Any value to be inserted where inputKey not in outputKeys

Returns
-------
list
    Copy of inputList reordered per outputKeys and padded with `padWith`
    so that the length matches length of outputKeys.

Definition at line 362 of file coaddBase.py.

362 def reorderAndPadList(inputList, inputKeys, outputKeys, padWith=None):
363  """Match the order of one list to another, padding if necessary
364 
365  Parameters
366  ----------
367  inputList : list
368  List to be reordered and padded. Elements can be any type.
369  inputKeys : iterable
370  Iterable of values to be compared with outputKeys.
371  Length must match `inputList`
372  outputKeys : iterable
373  Iterable of values to be compared with inputKeys.
374  padWith :
375  Any value to be inserted where inputKey not in outputKeys
376 
377  Returns
378  -------
379  list
380  Copy of inputList reordered per outputKeys and padded with `padWith`
381  so that the length matches length of outputKeys.
382  """
383  outputList = []
384  for d in outputKeys:
385  if d in inputKeys:
386  outputList.append(inputList[inputKeys.index(d)])
387  else:
388  outputList.append(padWith)
389  return outputList
def reorderAndPadList(inputList, inputKeys, outputKeys, padWith=None)
Definition: coaddBase.py:362

◆ 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 322 of file coaddBase.py.

322 def scaleVariance(maskedImage, maskPlanes, log=None):
323  """!
324  @brief Scale the variance in a maskedImage
325 
326  The variance plane in a convolved or warped image (or a coadd derived
327  from warped images) does not accurately reflect the noise properties of
328  the image because variance has been lost to covariance. This function
329  attempts to correct for this by scaling the variance plane to match
330  the observed variance in the image. This is not perfect (because we're
331  not tracking the covariance) but it's simple and is often good enough.
332 
333  @deprecated Use the ScaleVarianceTask instead.
334 
335  @param maskedImage MaskedImage to operate on; variance will be scaled
336  @param maskPlanes List of mask planes for pixels to reject
337  @param log Log for reporting the renormalization factor; or None
338  @return renormalisation factor
339  """
340  config = ScaleVarianceTask.ConfigClass()
341  config.maskPlanes = maskPlanes
342  task = ScaleVarianceTask(config=config, name="scaleVariance", log=log)
343  return task.run(maskedImage)
344 
345 
def scaleVariance(maskedImage, maskPlanes, log=None)
Scale the variance in a maskedImage.
Definition: coaddBase.py:322