30 #include "boost/format.hpp"
35 namespace pexExcept = lsst::pex::exceptions;
37 namespace coaddUtils = lsst::coadd::utils;
39 template<
typename WeightPixelT>
50 (
boost::format(
"coaddMask and weightMap dimensions differ: %dx%d != %dx%d") %
58 for (
int y = 0, endY = weightMap.
getHeight();
y != endY; ++
y) {
59 WeightMapConstXIter weightMapPtr = weightMap.
row_begin(
y);
60 WeightMapConstXIter
const weightMapEndPtr = weightMap.
row_end(
y);
61 MaskXIter coaddMaskPtr = coaddMask.
row_begin(
y);
62 for (; weightMapPtr != weightMapEndPtr; ++weightMapPtr, ++coaddMaskPtr) {
63 if (*weightMapPtr == 0) {
64 (*coaddMaskPtr) = (*coaddMaskPtr) | edgeMask;
74 #define INSTANTIATE(WEIGHTPIXEL) \
75 template void coaddUtils::setCoaddEdgeBits<WEIGHTPIXEL>( \
76 afwImage::Mask<afwImage::MaskPixel> &coaddMask, \
77 afwImage::Image<WEIGHTPIXEL> const &weightMap \
boost::uint16_t MaskPixel
x_iterator row_begin(int y) const
x_iterator row_end(int y) const
Return an x_iterator to the end of the y'th row.
void setCoaddEdgeBits(lsst::afw::image::Mask< lsst::afw::image::MaskPixel > &coaddMask, lsst::afw::image::Image< WeightPixelT > const &weightMap)
set edge bits of coadd mask based on weight map
table::Key< table::Array< Kernel::Pixel > > image
int getWidth() const
Return the number of columns in the image.
static MaskPixelT getPlaneBitMask(const std::vector< std::string > &names)
Return the bitmask corresponding to a vector of plane names OR'd together.
#define LSST_EXCEPT(type,...)
int getHeight() const
Return the number of rows in the image.
geom::Extent2I getDimensions() const
Return the image's size; useful for passing to constructors.
A class to represent a 2-dimensional array of pixels.
Include files required for standard LSST Exception handling.