LSST Applications g0f08755f38+05b4b46b2c,g1653933729+a905cd61c3,g168dd56ebc+a905cd61c3,g1a2382251a+526767c3b0,g20f6ffc8e0+05b4b46b2c,g217e2c1bcf+f8df405040,g28da252d5a+e530e4405a,g2bbee38e9b+e060cc3e60,g2bc492864f+e060cc3e60,g32e5bea42b+7044b77928,g347aa1857d+e060cc3e60,g35bb328faa+a905cd61c3,g3a166c0a6a+e060cc3e60,g3bd4b5ce2c+9af3f3d415,g3e281a1b8c+2bff41ced5,g3e8969e208+a905cd61c3,g414038480c+882f223820,g41af890bb2+f72d0f2eea,g43bc871e57+ad86a2d9e2,g78460c75b0+4ae99bb757,g80478fca09+8d821d1b28,g82479be7b0+ec26a56c2d,g858d7b2824+05b4b46b2c,g9125e01d80+a905cd61c3,ga5288a1d22+64e5455051,gb58c049af0+84d1b6ec45,gc28159a63d+e060cc3e60,gc5452a3dca+b82ec7cc4c,gcab2d0539d+01da5adb7a,gcf0d15dbbd+56822d21ae,gda6a2b7d83+56822d21ae,gdaeeff99f8+686ef0dd99,ge79ae78c31+e060cc3e60,gef2f8181fd+f2c81e61ee,gf0baf85859+f9edac6842,gf1e97e5484+3a635bd7af,gfa517265be+05b4b46b2c,gfa999e8aa5+d85414070d,w.2025.01
LSST Data Management Base Package
Loading...
Searching...
No Matches
imageSubtract.cc
Go to the documentation of this file.
1/*
2 * LSST Data Management System
3 *
4 * This product includes software developed by the
5 * LSST Project (http://www.lsst.org/).
6 * See the COPYRIGHT file
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the LSST License Statement and
19 * the GNU General Public License along with this program. If not,
20 * see <https://www.lsstcorp.org/LegalNotices/>.
21 */
22#include "pybind11/pybind11.h"
24#include "pybind11/eigen.h"
25
26#include "ndarray/pybind11.h"
27
33
34namespace py = pybind11;
35using namespace pybind11::literals;
36
37namespace lsst {
38namespace ip {
39namespace diffim {
40
41namespace {
42
52template <typename PixelT, typename BackgroundT>
53void declareConvolveAndSubtract(lsst::cpputils::python::WrapperCollection &wrappers) {
54 auto &mod = wrappers.module;
55 mod.def("convolveAndSubtract",
56 (afw::image::MaskedImage<PixelT>(*)(afw::image::MaskedImage<PixelT> const &,
57 afw::image::MaskedImage<PixelT> const &,
58 afw::math::Kernel const &, BackgroundT, bool)) &
60 "templateImage"_a, "scienceMaskedImage"_a, "convolutionKernel"_a, "background"_a,
61 "invert"_a = true);
62
63 mod.def("convolveAndSubtract",
64 (afw::image::MaskedImage<PixelT>(*)(afw::image::Image<PixelT> const &,
65 afw::image::MaskedImage<PixelT> const &,
66 afw::math::Kernel const &, BackgroundT, bool)) &
68 "templateImage"_a, "scienceMaskedImage"_a, "convolutionKernel"_a, "background"_a,
69 "invert"_a = true);
70}
71
72} // namespace lsst::ip::diffim::<anonymous>
73
75 declareConvolveAndSubtract<float, double>(wrappers);
76 declareConvolveAndSubtract<float, afw::math::Function2<double> const &>(wrappers);
77}
78
79} // diffim
80} // ip
81} // lsst
Image Subtraction helper functions.
A helper class for subdividing pybind11 module across multiple translation units (i....
Definition python.h:242
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.
void wrapImageSubtract(WrapperCollection &wrappers)