LSSTApplications  11.0-24-g0a022a1,15.0+8,15.0+9,15.0-1-g19261fa+1,15.0-1-g1eca518+10,15.0-1-g60afb23+8,15.0-1-g615e0bb,15.0-1-g6668b0b+5,15.0-1-g788a293+8,15.0-1-ga91101e+8,15.0-1-gae1598d+7,15.0-1-gc45031d+10,15.0-1-gd076f1f+8,15.0-1-gdf18595+1,15.0-1-gf4f1c34+7,15.0-18-g5f205baaa,15.0-2-g100d730+1,15.0-2-g18f3f21,15.0-2-g35685a8+1,15.0-2-g947dc0d+10,15.0-2-ge3d7f4b+1,15.0-2-gf38729e,15.0-3-g150fc43+9,15.0-3-g6f085af+1,15.0-3-g9103c06+7,15.0-3-ga03b4ca+10,15.0-3-gaec6799+5,15.0-3-gb7a597c+8,15.0-3-ge6a6747,15.0-4-g45f767a+7,15.0-4-g654b129+6,15.0-4-gff20472+11,15.0-5-g389937dc+6,15.0-5-ga70c291+1,15.0-6-gbad5ef12+1,15.0-6-ge2d9597+10
LSSTDataManagementBasePackage
mappings.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 
23 #include "pybind11/pybind11.h"
24 
25 #include "lsst/jointcal/Gtransfo.h"
26 #include "lsst/jointcal/Mapping.h"
28 
29 namespace py = pybind11;
30 using namespace pybind11::literals;
31 
32 namespace lsst {
33 namespace jointcal {
34 namespace {
35 
36 void declareMapping(py::module &mod) {
37  py::class_<Mapping, std::shared_ptr<Mapping>> cls(mod, "Mapping");
38 
39  cls.def("getNpar", &Mapping::getNpar);
40 }
41 
42 void declareTwoTransfoMapping(py::module &mod) {
43  py::class_<TwoTransfoMapping, std::shared_ptr<TwoTransfoMapping>, Mapping> cls(mod, "TwoTransfoMapping");
44 
45  cls.def("getTransfo1", &TwoTransfoMapping::getTransfo1, py::return_value_policy::reference_internal);
46  cls.def_property_readonly("transfo1", &TwoTransfoMapping::getTransfo1,
47  py::return_value_policy::reference_internal);
48 
49  cls.def("getTransfo2", &TwoTransfoMapping::getTransfo2, py::return_value_policy::reference_internal);
50  cls.def_property_readonly("transfo2", &TwoTransfoMapping::getTransfo2,
51  py::return_value_policy::reference_internal);
52 }
53 
54 void declareSimpleGtransfoMapping(py::module &mod) {
55  py::class_<SimpleGtransfoMapping, std::shared_ptr<SimpleGtransfoMapping>, Mapping> cls(
56  mod, "SimpleGtransfoMapping");
57 }
58 
59 void declareSimplePolyMapping(py::module &mod) {
60  py::class_<SimplePolyMapping, std::shared_ptr<SimplePolyMapping>, SimpleGtransfoMapping> cls(
61  mod, "SimplePolyMapping");
62 }
63 
65  py::module::import("lsst.jointcal.star");
66  py::module::import("lsst.jointcal.gtransfo");
67  py::module mod("mappings");
68 
69  declareMapping(mod);
70  declareTwoTransfoMapping(mod);
71  declareSimpleGtransfoMapping(mod);
72  declareSimplePolyMapping(mod);
73 
74  return mod.ptr();
75 }
76 } // namespace
77 } // namespace jointcal
78 } // namespace lsst
PYBIND11_PLUGIN(_cameraSys)
Definition: cameraSys.cc:62
A base class for image defects.
Definition: cameraGeom.dox:3