LSST Applications g0afe43252f+b86e4b8053,g0e535e6de9+ad13c1b82d,g11f7dcd041+017865fdd3,g1ce3e0751c+f991eae79d,g25e82e299b+da9c58a417,g28da252d5a+9a4345bd89,g2bbee38e9b+b6588ad223,g2bc492864f+b6588ad223,g2cdde0e794+8523d0dbb4,g347aa1857d+b6588ad223,g35bb328faa+b86e4b8053,g3a166c0a6a+b6588ad223,g461a3dce89+b86e4b8053,g52b1c1532d+b86e4b8053,g7d11c3e888+3343bff751,g80478fca09+f22f659b46,g8543c18506+fadcf71ecf,g858d7b2824+c704b22fcc,g8cd86fa7b1+497903d09f,g965a9036f2+c704b22fcc,g979bb04a14+43c1c4070b,g9ddcbc5298+f24b38b85a,gae0086650b+b86e4b8053,gb781091699+0f9934ae6f,gbb886bcc26+486567bf06,gc28159a63d+b6588ad223,gc30aee3386+a2f0f6cab9,gc9f6898e11+66e322ebb3,gcaf7e4fdec+c704b22fcc,gcd45df26be+c704b22fcc,gcdd4ae20e8+02080e1d2d,gcf0d15dbbd+02080e1d2d,gdaeeff99f8+006e14e809,gdbce86181e+42405ade82,ge3d4d395c2+224150c836,ge79ae78c31+b6588ad223,gf048a9a2f4+69e41b07e6,gf0baf85859+b4cca3d10f,w.2024.30
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