22 #include "pybind11/pybind11.h" 23 #include "pybind11/eigen.h" 25 #include "ndarray/pybind11.h" 51 template <
typename PixelT,
typename BackgroundT>
52 void declareConvolveAndSubtract(
py::module &mod) {
53 mod.def(
"convolveAndSubtract",
54 (afw::image::MaskedImage<PixelT>(*)(afw::image::MaskedImage<PixelT>
const &,
55 afw::image::MaskedImage<PixelT>
const &,
56 afw::math::Kernel
const &, BackgroundT,
bool)) &
58 "templateImage"_a,
"scienceMaskedImage"_a,
"convolutionKernel"_a,
"background"_a,
61 mod.def(
"convolveAndSubtract",
62 (afw::image::MaskedImage<PixelT>(*)(afw::image::Image<PixelT>
const &,
63 afw::image::MaskedImage<PixelT>
const &,
64 afw::math::Kernel
const &, BackgroundT,
bool)) &
66 "templateImage"_a,
"scienceMaskedImage"_a,
"convolutionKernel"_a,
"background"_a,
73 py::module::import(
"lsst.afw.image");
74 py::module::import(
"lsst.afw.math");
76 declareConvolveAndSubtract<float, double>(mod);
77 declareConvolveAndSubtract<float, afw::math::Function2<double>
const &>(mod);
lsst::afw::image::MaskedImage< PixelT > convolveAndSubtract(lsst::afw::image::MaskedImage< PixelT > const &templateImage, lsst::afw::image::MaskedImage< PixelT > const &scienceMaskedImage, lsst::afw::math::Kernel const &convolutionKernel, BackgroundT background, bool invert=true)
Execute fundamental task of convolving template and subtracting it from science image.
A base class for image defects.
PYBIND11_MODULE(imageSubtract, mod)
Image Subtraction helper functions.