LSST Applications g013ef56533+d2224463a4,g199a45376c+0ba108daf9,g19c4beb06c+9f335b2115,g1fd858c14a+2459ca3e43,g210f2d0738+2d3d333a78,g262e1987ae+abbb004f04,g2825c19fe3+eedc38578d,g29ae962dfc+0cb55f06ef,g2cef7863aa+aef1011c0b,g35bb328faa+8c5ae1fdc5,g3fd5ace14f+19c3a54948,g47891489e3+501a489530,g4cdb532a89+a047e97985,g511e8cfd20+ce1f47b6d6,g53246c7159+8c5ae1fdc5,g54cd7ddccb+890c8e1e5d,g5fd55ab2c7+951cc3f256,g64539dfbff+2d3d333a78,g67b6fd64d1+501a489530,g67fd3c3899+2d3d333a78,g74acd417e5+0ea5dee12c,g786e29fd12+668abc6043,g87389fa792+8856018cbb,g89139ef638+501a489530,g8d7436a09f+5ea4c44d25,g8ea07a8fe4+81eaaadc04,g90f42f885a+34c0557caf,g9486f8a5af+165c016931,g97be763408+d5e351dcc8,gbf99507273+8c5ae1fdc5,gc2a301910b+2d3d333a78,gca7fc764a6+501a489530,gce8aa8abaa+8c5ae1fdc5,gd7ef33dd92+501a489530,gdab6d2f7ff+0ea5dee12c,ge410e46f29+501a489530,geaed405ab2+e3b4b2a692,gf9a733ac38+8c5ae1fdc5,w.2025.41
LSST Data Management Base Package
Loading...
Searching...
No Matches
isr.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"
23#include "pybind11/stl.h"
24
25#include <memory>
26
27#include "lsst/ip/isr/isr.h"
28
29namespace py = pybind11;
30using namespace pybind11::literals;
31
32namespace lsst {
33namespace ip {
34namespace isr {
35
36namespace {
37
38template <typename PixelT>
39static void declareCountMaskedPixels(py::module& mod, std::string const& suffix) {
40 py::classh<CountMaskedPixels<PixelT>> cls(mod, ("CountMaskedPixels" + suffix).c_str());
41
42 cls.def("reset", &CountMaskedPixels<PixelT>::reset);
43 cls.def("apply", &CountMaskedPixels<PixelT>::apply, "image"_a, "bitmask"_a);
44 cls.def("getCount", &CountMaskedPixels<PixelT>::getCount);
45}
46
57template <typename PixelT>
58static void declareAll(py::module& mod, std::string const& suffix) {
59 declareCountMaskedPixels<PixelT>(mod, suffix);
60
61 mod.def("maskNans", &maskNans<PixelT>, "maskedImage"_a, "maskVal"_a, "allow"_a = 0);
62 mod.def("fitOverscanImage", &fitOverscanImage<PixelT>,
63 "maskedImage"_a, "badPixelMask"_a, "isTransposed"_a);
64 mod.def("fitOverscanImageMean", &fitOverscanImageMean<PixelT>,
65 "maskedImage"_a, "badPixelMask"_a, "isTransposed"_a);
66}
67
68} // namespace lsst::ip::isr::<anonymous>
69
71 declareAll<float>(mod, "F");
72 declareAll<double>(mod, "D");
73 declareAll<int>(mod, "I");
74}
75
76} // isr
77} // ip
78} // lsst
void apply(lsst::afw::image::MaskedImage< ImageT > const &image, MaskT bitmask)
Definition isr.h:62
std::vector< double > fitOverscanImageMean(lsst::afw::image::MaskedImage< ImagePixelT > const &overscan, std::vector< std::string > badPixelMask, bool isTransposed)
Definition Isr.cc:99
size_t maskNans(afw::image::MaskedImage< PixelT > const &mi, afw::image::MaskPixel maskVal, afw::image::MaskPixel allow=0)
Mask NANs in an image.
Definition Isr.cc:35
std::vector< double > fitOverscanImage(lsst::afw::image::MaskedImage< ImagePixelT > const &overscan, std::vector< std::string > badPixelMask, bool isTransposed)
Definition Isr.cc:53
PYBIND11_MODULE(applyLookupTable, mod)