LSST Applications g0b6bd0c080+a72a5dd7e6,g1182afd7b4+2a019aa3bb,g17e5ecfddb+2b8207f7de,g1d67935e3f+06cf436103,g38293774b4+ac198e9f13,g396055baef+6a2097e274,g3b44f30a73+6611e0205b,g480783c3b1+98f8679e14,g48ccf36440+89c08d0516,g4b93dc025c+98f8679e14,g5c4744a4d9+a302e8c7f0,g613e996a0d+e1c447f2e0,g6c8d09e9e7+25247a063c,g7271f0639c+98f8679e14,g7a9cd813b8+124095ede6,g9d27549199+a302e8c7f0,ga1cf026fa3+ac198e9f13,ga32aa97882+7403ac30ac,ga786bb30fb+7a139211af,gaa63f70f4e+9994eb9896,gabf319e997+ade567573c,gba47b54d5d+94dc90c3ea,gbec6a3398f+06cf436103,gc6308e37c7+07dd123edb,gc655b1545f+ade567573c,gcc9029db3c+ab229f5caf,gd01420fc67+06cf436103,gd877ba84e5+06cf436103,gdb4cecd868+6f279b5b48,ge2d134c3d5+cc4dbb2e3f,ge448b5faa6+86d1ceac1d,gecc7e12556+98f8679e14,gf3ee170dca+25247a063c,gf4ac96e456+ade567573c,gf9f5ea5b4d+ac198e9f13,gff490e6085+8c2580be5c,w.2022.27
LSST Data Management Base Package
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")
 
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 275 of file coaddBase.py.

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

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

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

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

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

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

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

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

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