lsst.coadd.utils  13.0-2-gf5c5ced+21
 All Classes Namespaces Files Functions Variables Pages
copyGoodPixels.cc
Go to the documentation of this file.
1 /*
2  * LSST Data Management System
3  * Copyright 2008-2016 AURA/LSST.
4  *
5  * This product includes software developed by the
6  * LSST Project (http://www.lsst.org/).
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 
23 #include "pybind11/pybind11.h"
24 
26 
27 namespace py = pybind11;
28 using namespace pybind11::literals;
29 
30 namespace lsst {
31 namespace coadd {
32 namespace utils {
33 
34 namespace {
35 
36 template <typename ImagePixelT>
37 void declareCopyGoodPixels(py::module &mod) {
38  namespace afwImage = lsst::afw::image;
39 
40  mod.def("copyGoodPixels",
41  (int (*)(afwImage::Image<ImagePixelT> &, afwImage::Image<ImagePixelT> const &)) & copyGoodPixels,
42  "destImage"_a, "srcImage"_a);
43  mod.def("copyGoodPixels",
44  (int (*)(afwImage::MaskedImage<ImagePixelT> &, afwImage::MaskedImage<ImagePixelT> const &,
45  afwImage::MaskPixel const)) &
46  copyGoodPixels,
47  "destImage"_a, "srcImage"_a, "badPixelMask"_a);
48 }
49 
50 } // <anonymous>
51 
52 PYBIND11_PLUGIN(copyGoodPixels) {
53  py::module::import("lsst.afw.image");
54 
55  py::module mod("copyGoodPixels");
56 
57  declareCopyGoodPixels<double>(mod);
58  declareCopyGoodPixels<float>(mod);
59  declareCopyGoodPixels<int>(mod);
60  declareCopyGoodPixels<std::uint16_t>(mod);
61 
62  return mod.ptr();
63 }
64 
65 } // utils
66 } // coadd
67 } // lsst
int copyGoodPixels(lsst::afw::image::Image< ImagePixelT > &destImage, lsst::afw::image::Image< ImagePixelT > const &srcImage)
copy good pixels from one image to another
PYBIND11_PLUGIN(addToCoadd)
Definition: addToCoadd.cc:55