LSSTApplications  18.1.0
LSSTDataManagementBasePackage
Classes | Functions
lsst.pipe.tasks.assembleCoadd Namespace Reference

Classes

class  AssembleCoaddConfig
 
class  AssembleCoaddDataIdContainer
 
class  AssembleCoaddTask
 
class  CompareWarpAssembleCoaddConfig
 
class  CompareWarpAssembleCoaddTask
 
class  SafeClipAssembleCoaddConfig
 
class  SafeClipAssembleCoaddTask
 

Functions

def countMaskFromFootprint (mask, footprint, bitmask, ignoreMask)
 

Function Documentation

◆ countMaskFromFootprint()

def lsst.pipe.tasks.assembleCoadd.countMaskFromFootprint (   mask,
  footprint,
  bitmask,
  ignoreMask 
)
Function to count the number of pixels with a specific mask in a
footprint.

Find the intersection of mask & footprint. Count all pixels in the mask
that are in the intersection that have bitmask set but do not have
ignoreMask set. Return the count.

Parameters
----------
mask : `lsst.afw.image.Mask`
    Mask to define intersection region by.
footprint : `lsst.afw.detection.Footprint`
    Footprint to define the intersection region by.
bitmask
    Specific mask that we wish to count the number of occurances of.
ignoreMask
    Pixels to not consider.

Returns
-------
result : `int`
    Count of number of pixels in footprint with specified mask.

Definition at line 1197 of file assembleCoadd.py.

1197 def countMaskFromFootprint(mask, footprint, bitmask, ignoreMask):
1198  """Function to count the number of pixels with a specific mask in a
1199  footprint.
1200 
1201  Find the intersection of mask & footprint. Count all pixels in the mask
1202  that are in the intersection that have bitmask set but do not have
1203  ignoreMask set. Return the count.
1204 
1205  Parameters
1206  ----------
1207  mask : `lsst.afw.image.Mask`
1208  Mask to define intersection region by.
1209  footprint : `lsst.afw.detection.Footprint`
1210  Footprint to define the intersection region by.
1211  bitmask
1212  Specific mask that we wish to count the number of occurances of.
1213  ignoreMask
1214  Pixels to not consider.
1215 
1216  Returns
1217  -------
1218  result : `int`
1219  Count of number of pixels in footprint with specified mask.
1220  """
1221  bbox = footprint.getBBox()
1222  bbox.clip(mask.getBBox(afwImage.PARENT))
1223  fp = afwImage.Mask(bbox)
1224  subMask = mask.Factory(mask, bbox, afwImage.PARENT)
1225  footprint.spans.setMask(fp, bitmask)
1226  return numpy.logical_and((subMask.getArray() & fp.getArray()) > 0,
1227  (subMask.getArray() & ignoreMask) == 0).sum()
1228 
1229 
Represent a 2-dimensional array of bitmask pixels.
Definition: Mask.h:78
def countMaskFromFootprint(mask, footprint, bitmask, ignoreMask)