23 #include <pybind11/pybind11.h>
29 namespace py = pybind11;
31 using namespace py::literals;
33 using namespace lsst::afw::geom::ellipses;
36 py::module mod(
"_radii",
"Python wrapper for afw _radii library");
38 py::class_<DeterminantRadius> clsDeterminantRadius(mod,
"DeterminantRadius");
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); });
45 return self.getName() +
"(" + std::to_string(
self) +
")";
48 py::class_<TraceRadius> clsTraceRadius(mod,
"TraceRadius");
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) +
")";
58 py::class_<LogDeterminantRadius> clsLogDeterminantRadius(mod,
"LogDeterminantRadius");
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__",
66 return self.getName() +
"(" + std::to_string(
self) +
")";
69 py::class_<LogTraceRadius> clsLogTraceRadius(mod,
"LogTraceRadius");
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); });
76 return self.getName() +
"(" + std::to_string(
self) +
")";
The natural logarithm of the TraceRadius.
PYBIND11_PLUGIN(_cameraPoint)
The natural logarithm of the DeterminantRadius.
The radius defined as the 4th root of the determinant of the quadrupole matrix.