23 #include "pybind11/pybind11.h"
27 namespace py = pybind11;
28 using namespace pybind11::literals;
36 template <
typename CoaddPixelT,
typename WeightPixelT>
37 void declareAddToCoadd(py::module &mod) {
38 namespace afwGeom = lsst::afw::geom;
39 namespace afwImage = lsst::afw::image;
41 mod.def(
"addToCoadd", (afwGeom::Box2I(*)(afwImage::Image<CoaddPixelT> &, afwImage::Image<WeightPixelT> &,
42 afwImage::Image<CoaddPixelT>
const &, WeightPixelT)) &
44 "coadd"_a,
"weightMap"_a,
"image"_a,
"weight"_a);
46 (afwGeom::Box2I(*)(afwImage::MaskedImage<CoaddPixelT> &, afwImage::Image<WeightPixelT> &,
47 afwImage::MaskedImage<CoaddPixelT>
const &, afwImage::MaskPixel
const,
50 "coadd"_a,
"weightMap"_a,
"maskedImage"_a,
"badPixelMask"_a,
"weight"_a);
56 py::module::import(
"lsst.afw.geom");
57 py::module::import(
"lsst.afw.image");
59 py::module mod(
"addToCoadd");
61 declareAddToCoadd<double, double>(mod);
62 declareAddToCoadd<double, float>(mod);
63 declareAddToCoadd<double, int>(mod);
64 declareAddToCoadd<double, std::uint16_t>(mod);
65 declareAddToCoadd<float, double>(mod);
66 declareAddToCoadd<float, float>(mod);
67 declareAddToCoadd<float, int>(mod);
68 declareAddToCoadd<float, std::uint16_t>(mod);
lsst::afw::geom::Box2I 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
PYBIND11_PLUGIN(addToCoadd)