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, typename WeightPixelT>
lsst::geom::Box2I lsst::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 modified

  • weightMap: weight map to be modified; this is the sum of weights of all images contributing each pixel of the coadd

  • maskedImage: masked image to add to coadd

  • badPixelMask: skip input pixel if input mask & badPixelMask !=0

  • weight: 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.