Template Function lsst::coadd::utils::addToCoadd(lsst::afw::image::Image<CoaddPixelT>&, lsst::afw::image::Image<WeightPixelT>&, lsst::afw::image::Image<CoaddPixelT> const&, WeightPixelT)

Function Documentation

template<typename CoaddPixelT, typename WeightPixelT>
lsst::geom::Box2I lsst::coadd::utils::addToCoadd(lsst::afw::image::Image<CoaddPixelT> &coadd, lsst::afw::image::Image<WeightPixelT> &weightMap, lsst::afw::image::Image<CoaddPixelT> const &image, WeightPixelT weight)

add good pixels from an image to a coadd 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

  • image: image to add to coadd

  • 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 that are not NaN (thus they do include +/- inf).

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.