lsst.meas.base  14.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups Pages
pixelFlags.cc
Go to the documentation of this file.
1 /*
2  * LSST Data Management System
3  * Copyright 2008-2017 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 #include "pybind11/stl.h"
25 
26 #include <memory>
27 
28 #include "lsst/pex/config/python.h"
29 
30 #include "lsst/afw/table/Source.h"
32 
33 namespace py = pybind11;
34 using namespace pybind11::literals;
35 
36 namespace lsst {
37 namespace meas {
38 namespace base {
39 
40 PYBIND11_PLUGIN(pixelFlags) {
41  py::module::import("lsst.afw.table");
42  py::module mod("pixelFlags");
43 
44  py::class_<PixelFlagsAlgorithm, std::shared_ptr<PixelFlagsAlgorithm>, SimpleAlgorithm> clsPixelFlagsAlgorithm(mod, "PixelFlagsAlgorithm");
45  py::class_<PixelFlagsControl> clsPixelFlagsControl(mod, "PixelFlagsControl");
46 
47  clsPixelFlagsAlgorithm.def(py::init<PixelFlagsAlgorithm::Control const &,
48  std::string const &,
49  afw::table::Schema &>(),
50  "ctrl"_a, "name"_a, "schema"_a);
51 
52  clsPixelFlagsControl.def(py::init<>());
53 
54  clsPixelFlagsAlgorithm.def("measure", &PixelFlagsAlgorithm::measure,
55  "measRecord"_a, "exposure"_a);
56  clsPixelFlagsAlgorithm.def("fail", &PixelFlagsAlgorithm::fail,
57  "measRecord"_a, "error"_a=nullptr);
58 
59  LSST_DECLARE_CONTROL_FIELD(clsPixelFlagsControl, PixelFlagsControl, masksFpAnywhere);
60  LSST_DECLARE_CONTROL_FIELD(clsPixelFlagsControl, PixelFlagsControl, masksFpCenter);
61 
62  return mod.ptr();
63 }
64 
65 } // base
66 } // meas
67 } // lsst
A C++ control class to handle PixelFlagsAlgorithm&#39;s configuration.
Definition: PixelFlags.h:42
An abstract base classes for which the same implementation can be used for both SingleFrameAlgorithm ...
Definition: Algorithm.h:184
PYBIND11_PLUGIN(algorithm)
Definition: algorithm.cc:37
This is the algorithm for PixelFlags.