Template Function lsst::coadd::utils::addToCoadd(lsst::afw::image::MaskedImage<CoaddPixelT, lsst::afw::image::MaskPixel, lsst::afw::image::VariancePixel>&, lsst::afw::image::Image<WeightPixelT>&, lsst::afw::image::MaskedImage<CoaddPixelT, lsst::afw::image::MaskPixel, lsst::afw::image::VariancePixel> const&, lsst::afw::image::MaskPixel const, WeightPixelT)¶
Function Documentation¶
-
template<typename
CoaddPixelT
, typenameWeightPixelT
>
lsst::geom::Box2Ilsst::coadd::utils
::
addToCoadd
(lsst::afw::image::MaskedImage<CoaddPixelT, lsst::afw::image::MaskPixel, lsst::afw::image::VariancePixel> &coadd, lsst::afw::image::Image<WeightPixelT> &weightMap, lsst::afw::image::MaskedImage<CoaddPixelT, lsst::afw::image::MaskPixel, lsst::afw::image::VariancePixel> const &maskedImage, lsst::afw::image::MaskPixel const badPixelMask, WeightPixelT weight) add good pixels from a masked image to a coadd image and associated weight map
- Parameters
coadd
: coadd to be modifiedweightMap
: weight map to be modified; this is the sum of weights of all images contributing each pixel of the coaddmaskedImage
: masked image to add to coaddbadPixelMask
: skip input pixel if input mask & badPixelMask !=0weight
: relative weight of this image
The images are assumed to be registered to the same wcs and parent origin, thus: coadd[i+coadd.x0, j+coadd.y0] += image[i+image.x0, j+image.y0] weightMap[i+weightMap.x0, j+weightMap.y0] += weight for all good image pixels that overlap a coadd pixel. Good pixels are those for which mask & badPixelMask == 0.
- Return
overlapBBox: overlapping bounding box, relative to parent image (hence xy0 is taken into account)
- Exceptions
pexExcept::InvalidParameterError
: if coadd and weightMap dimensions or xy0 do not match.