LSST Applications g1653933729+b86e4b8053,g2303c004a3+a99d6d42bd,g28da252d5a+3e0fd49a16,g2bbee38e9b+db5ba6d06c,g2bc492864f+db5ba6d06c,g2cdde0e794+b03b09fb0a,g3156d2b45e+b0ccf75d80,g347aa1857d+db5ba6d06c,g35bb328faa+b86e4b8053,g3a166c0a6a+db5ba6d06c,g3e281a1b8c+c9a36f98fc,g414038480c+70d5606f74,g42360bd172+a99d6d42bd,g461a3dce89+b86e4b8053,g5c9cb89fa5+b7dae1cdc6,g7f102674c4+d27c5e2769,g7f343241b9+516b07f5d7,g80478fca09+ee10125a54,g82479be7b0+11c35b2845,g858d7b2824+a99d6d42bd,g8cd86fa7b1+cb4c24add2,g9125e01d80+b86e4b8053,g979bb04a14+30ae7a28c8,g9ddcbc5298+b4cb6f9276,ga44b09e51c+390e0c76f2,ga5288a1d22+c32cd41bfc,gae0086650b+b86e4b8053,gb58c049af0+2fe46b4317,gc28159a63d+db5ba6d06c,gcd45df26be+a99d6d42bd,gcf0d15dbbd+be93eff7c7,gda6a2b7d83+be93eff7c7,gdaeeff99f8+b9455e0a82,ge5cf12406b+e20940066e,ge79ae78c31+db5ba6d06c,ge7c99ddb59+26aa1bc97f,gf048a9a2f4+f6d4943a12,gf0baf85859+e0282cf37d,w.2024.32
LSST Data Management Base Package
Loading...
Searching...
No Matches
Functions
ellipse.cc File Reference
#include <pybind11/pybind11.h>
#include <pybind11/operators.h>
#include <pybind11/stl.h>
#include <memory>
#include <stdexcept>
#include "pybind11.h"
#include "lsst/gauss2d/ellipse.h"

Go to the source code of this file.

Functions

void bind_ellipse (py::module &m)
 

Function Documentation

◆ bind_ellipse()

void bind_ellipse ( py::module & m)

Definition at line 40 of file ellipse.cc.

