LSSTApplications  18.1.0
LSSTDataManagementBasePackage
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",
42  "destImage"_a, "srcImage"_a);
43  mod.def("copyGoodPixels",
45  afwImage::MaskPixel const)) &
46  copyGoodPixels,
47  "destImage"_a, "srcImage"_a, "badPixelMask"_a);
48 }
49 
50 } // namespace
51 
52 PYBIND11_MODULE(copyGoodPixels, mod) {
53  py::module::import("lsst.afw.image");
54 
55  declareCopyGoodPixels<double>(mod);
56  declareCopyGoodPixels<float>(mod);
57  declareCopyGoodPixels<int>(mod);
58  declareCopyGoodPixels<std::uint16_t>(mod);
59 }
60 
61 } // namespace utils
62 } // namespace coadd
63 } // namespace lsst
A base class for image defects.
A class to manipulate images, masks, and variance as a single object.
Definition: MaskedImage.h:74
afw::table::Key< afw::table::Array< ImagePixelT > > image
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects...
A class to represent a 2-dimensional array of pixels.
Definition: Image.h:59
PYBIND11_MODULE(copyGoodPixels, mod)