lsst.coadd.utils  13.0-4-g4231ded+17
 All Classes Namespaces Files Functions Variables Pages
setCoaddEdgeBits.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 WeightPixelT>
37 void declareSetCoaddEdgeBits(py::module &mod) {
38  namespace afwImage = lsst::afw::image;
39 
40  mod.def("setCoaddEdgeBits",
41  (void (*)(afwImage::Mask<afwImage::MaskPixel> &, afwImage::Image<WeightPixelT> const &)) &
43  "coaddMask"_a, "weightMap"_a);
44 }
45 
46 } // <anonymous>
47 
49  py::module::import("lsst.afw.image");
50 
51  py::module mod("setCoaddEdgeBits");
52 
53  declareSetCoaddEdgeBits<double>(mod);
54  declareSetCoaddEdgeBits<float>(mod);
55  declareSetCoaddEdgeBits<int>(mod);
56  declareSetCoaddEdgeBits<std::uint16_t>(mod);
57 
58  return mod.ptr();
59 }
60 
61 } // utils
62 } // coadd
63 } // lsst
void setCoaddEdgeBits(lsst::afw::image::Mask< lsst::afw::image::MaskPixel > &coaddMask, lsst::afw::image::Image< WeightPixelT > const &weightMap)
set edge bits of coadd mask based on weight map
PYBIND11_PLUGIN(addToCoadd)
Definition: addToCoadd.cc:55