40 {
41 py::class_<gauss2d::Covariance, std::shared_ptr<gauss2d::Covariance>>(m, "Covariance")
42 .def(py::init<double, double, double>(), "sigma_x_sq"_a = 0, "sigma_y_sq"_a = 0, "cov_xy"_a = 0)
43 .def(py::init<gauss2d::Ellipse &>())
44 .def("convolve", &gauss2d::Covariance::convolve)
45 .def("make_convolution", &gauss2d::Covariance::make_convolution)
46 .def("set",
47 static_cast<void (gauss2d::Covariance::*)(double, double, double)>(
48 &gauss2d::Covariance::set),
49 "sigma_x_sq"_a = 0, "sigma_y_sq"_a = 0, "cov_xy"_a = 0)
50 .def("set", static_cast<void (gauss2d::Covariance::*)(const gauss2d::Ellipse &)>(
51 &gauss2d::Covariance::set))
52 .def_property("sigma_x_sq", &gauss2d::Covariance::get_sigma_x_sq,
53 &gauss2d::Covariance::set_sigma_x_sq)
54 .def_property("sigma_y_sq", &gauss2d::Covariance::get_sigma_y_sq,
55 &gauss2d::Covariance::set_sigma_y_sq)
56 .def_property("cov_xy", &gauss2d::Covariance::get_cov_xy, &gauss2d::Covariance::set_cov_xy)
57 .def_property("xyc", &gauss2d::Covariance::get_xyc, &gauss2d::Covariance::set_xyc)
58 .def(py::self == py::self)
59 .def(py::self != py::self)
60 .def("__repr__",
61 [](const gauss2d::Covariance &self) { return self.repr(true, self.PY_NAMESPACE_SEPARATOR); })
62 .def("__str__", &gauss2d::Covariance::str);
63 auto _e = py::class_<gauss2d::EllipseData, std::shared_ptr<gauss2d::EllipseData>>(m, "EllipseData");
64 py::class_<gauss2d::EllipseValues, std::shared_ptr<gauss2d::EllipseValues>, gauss2d::EllipseData>(
65 m, "EllipseValues")
66 .def(py::init<double, double, double>(), "sigma_x"_a = 0, "sigma_y"_a = 0, "rho"_a = 0)
67 .def("set", &gauss2d::EllipseValues::set, "sigma_x"_a, "sigma_y"_a, "rho"_a)
68 .def("set_h", &gauss2d::EllipseValues::set_h, "hwhm_x"_a, "hwhm_y"_a, "rho"_a)
69 .def_property("rho", &gauss2d::EllipseValues::get_rho, &gauss2d::EllipseValues::set_rho)
70 .def_property("hwhm_x", &gauss2d::EllipseValues::get_hwhm_x, &gauss2d::EllipseValues::set_hwhm_x)
71 .def_property("hwhm_y", &gauss2d::EllipseValues::get_hwhm_y, &gauss2d::EllipseValues::set_hwhm_y)
72 .def_property("sigma_x", &gauss2d::EllipseValues::get_sigma_x,
73 &gauss2d::EllipseValues::set_sigma_x)
74 .def_property("sigma_y", &gauss2d::EllipseValues::get_sigma_y,
75 &gauss2d::EllipseValues::set_sigma_y)
76 .def_property("hxyr", &gauss2d::EllipseValues::get_hxyr, &gauss2d::EllipseValues::set_hxyr)
77 .def_property("xyr", &gauss2d::EllipseValues::get_xyr, &gauss2d::EllipseValues::set_xyr)
78 .def(py::self == py::self)
79 .def(py::self != py::self)
80 .def("__repr__",
81 [](const gauss2d::EllipseValues &self) {
82 return self.repr(true, self.PY_NAMESPACE_SEPARATOR);
83 })
84 .def("__str__", &gauss2d::EllipseValues::str);
85 py::class_<gauss2d::Ellipse, std::shared_ptr<gauss2d::Ellipse>>(m, "Ellipse")
86 .def(py::init<std::shared_ptr<gauss2d::EllipseData>>(), "data"_a)
87 .def(py::init<gauss2d::Covariance &>())
88 .def(py::init<gauss2d::EllipseMajor &>())
89 .def(py::init<double, double, double>(), "sigma_x"_a = 0, "sigma_y"_a = 0, "rho"_a = 0)
90 .def_static("check", &gauss2d::Ellipse::check)
91 .def("convolve", &gauss2d::Ellipse::convolve)
92 .def("get_cov_xy", &gauss2d::Ellipse::get_cov_xy)
93 .def("get_radius_trace", &gauss2d::Ellipse::get_radius_trace)
94 .def("make_convolution", &gauss2d::Ellipse::make_convolution)
95 .def("set",
96 static_cast<void (gauss2d::Ellipse::*)(double, double, double)>(&gauss2d::Ellipse::set),
97 "sigma_x"_a, "sigma_y"_a, "rho"_a)
98 .def("set",
99 static_cast<void (gauss2d::Ellipse::*)(const gauss2d::Covariance &)>(&gauss2d::Ellipse::set),
100 "ellipse"_a)
101 .def("set",
102 static_cast<void (gauss2d::Ellipse::*)(const gauss2d::EllipseMajor &)>(
103 &gauss2d::Ellipse::set),
104 "ellipse_major"_a)
105 .def("set_h", &gauss2d::Ellipse::set_h, "hwhm_x"_a = 0, "hwhm_y"_a = 0, "rho"_a = 0)
106 .def_property("rho", &gauss2d::Ellipse::get_rho, &gauss2d::Ellipse::set_rho)
107 .def_property("hwhm_x", &gauss2d::Ellipse::get_hwhm_x, &gauss2d::Ellipse::set_hwhm_x)
108 .def_property("hwhm_y", &gauss2d::Ellipse::get_hwhm_y, &gauss2d::Ellipse::set_hwhm_y)
109 .def_property("sigma_x", &gauss2d::Ellipse::get_sigma_x, &gauss2d::Ellipse::set_sigma_x)
110 .def_property("sigma_y", &gauss2d::Ellipse::get_sigma_y, &gauss2d::Ellipse::set_sigma_y)
111 .def_property("hxyr", &gauss2d::Ellipse::get_hxyr, &gauss2d::Ellipse::set_hxyr)
112 .def_property("xyr", &gauss2d::Ellipse::get_xyr, &gauss2d::Ellipse::set_xyr)
113 .def(py::self == py::self)
114 .def(py::self != py::self)
115 .def("__repr__",
116 [](const gauss2d::Ellipse &self) { return self.repr(true, self.PY_NAMESPACE_SEPARATOR); })
117 .def("__str__", &gauss2d::Ellipse::str);
118 py::class_<gauss2d::EllipseMajor, std::shared_ptr<gauss2d::EllipseMajor>>(m, "EllipseMajor")
119 .def(py::init<gauss2d::Covariance &, bool>(), "covariance"_a, "degrees"_a = false)
120 .def(py::init<gauss2d::Ellipse &, bool>(), "ellipse"_a, "degrees"_a = false)
121 .def(py::init<double, double, double, bool>(), "r_major"_a = 0, "axrat"_a = 1, "angle"_a = 0,
122 "degrees"_a = false)
123 .def_static("check", &gauss2d::EllipseMajor::check)
124 .def("get_angle_degrees", &gauss2d::EllipseMajor::get_angle_degrees)
125 .def("get_angle_radians", &gauss2d::EllipseMajor::get_angle_radians)
126 .def_property("r_major", &gauss2d::EllipseMajor::get_r_major, &gauss2d::EllipseMajor::set_r_major)
127 .def_property("axrat", &gauss2d::EllipseMajor::get_axrat, &gauss2d::EllipseMajor::set_axrat)
128 .def_property("angle", &gauss2d::EllipseMajor::get_angle, &gauss2d::EllipseMajor::set_angle)
129 .def_property("degrees", &gauss2d::EllipseMajor::is_degrees, &gauss2d::EllipseMajor::set_degrees)
130 .def_property("rqa", &gauss2d::EllipseMajor::get_rqa, &gauss2d::EllipseMajor::set_rqa)
131 .def(py::self == py::self)
132 .def(py::self != py::self)
133 .def("__repr__",
134 [](const gauss2d::EllipseMajor &self) {
135 return self.repr(true, self.PY_NAMESPACE_SEPARATOR);
136 })
137 .def("__str__", &gauss2d::EllipseMajor::str);
138}
int m
Definition SpanSet.cc:48
A representation of a 2D Gaussian with x and y standard deviations and a covariance value.
Definition ellipse.h:57
Interface for an object storing Ellipse data.
Definition ellipse.h:132
An Ellipse with sigma_x, sigma_y, and rho values.
Definition ellipse.h:283
An Ellipse with r_major, axrat and angle values.
Definition ellipse.h:337
An EllipseData storing sigma_x, sigma_y, rho values as shared_ptrs.
Definition ellipse.h:232