1198 """Function to count the number of pixels with a specific mask in a 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. 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. 1212 Specific mask that we wish to count the number of occurances of. 1214 Pixels to not consider. 1219 Count of number of pixels in footprint with specified mask. 1221 bbox = footprint.getBBox()
1222 bbox.clip(mask.getBBox(afwImage.PARENT))
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()
Represent a 2-dimensional array of bitmask pixels.
def countMaskFromFootprint(mask, footprint, bitmask, ignoreMask)