Loading [MathJax]/extensions/tex2jax.js
LSST Applications g0000d66e7c+4a51730b0a,g0485b4d2cb+be65c9c1d7,g0fba68d861+f6d31a8697,g1ec0fe41b4+3ea9d11450,g1fd858c14a+41d169aaf2,g2440f9efcc+8c5ae1fdc5,g2abac59d63+64581b95a4,g35bb328faa+8c5ae1fdc5,g4d2262a081+6c6e5d09ab,g53246c7159+8c5ae1fdc5,g55585698de+6f166a295a,g56a49b3a55+7eddd92ad8,g60b5630c4e+6f166a295a,g67b6fd64d1+97cc007aa2,g78460c75b0+7e33a9eb6d,g786e29fd12+668abc6043,g8352419a5c+8c5ae1fdc5,g8852436030+3f3bba821f,g8869f962bc+e44c8a7abf,g89139ef638+97cc007aa2,g94187f82dc+6f166a295a,g989de1cb63+97cc007aa2,g9d31334357+6f166a295a,g9f33ca652e+879172f2e0,gabe3b4be73+8856018cbb,gabf8522325+977d9fabaf,gae5fe98123+8e7c4d07ad,gb1101e3267+ec54132632,gb89ab40317+97cc007aa2,gc91f06edcd+27697e055d,gcf25f946ba+3f3bba821f,gd6cbbdb0b4+1cc2750d2e,gde0f65d7ad+ec03ee3b6a,ge278dab8ac+6b863515ed,ge410e46f29+97cc007aa2,gf35d7ec915+97dd712d81,gf5e32f922b+8c5ae1fdc5,gf67bdafdda+97cc007aa2,w.2025.19
LSST Data Management Base Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
centroid.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/centroid.h"

Go to the source code of this file.

Functions

void bind_centroid (py::module &m)
 

Function Documentation

◆ bind_centroid()

void bind_centroid ( py::module & m)

Definition at line 40 of file centroid.cc.

40 {
41 auto _c = py::class_<gauss2d::CentroidData, std::shared_ptr<gauss2d::CentroidData>>(m, "CentroidData");
42 py::class_<gauss2d::CentroidValues, std::shared_ptr<gauss2d::CentroidValues>, gauss2d::CentroidData>(
43 m, "CentroidValues")
44 // Note: These can't be shared_ptrs
45 .def(py::init<double, double>(), "x"_a = 0, "y"_a = 0)
49 .def(py::self == py::self)
50 .def(py::self != py::self)
51 .def("__repr__",
52 [](const gauss2d::CentroidValues &self) {
53 return self.repr(true, self.PY_NAMESPACE_SEPARATOR);
54 })
55 .def("__str__", &gauss2d::CentroidValues::str);
56 py::class_<gauss2d::Centroid, std::shared_ptr<gauss2d::Centroid>>(m, "Centroid")
57 .def(py::init<std::shared_ptr<gauss2d::CentroidData>>(), "data"_a)
58 .def(py::init<double, double>(), "x"_a = 0, "y"_a = 0)
62 .def(py::self == py::self)
63 .def(py::self != py::self)
64 .def("__repr__",
65 [](const gauss2d::Centroid &self) { return self.repr(true, self.PY_NAMESPACE_SEPARATOR); })
66 .def("__str__", &gauss2d::Centroid::str);
67}
Interface for an object storing Centroid data.
Definition centroid.h:43
A 2D coordinate representing the center of a plane figure.
Definition centroid.h:114
double get_y() const
Get the y value.
Definition centroid.cc:80
std::array< double, 2 > get_xy() const
Get the x and y values.
Definition centroid.cc:78
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 centroid.cc:96
std::string str() const override
Return a brief, human-readable string representation of this.
Definition centroid.cc:101
void set_xy(const std::array< double, 2 > &xy)
Definition centroid.cc:93
void set_y(double y)
Definition centroid.cc:94
void set_x(double x)
Definition centroid.cc:92
double get_x() const
Get the x value.
Definition centroid.cc:76
A CentroidData storing centroid values as shared_ptrs.
Definition centroid.h:74
void set_y(double y) override
Definition centroid.cc:44
void set_xy(const std::array< double, 2 > &xy) override
Definition centroid.cc:40
double get_y() const override
Get the y value.
Definition centroid.cc:37
void set_x(double x) override
Definition centroid.cc:39
std::string str() const override
Return a brief, human-readable string representation of this.
Definition centroid.cc:51
std::string repr(bool name_keywords, std::string_view namespace_separator) const override
Return a full, callable string representation of this.
Definition centroid.cc:46
std::array< double, 2 > get_xy() const override
Get the x and y values.
Definition centroid.cc:36
double get_x() const override
Get the x value.
Definition centroid.cc:35
static constexpr std::string_view PY_NAMESPACE_SEPARATOR
Definition object.h:47