LSSTApplications  18.1.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...
 

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 afwGeom Box2I

Definition at line 231 of file coaddBase.py.

231 def getSkyInfo(coaddName, patchRef):
232  """!
233  @brief Return the SkyMap, tract and patch information, wcs, and outer bbox of the patch to be coadded.
234 
235  @param[in] coaddName coadd name; typically one of deep or goodSeeing
236  @param[in] patchRef data reference for sky map. Must include keys "tract" and "patch"
237 
238  @return pipe_base Struct containing:
239  - skyMap: sky map
240  - tractInfo: information for chosen tract of sky map
241  - patchInfo: information about chosen patch of tract
242  - wcs: WCS of tract
243  - bbox: outer bbox of patch, as an afwGeom Box2I
244  """
245  skyMap = patchRef.get(coaddName + "Coadd_skyMap")
246  return makeSkyInfo(skyMap, patchRef.dataId["tract"], patchRef.dataId["patch"])
247 
248 
def makeSkyInfo(skyMap, tractId, patchId)
Definition: coaddBase.py:249
def getSkyInfo(coaddName, patchRef)
Return the SkyMap, tract and patch information, wcs, and outer bbox of the patch to be coadded...
Definition: coaddBase.py:231

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

249 def makeSkyInfo(skyMap, tractId, patchId):
250  """Return SkyInfo Struct
251 
252  Constructs SkyInfo used by coaddition tasks for multiple
253  patchId formats.
254 
255  Parameters
256  ----------
257  skyMap : `lsst.skyMap.SkyMap`
258  tractId : int
259  patchId : str or int or tuple of int
260  Either Gen2-style comma delimited string (e.g. '4,5'),
261  tuple of integers (e.g (4, 5), Gen3-style integer.
262  """
263  tractInfo = skyMap[tractId]
264 
265  if isinstance(patchId, str) and ',' in patchId:
266  # patch format is "xIndex,yIndex"
267  patchIndex = tuple(int(i) for i in patchId.split(","))
268  else:
269  patchIndex = patchId
270 
271  patchInfo = tractInfo.getPatchInfo(patchIndex)
272 
273  return pipeBase.Struct(
274  skyMap=skyMap,
275  tractInfo=tractInfo,
276  patchInfo=patchInfo,
277  wcs=tractInfo.getWcs(),
278  bbox=patchInfo.getOuterBBox(),
279  )
280 
281 
def makeSkyInfo(skyMap, tractId, patchId)
Definition: coaddBase.py:249

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

282 def scaleVariance(maskedImage, maskPlanes, log=None):
283  """!
284  @brief Scale the variance in a maskedImage
285 
286  The variance plane in a convolved or warped image (or a coadd derived
287  from warped images) does not accurately reflect the noise properties of
288  the image because variance has been lost to covariance. This function
289  attempts to correct for this by scaling the variance plane to match
290  the observed variance in the image. This is not perfect (because we're
291  not tracking the covariance) but it's simple and is often good enough.
292 
293  @deprecated Use the ScaleVarianceTask instead.
294 
295  @param maskedImage MaskedImage to operate on; variance will be scaled
296  @param maskPlanes List of mask planes for pixels to reject
297  @param log Log for reporting the renormalization factor; or None
298  @return renormalisation factor
299  """
300  config = ScaleVarianceTask.ConfigClass()
301  config.maskPlanes = maskPlanes
302  task = ScaleVarianceTask(config=config, name="scaleVariance", log=log)
303  return task.run(maskedImage)
304 
def scaleVariance(maskedImage, maskPlanes, log=None)
Scale the variance in a maskedImage.
Definition: coaddBase.py:282