lsst.meas.base  14.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups Pages
algorithm.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 
25 #include "lsst/afw/image/Wcs.h"
26 #include "lsst/afw/table/Source.h"
27 #include "lsst/meas/base/python.h"
29 
30 namespace py = pybind11;
31 using namespace pybind11::literals;
32 
33 namespace lsst {
34 namespace meas {
35 namespace base {
36 
37 PYBIND11_PLUGIN(algorithm) {
38  py::module::import("lsst.afw.image");
39  py::module::import("lsst.afw.table");
40 
41  py::module mod("algorithm");
42 
43  /* Module level */
44  py::class_<BaseAlgorithm, std::shared_ptr<BaseAlgorithm>> clsBaseAlgorithm(
45  mod, "BaseAlgorithm");
46  py::class_<SingleFrameAlgorithm, std::shared_ptr<SingleFrameAlgorithm>, BaseAlgorithm> clsSingleFrameAlgorithm(
47  mod, "SingleFrameAlgorithm");
48  py::class_<SimpleAlgorithm, std::shared_ptr<SimpleAlgorithm>, SingleFrameAlgorithm> clsSimpleAlgorithm(
49  mod, "SimpleAlgorithm", py::multiple_inheritance());
50 
51  /* Members */
52  python::declareAlgorithm<SingleFrameAlgorithm>(clsSingleFrameAlgorithm);
53 
54  clsSimpleAlgorithm.def("measureForced", &SimpleAlgorithm::measureForced,
55  "measRecord"_a, "exposure"_a, "refRecord"_a, "refWcs"_a);
56  clsBaseAlgorithm.def("getLogName", &SimpleAlgorithm::getLogName);
57 
58  return mod.ptr();
59 }
60 
61 } // base
62 } // meas
63 } // lsst
Base class for algorithms that measure the properties of sources on single image. ...
Definition: Algorithm.h:84
Ultimate abstract base class for all C++ measurement algorithms.
Definition: Algorithm.h:41
PYBIND11_PLUGIN(algorithm)
Definition: algorithm.cc:37