LSSTApplications  20.0.0
LSSTDataManagementBasePackage
Functions
quadrupole.cc File Reference
#include "pybind11/pybind11.h"
#include "pybind11/eigen.h"
#include "pybind11/stl.h"
#include "lsst/afw/geom/ellipses/BaseCore.h"
#include "lsst/afw/geom/ellipses/Quadrupole.h"

Go to the source code of this file.

Functions

 PYBIND11_MODULE (quadrupole, mod)
 

Function Documentation

◆ PYBIND11_MODULE()

PYBIND11_MODULE ( quadrupole  ,
mod   
)

Definition at line 35 of file quadrupole.cc.

35  {
36  /* Module level */
37  py::class_<Quadrupole, std::shared_ptr<Quadrupole>, BaseCore> clsQuadrupole(mod, "Quadrupole");
38 
39  /* Member types and enums */
40  typedef Eigen::Matrix<double, 2, 2, Eigen::DontAlign> Matrix;
41 
42  /* Constructors */
43  clsQuadrupole.def(py::init<double, double, double, bool>(), "ixx"_a = 1.0, "iyy"_a = 1.0, "ixy"_a = 0.0,
44  "normalize"_a = false);
45  clsQuadrupole.def(py::init<BaseCore::ParameterVector const &, bool>(), "vector"_a, "normalize"_a = false);
46  clsQuadrupole.def(py::init<Matrix const &, bool>(), "matrix"_a, "normalize"_a = true);
47  clsQuadrupole.def(py::init<Quadrupole const &>());
48  clsQuadrupole.def(py::init<BaseCore const &>());
49  clsQuadrupole.def(py::init<BaseCore::Convolution const &>());
50 
51  py::implicitly_convertible<BaseCore::Convolution, Quadrupole>();
52 
53  /* Operators */
54  clsQuadrupole.def("__eq__", [](Quadrupole &self, Quadrupole &other) { return self == other; },
55  py::is_operator());
56  clsQuadrupole.def("__ne__", [](Quadrupole &self, Quadrupole &other) { return self != other; },
57  py::is_operator());
58 
59  /* Members */
60  clsQuadrupole.def("getIxx", &Quadrupole::getIxx);
61  clsQuadrupole.def("getIyy", &Quadrupole::getIyy);
62  clsQuadrupole.def("getIxy", &Quadrupole::getIxy);
63  clsQuadrupole.def("setIxx", &Quadrupole::setIxx);
64  clsQuadrupole.def("setIyy", &Quadrupole::setIyy);
65  clsQuadrupole.def("setIxy", &Quadrupole::setIxy);
66  clsQuadrupole.def("assign", [](Quadrupole &self, Quadrupole &other) { self = other; });
67  clsQuadrupole.def("assign", [](Quadrupole &self, BaseCore &other) { self = other; });
68  clsQuadrupole.def("transform", [](Quadrupole &self, lsst::geom::LinearTransform const &t) {
69  return std::static_pointer_cast<Quadrupole>(self.transform(t).copy());
70  });
71  clsQuadrupole.def("transformInPlace", [](Quadrupole &self, lsst::geom::LinearTransform const &t) {
72  self.transform(t).inPlace();
73  });
74  // TODO: pybind11 based on swig wrapper for now. Hopefully can be removed once pybind11 gets smarter
75  // handling of implicit conversions
76  clsQuadrupole.def("convolve", [](Quadrupole &self, BaseCore const &other) {
77  return Quadrupole(self.convolve(other));
78  });
79 }
lsst::geom::LinearTransform
A 2D linear coordinate transformation.
Definition: LinearTransform.h:69
lsst::afw::geom::ellipses::BaseCore
A base class for parametrizations of the "core" of an ellipse - the ellipticity and size.
Definition: BaseCore.h:55
other
ItemVariant const * other
Definition: Schema.cc:56
lsst::afw::math.convolveImage.convolveImageContinued.convolve
convolve
Definition: convolveImageContinued.py:28
std::copy
T copy(T... args)
lsst::meas::modelfit::Matrix
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition: common.h:45
lsst::afw::geom::ellipses::Quadrupole
An ellipse core with quadrupole moments as parameters.
Definition: Quadrupole.h:47
transform
table::Key< int > transform
Definition: TransformMap.cc:299