lsst.afw  14.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
radii.cc
Go to the documentation of this file.
1 /*
2  * LSST Data Management System
3  * Copyright 2008-2016 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/operators.h>
25 //#include <pybind11/stl.h>
26 
28 
29 namespace py = pybind11;
30 
31 using namespace py::literals;
32 
33 using namespace lsst::afw::geom::ellipses;
34 
35 PYBIND11_PLUGIN(_radii) {
36  py::module mod("_radii", "Python wrapper for afw _radii library");
37 
38  py::class_<DeterminantRadius> clsDeterminantRadius(mod, "DeterminantRadius");
39 
40  clsDeterminantRadius.def(py::init<double>(), "value"_a = 1.0);
41  clsDeterminantRadius.def("normalize", &DeterminantRadius::normalize);
42  clsDeterminantRadius.def_static("getName", DeterminantRadius::getName);
43  clsDeterminantRadius.def("__str__", [](DeterminantRadius const& self) { return std::to_string(self); });
44  clsDeterminantRadius.def("__repr__", [](DeterminantRadius const& self) {
45  return self.getName() + "(" + std::to_string(self) + ")";
46  });
47 
48  py::class_<TraceRadius> clsTraceRadius(mod, "TraceRadius");
49 
50  clsTraceRadius.def(py::init<double>(), "value"_a = 1.0);
51  clsTraceRadius.def("normalize", &TraceRadius::normalize);
52  clsTraceRadius.def_static("getName", TraceRadius::getName);
53  clsTraceRadius.def("__str__", [](TraceRadius const& self) { return std::to_string(self); });
54  clsTraceRadius.def("__repr__", [](TraceRadius const& self) {
55  return self.getName() + "(" + std::to_string(self) + ")";
56  });
57 
58  py::class_<LogDeterminantRadius> clsLogDeterminantRadius(mod, "LogDeterminantRadius");
59 
60  clsLogDeterminantRadius.def(py::init<double>(), "value"_a = 0.0);
61  clsLogDeterminantRadius.def("normalize", &LogDeterminantRadius::normalize);
62  clsLogDeterminantRadius.def_static("getName", LogDeterminantRadius::getName);
63  clsLogDeterminantRadius.def("__str__",
64  [](LogDeterminantRadius const& self) { return std::to_string(self); });
65  clsLogDeterminantRadius.def("__repr__", [](LogDeterminantRadius const& self) {
66  return self.getName() + "(" + std::to_string(self) + ")";
67  });
68 
69  py::class_<LogTraceRadius> clsLogTraceRadius(mod, "LogTraceRadius");
70 
71  clsLogTraceRadius.def(py::init<double>(), "value"_a = 0.0);
72  clsLogTraceRadius.def("normalize", &LogTraceRadius::normalize);
73  clsLogTraceRadius.def_static("getName", LogTraceRadius::getName);
74  clsLogTraceRadius.def("__str__", [](LogTraceRadius const& self) { return std::to_string(self); });
75  clsLogTraceRadius.def("__repr__", [](LogTraceRadius const& self) {
76  return self.getName() + "(" + std::to_string(self) + ")";
77  });
78 
79  return mod.ptr();
80 }
The natural logarithm of the TraceRadius.
Definition: radii.h:202
PYBIND11_PLUGIN(_cameraPoint)
Definition: cameraPoint.cc:35
The natural logarithm of the DeterminantRadius.
Definition: radii.h:157
The radius defined as the 4th root of the determinant of the quadrupole matrix.
Definition: radii.h:57
double const _a
Definition: RandomImage.cc:77
The radius defined as .
Definition: radii.h:108