Loading [MathJax]/extensions/tex2jax.js
LSST Applications g04a91732dc+40afcc7e13,g0fba68d861+2cf5f380f6,g1fd858c14a+d4497073b1,g208c678f98+2d879463ba,g2c84ff76c0+12036dbf49,g35bb328faa+fcb1d3bbc8,g4d2262a081+2eb0d036a3,g4d39ba7253+a49fd2d81b,g4e0f332c67+c58e4b632d,g53246c7159+fcb1d3bbc8,g60b5630c4e+a49fd2d81b,g67b6fd64d1+dfd268ab64,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g8852436030+e37c0d7b52,g89139ef638+dfd268ab64,g8d6b6b353c+a49fd2d81b,g8ec4aff861+ac98094cfc,g9125e01d80+fcb1d3bbc8,g989de1cb63+dfd268ab64,g9f33ca652e+f1cbaf6525,ga2b97cdc51+a49fd2d81b,gabe3b4be73+1e0a283bba,gb04aad79e7+7b3e21ef87,gb1101e3267+3ea6b9adb9,gb58c049af0+f03b321e39,gb89ab40317+dfd268ab64,gb90eeb9370+95a6a83b9d,gcf25f946ba+e37c0d7b52,gd315a588df+e0e29fc712,gd6cbbdb0b4+75aa4b1db4,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+33f4a7fb92,ge278dab8ac+c61fbefdff,ge410e46f29+dfd268ab64,ge82c20c137+e12a08b75a,gf67bdafdda+dfd268ab64,w.2025.11
LSST Data Management Base Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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::class_<CountMaskedPixels<PixelT>, std::shared_ptr<CountMaskedPixels<PixelT>>> cls(
41 mod, ("CountMaskedPixels" + suffix).c_str());
42
43 cls.def("reset", &CountMaskedPixels<PixelT>::reset);
44 cls.def("apply", &CountMaskedPixels<PixelT>::apply, "image"_a, "bitmask"_a);
45 cls.def("getCount", &CountMaskedPixels<PixelT>::getCount);
46}
47
58template <typename PixelT>
59static void declareAll(py::module& mod, std::string const& suffix) {
60 declareCountMaskedPixels<PixelT>(mod, suffix);
61
62 mod.def("maskNans", &maskNans<PixelT>, "maskedImage"_a, "maskVal"_a, "allow"_a = 0);
63 mod.def("fitOverscanImage", &fitOverscanImage<PixelT>,
64 "maskedImage"_a, "badPixelMask"_a, "isTransposed"_a);
65 mod.def("fitOverscanImageMean", &fitOverscanImageMean<PixelT>,
66 "maskedImage"_a, "badPixelMask"_a, "isTransposed"_a);
67}
68
69} // namespace lsst::ip::isr::<anonymous>
70
72 declareAll<float>(mod, "F");
73 declareAll<double>(mod, "D");
74 declareAll<int>(mod, "I");
75}
76
77} // isr
78} // ip
79} // 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)