LSST Applications g063fba187b+cac8b7c890,g0f08755f38+6aee506743,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+b4475c5878,g1dcb35cd9c+8f9bc1652e,g20f6ffc8e0+6aee506743,g217e2c1bcf+73dee94bd0,g28da252d5a+1f19c529b9,g2bbee38e9b+3f2625acfc,g2bc492864f+3f2625acfc,g3156d2b45e+6e55a43351,g32e5bea42b+1bb94961c2,g347aa1857d+3f2625acfc,g35bb328faa+a8ce1bb630,g3a166c0a6a+3f2625acfc,g3e281a1b8c+c5dd892a6c,g3e8969e208+a8ce1bb630,g414038480c+5927e1bc1e,g41af890bb2+8a9e676b2a,g7af13505b9+809c143d88,g80478fca09+6ef8b1810f,g82479be7b0+f568feb641,g858d7b2824+6aee506743,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+2903d499ea,gb58c049af0+d64f4d3760,gc28159a63d+3f2625acfc,gcab2d0539d+b12535109e,gcf0d15dbbd+46a3f46ba9,gda6a2b7d83+46a3f46ba9,gdaeeff99f8+1711a396fd,ge79ae78c31+3f2625acfc,gef2f8181fd+0a71e47438,gf0baf85859+c1f95f4921,gfa517265be+6aee506743,gfa999e8aa5+17cd334064,w.2024.51
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
std::string repr(bool name_keywords=false, std::string_view namespace_separator=Object::CC_NAMESPACE_SEPARATOR) const override
Return a full, callable string representation of this.
Definition ellipse.cc:122
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
std::string repr(bool name_keywords=false, std::string_view namespace_separator=Object::CC_NAMESPACE_SEPARATOR) const override
Return a full, callable string representation of this.
Definition ellipse.cc:308
An Ellipse with r_major, axrat and angle values.
Definition ellipse.h:337
std::string repr(bool name_keywords=false, std::string_view namespace_separator=Object::CC_NAMESPACE_SEPARATOR) const override
Return a full, callable string representation of this.
Definition ellipse.cc:411
An EllipseData storing sigma_x, sigma_y, rho values as shared_ptrs.
Definition ellipse.h:232
std::string repr(bool name_keywords=false, std::string_view namespace_separator=Object::CC_NAMESPACE_SEPARATOR) const override
Return a full, callable string representation of this.
Definition ellipse.cc:219
static constexpr std::string_view PY_NAMESPACE_SEPARATOR
Definition object.h:47