LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
LSST Data Management Base Package
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Functions | Variables
lsst::afw::geom::ellipses Namespace Reference

Namespaces

namespace  _axes
 
namespace  _ellipse
 
namespace  _quadrupole
 
namespace  detail
 

Classes

class  Axes
 An ellipse core for the semimajor/semiminor axis and position angle parametrization (a,b,theta). More...
 
class  BaseCore
 A base class for parametrizations of the "core" of an ellipse - the ellipticity and size. More...
 
class  ConformalShear
 A logarithmic complex ellipticity with magnitude \(|e| = \ln (a/b) \). More...
 
class  DeterminantRadius
 The radius defined as the 4th root of the determinant of the quadrupole matrix. More...
 
class  Distortion
 A complex ellipticity with magnitude \(|e| = \frac{a^2 - b^2}{a^2 + b^2}\). More...
 
class  Ellipse
 An ellipse defined by an arbitrary BaseCore and a center point. More...
 
class  EllipseHorizontalLineIntersection
 
class  EllipseMatplotlibInterface
 
class  LogDeterminantRadius
 The natural logarithm of the DeterminantRadius. More...
 
class  LogTraceRadius
 The natural logarithm of the TraceRadius. More...
 
class  Parametric
 A functor that returns points on the boundary of the ellipse as a function of a parameter that runs between 0 and 2 pi (but is not angle). More...
 
class  PixelRegion
 A pixelized region containing all pixels whose centers are within an Ellipse. More...
 
class  Quadrupole
 An ellipse core with quadrupole moments as parameters. More...
 
class  ReducedShear
 A complex ellipticity with magnitude \(|e| = \frac{a-b}{a+b} \). More...
 
class  Separable
 An ellipse core with a complex ellipticity and radius parameterization. More...
 
class  TraceRadius
 The radius defined as \(\sqrt{0.5(I_{xx} + I_{yy})}\). More...
 

Typedefs

using SeparableDistortionDeterminantRadius = Separable<Distortion, DeterminantRadius>
 
using SeparableDistortionTraceRadius = Separable<Distortion, TraceRadius>
 
using SeparableDistortionLogDeterminantRadius = Separable<Distortion, LogDeterminantRadius>
 
using SeparableDistortionLogTraceRadius = Separable<Distortion, LogTraceRadius>
 
using SeparableConformalShearDeterminantRadius = Separable<ConformalShear, DeterminantRadius>
 
using SeparableConformalShearTraceRadius = Separable<ConformalShear, TraceRadius>
 
using SeparableConformalShearLogDeterminantRadius = Separable<ConformalShear, LogDeterminantRadius>
 
using SeparableConformalShearLogTraceRadius = Separable<ConformalShear, LogTraceRadius>
 
using SeparableReducedShearDeterminantRadius = Separable<ReducedShear, DeterminantRadius>
 
using SeparableReducedShearTraceRadius = Separable<ReducedShear, TraceRadius>
 
using SeparableReducedShearLogDeterminantRadius = Separable<ReducedShear, LogDeterminantRadius>
 
using SeparableReducedShearLogTraceRadius = Separable<ReducedShear, LogTraceRadius>
 

Functions

 Ellipse_plot (self, axes=None, scale=1.0, show=True, rescale=True, **kwds)
 
void wrapAxes (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapBaseCore (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapConformalShear (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapDistortion (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapEllipse (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapPixelRegion (lsst::cpputils::python::WrapperCollection &)
 
void wrapRadii (lsst::cpputils::python::WrapperCollection &)
 
void wrapEllipticityBase (lsst::cpputils::python::WrapperCollection &)
 
void wrapReducedShear (lsst::cpputils::python::WrapperCollection &)
 
void wrapQuadrupole (lsst::cpputils::python::WrapperCollection &)
 
void wrapSeparable (lsst::cpputils::python::WrapperCollection &)
 
 PYBIND11_MODULE (_ellipses, mod)
 
template<typename Ellipticity_ , typename Radius_ >
void declareSeparable (lsst::cpputils::python::WrapperCollection &wrappers, const std::string &suffix)
 

Variables

dict Separable
 
 MatplotlibInterface
 
 plot
 

Detailed Description

lsst.afw.geom.ellipses

Typedef Documentation

◆ SeparableConformalShearDeterminantRadius

Definition at line 57 of file ellipses.h.

◆ SeparableConformalShearLogDeterminantRadius

Definition at line 59 of file ellipses.h.

◆ SeparableConformalShearLogTraceRadius

Definition at line 60 of file ellipses.h.

◆ SeparableConformalShearTraceRadius

Definition at line 58 of file ellipses.h.

◆ SeparableDistortionDeterminantRadius

Definition at line 52 of file ellipses.h.

◆ SeparableDistortionLogDeterminantRadius

Definition at line 54 of file ellipses.h.

◆ SeparableDistortionLogTraceRadius

Definition at line 55 of file ellipses.h.

◆ SeparableDistortionTraceRadius

Definition at line 53 of file ellipses.h.

◆ SeparableReducedShearDeterminantRadius

Definition at line 62 of file ellipses.h.

◆ SeparableReducedShearLogDeterminantRadius

Definition at line 64 of file ellipses.h.

◆ SeparableReducedShearLogTraceRadius

Definition at line 65 of file ellipses.h.

◆ SeparableReducedShearTraceRadius

Definition at line 63 of file ellipses.h.

Function Documentation

◆ declareSeparable()

template<typename Ellipticity_ , typename Radius_ >
void lsst::afw::geom::ellipses::declareSeparable ( lsst::cpputils::python::WrapperCollection & wrappers,
const std::string & suffix )

Definition at line 43 of file _separable.cc.

43 {
45 wrappers.wrapType(
46 py::class_<Class, std::shared_ptr<Class>, BaseCore>(wrappers.module,
47 ("Separable" + suffix).c_str()),
48 [](auto &mod, auto &cls) {
49 cls.def(py::init<double, double, double, bool>(), "e1"_a = 0.0, "e2"_a = 0.0,
50 "radius"_a = Radius_(), "normalize"_a = true);
51 cls.def(py::init<Class const &>());
52 cls.def(py::init<BaseCore const &>());
53
54 cls.def("getE1", &Class::getE1);
55 cls.def("setE1", &Class::setE1);
56 cls.def("getE2", &Class::getE2);
57 cls.def("setE2", &Class::setE2);
58 cls.def("getRadius", (Radius_ const &(Class::*)() const) & Class::getRadius);
59 cls.def("setRadius", (void (Class::*)(double)) & Class::setRadius);
60 cls.def("setRadius", (void (Class::*)(Radius_ const &)) & Class::setRadius);
61 cls.def("getEllipticity", (Ellipticity_ const &(Class::*)() const) & Class::getEllipticity);
62 cls.def("clone", &Class::clone);
63 cls.def("getName", &Class::getName);
64 cls.def("normalize", &Class::normalize);
65 cls.def("assign", [](Class &self, Class &other) { self = other; });
66 cls.def("assign", [](Class &self, BaseCore &other) { self = other; });
67 cls.def("transform", [](Class &self, lsst::geom::LinearTransform const &t) {
68 return std::static_pointer_cast<Class>(self.transform(t).copy());
69 });
70 cls.def("transformInPlace", [](Class &self, lsst::geom::LinearTransform const &t) {
71 self.transform(t).inPlace();
72 });
73 cls.def("__str__", [](Class &self) {
74 return py::str("({}, {})").format(self.getEllipticity(), self.getRadius());
75 });
76 cls.def("__repr__", [](Class &self) {
77 return py::str("Separable({}, {})").format(self.getEllipticity(), self.getRadius());
78 });
79 });
80}
A base class for parametrizations of the "core" of an ellipse - the ellipticity and size.
Definition BaseCore.h:55
An ellipse core with a complex ellipticity and radius parameterization.
Definition Separable.h:50
PyType wrapType(PyType cls, ClassWrapperCallback function, bool setModuleName=true)
Add a type (class or enum) wrapper, deferring method and other attribute definitions until finish() i...
Definition python.h:391
A 2D linear coordinate transformation.

◆ Ellipse_plot()

lsst.afw.geom.ellipses.Ellipse_plot ( self,
axes = None,
scale = 1.0,
show = True,
rescale = True,
** kwds )
Plot the ellipse in matplotlib, adding a MatplotlibInterface
object as the 'matplotlib' attribute of the ellipse.

Aside from those below, keyword arguments for the
matplotlib.patches.Patch constructor are also accepted
('facecolor', 'linestyle', etc.)

Parameters
----------
axes : `matplotlib.axes.Axes`, optional
    Axes to plot on.  Defaults to matplotlib.pyplot.gca().
scale : `float`, optional
    Scale the displayed ellipse by this factor.
show : `bool`, optional
    If True, update the figure automatically.  Set to False for batch
    processing.
rescale : `bool`, optional
    If True, rescale the axes.

Returns
-------
interface : `EllipseMatplotlibInterface`
    An object that allows the matplotlib patch to be updated when the
    ellipse modified.

Definition at line 90 of file __init__.py.

90def Ellipse_plot(self, axes=None, scale=1.0, show=True, rescale=True, **kwds):
91 """Plot the ellipse in matplotlib, adding a MatplotlibInterface
92 object as the 'matplotlib' attribute of the ellipse.
93
94 Aside from those below, keyword arguments for the
95 matplotlib.patches.Patch constructor are also accepted
96 ('facecolor', 'linestyle', etc.)
97
98 Parameters
99 ----------
100 axes : `matplotlib.axes.Axes`, optional
101 Axes to plot on. Defaults to matplotlib.pyplot.gca().
102 scale : `float`, optional
103 Scale the displayed ellipse by this factor.
104 show : `bool`, optional
105 If True, update the figure automatically. Set to False for batch
106 processing.
107 rescale : `bool`, optional
108 If True, rescale the axes.
109
110 Returns
111 -------
112 interface : `EllipseMatplotlibInterface`
113 An object that allows the matplotlib patch to be updated when the
114 ellipse modified.
115 """
116 import matplotlib.pyplot
117 interface = self.MatplotlibInterface(self, scale, **kwds)
118 if axes is None:
119 axes = matplotlib.pyplot.gca()
120 axes.add_patch(interface.patch)
121 if rescale:
122 axes.autoscale_view()
123 if show:
124 axes.figure.canvas.draw()
125 return interface
126
127

◆ PYBIND11_MODULE()

lsst::afw::geom::ellipses::PYBIND11_MODULE ( _ellipses ,
mod  )

Definition at line 43 of file _ellipses.cc.

43 {
44 lsst::cpputils::python::WrapperCollection wrappers(mod, "lsst.afw.geom.ellipses");
45 wrappers.addSignatureDependency("lsst.afw.geom");
46 wrapEllipse(wrappers);
47 wrapPixelRegion(wrappers);
48 wrapBaseCore(wrappers);
49 wrapAxes(wrappers);
50 wrapRadii(wrappers);
51 wrapEllipticityBase(wrappers);
52 wrapDistortion(wrappers);
53 wrapConformalShear(wrappers);
54 wrapQuadrupole(wrappers);
55 wrapReducedShear(wrappers);
56 wrapSeparable(wrappers);
57 wrappers.finish();
58}
A helper class for subdividing pybind11 module across multiple translation units (i....
Definition python.h:242
void wrapSeparable(lsst::cpputils::python::WrapperCollection &)
Definition _separable.cc:82
void wrapConformalShear(lsst::cpputils::python::WrapperCollection &wrappers)
void wrapBaseCore(lsst::cpputils::python::WrapperCollection &wrappers)
Definition _baseCore.cc:40
void wrapDistortion(lsst::cpputils::python::WrapperCollection &wrappers)
void wrapEllipse(lsst::cpputils::python::WrapperCollection &wrappers)
Definition _ellipse.cc:44
void wrapRadii(lsst::cpputils::python::WrapperCollection &)
Definition _radii.cc:37
void wrapEllipticityBase(lsst::cpputils::python::WrapperCollection &)
void wrapQuadrupole(lsst::cpputils::python::WrapperCollection &)
void wrapReducedShear(lsst::cpputils::python::WrapperCollection &)
void wrapPixelRegion(lsst::cpputils::python::WrapperCollection &)
void wrapAxes(lsst::cpputils::python::WrapperCollection &wrappers)
Definition _axes.cc:37

◆ wrapAxes()

void lsst::afw::geom::ellipses::wrapAxes ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 37 of file _axes.cc.

37 {
38 wrappers.wrapType(
39 py::class_<Axes, std::shared_ptr<Axes>, BaseCore>(wrappers.module, "Axes"),
40 [](auto &mod, auto &cls) {
41 /* Constructors */
42 cls.def(py::init<double, double, double, bool>(), "a"_a = 1.0, "b"_a = 1.0, "theta"_a = 0.0,
43 "normalize"_a = false);
44 cls.def(py::init<Axes const &>());
45 cls.def(py::init<BaseCore const &>());
46
47 /* Operators */
48 cls.def(
49 "__eq__", [](Axes &self, Axes &other) { return self == other; }, py::is_operator());
50 cls.def(
51 "__ne__", [](Axes &self, Axes &other) { return self != other; }, py::is_operator());
52
53 /* Members */
54 cls.def("getA", &Axes::getA);
55 cls.def("setA", &Axes::setA);
56 cls.def("getB", &Axes::getB);
57 cls.def("setB", &Axes::setB);
58 cls.def("getTheta", &Axes::getTheta);
59 cls.def("setTheta", &Axes::setTheta);
60 cls.def("clone", &Axes::clone);
61 cls.def("getName", &Axes::getName);
62 cls.def("normalize", &Axes::normalize);
63 cls.def("readParameters", &Axes::readParameters);
64 cls.def("writeParameters", &Axes::writeParameters);
65 cls.def("assign", [](Axes &self, Axes &other) { self = other; });
66 cls.def("assign", [](Axes &self, BaseCore &other) { self = other; });
67 cls.def("transform", [](Axes &self, lsst::geom::LinearTransform const &t) {
68 return std::static_pointer_cast<Axes>(self.transform(t).copy());
69 });
70 cls.def("transformInPlace", [](Axes &self, lsst::geom::LinearTransform const &t) {
71 self.transform(t).inPlace();
72 });
73 });
74}
An ellipse core for the semimajor/semiminor axis and position angle parametrization (a,...
Definition Axes.h:47

◆ wrapBaseCore()

void lsst::afw::geom::ellipses::wrapBaseCore ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 40 of file _baseCore.cc.

40 {
41 wrappers.wrapType(py::class_<BaseCore, std::shared_ptr<BaseCore>>(wrappers.module, "BaseCore"),
42 [](auto &mod, auto &cls) {
43 cls.def("__eq__", &BaseCore::operator==, py::is_operator());
44 cls.def("__nq__", &BaseCore::operator!=, py::is_operator());
45 /* Members */
46 cls.def("getName", &BaseCore::getName);
47 cls.def("clone", &BaseCore::clone);
48 cls.def("normalize", &BaseCore::normalize);
49 cls.def("grow", &BaseCore::grow);
50 cls.def("scale", &BaseCore::scale);
51 cls.def("getArea", &BaseCore::getArea);
52 cls.def("getDeterminantRadius", &BaseCore::getDeterminantRadius);
53 cls.def("getTraceRadius", &BaseCore::getTraceRadius);
54 cls.def("convolve", (BaseCore::Convolution(BaseCore::*)(BaseCore const &)) &
55 BaseCore::convolve);
56 cls.def("computeDimensions", &BaseCore::computeDimensions);
57 cls.def("getParameterVector", &BaseCore::getParameterVector);
58 cls.def("setParameterVector", &BaseCore::setParameterVector);
59 });
60}

◆ wrapConformalShear()

void lsst::afw::geom::ellipses::wrapConformalShear ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 39 of file _conformalShear.cc.

39 {
40 wrappers.wrapType(py::class_<ConformalShear, detail::EllipticityBase>(wrappers.module, "ConformalShear"),
41 [](auto &mod, auto &cls) {
42 /* Constructors */
43 cls.def(py::init<std::complex<double> const &>());
44 cls.def(py::init<double, double>(), "e1"_a = 0.0, "e2"_a = 0.0);
45
46 /* Members */
47 // cls.def("dAssign", (Jacobian (ConformalShear::*)(Distortion const &))
48 // &ConformalShear::dAssign); cls.def("dAssign", (Jacobian
49 // (ConformalShear::*)(ReducedShear const &)) &ConformalShear::dAssign);
50 cls.def("getAxisRatio", &ConformalShear::getAxisRatio);
51 cls.def("normalize", &ConformalShear::normalize);
52 cls.def("getName", &ConformalShear::getName);
53 cls.def("__repr__", [](ConformalShear const &self) {
54 return py::str("{}({}, {})").format(self.getName(), self.getE1(), self.getE2());
55 });
56 });
57}

◆ wrapDistortion()

void lsst::afw::geom::ellipses::wrapDistortion ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 38 of file _distortion.cc.

38 {
39 wrappers.wrapType(py::class_<Distortion, detail::EllipticityBase>(wrappers.module, "Distortion"),
40 [](auto &mod, auto &cls) {
41 /* Constructors */
42 cls.def(py::init<std::complex<double> const &>());
43 cls.def(py::init<double, double>(), "e1"_a = 0.0, "e2"_a = 0.0);
44
45 /* Members */
46 // cls.def("dAssign", (Jacobian (Distortion::*)(Distortion const &))
47 // &Distortion::dAssign); cls.def("dAssign", (Jacobian
48 // (Distortion::*)(ReducedShear const &)) &Distortion::dAssign);
49 cls.def("getAxisRatio", &Distortion::getAxisRatio);
50 cls.def("normalize", &Distortion::normalize);
51 cls.def("getName", &Distortion::getName);
52 cls.def("__repr__", [](Distortion const &self) {
53 return py::str("{}({}, {})").format(self.getName(), self.getE1(), self.getE2());
54 });
55 });
56}

◆ wrapEllipse()

void lsst::afw::geom::ellipses::wrapEllipse ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 44 of file _ellipse.cc.

44 {
45 wrappers.wrapType(
46 py::class_<Ellipse, std::shared_ptr<Ellipse>>(wrappers.module, "Ellipse"),
47 [](auto &mod, auto &cls) {
48 /* Constructors */
49 cls.def(py::init<BaseCore const &, lsst::geom::Point2D const &>(), "core"_a,
50 "center"_a = lsst::geom::Point2D());
51 cls.def(py::init<Ellipse const &>());
52 cls.def(py::init<Ellipse::Convolution const &>());
53
54 py::implicitly_convertible<Ellipse::Convolution, Ellipse>();
55
56 /* Operators */
57
58 /* Members */
59 cls.def("getCore", [](Ellipse &ellipse) { return ellipse.getCorePtr(); });
60 cls.def("getCenter", (lsst::geom::Point2D & (Ellipse::*)()) & Ellipse::getCenter);
61 cls.def("setCenter", &Ellipse::setCenter);
62 cls.def("setCore", &Ellipse::setCore);
63 cls.def("normalize", &Ellipse::normalize);
64 cls.def("grow", &Ellipse::grow);
65 cls.def("scale", &Ellipse::scale);
66 cls.def("shift", &Ellipse::shift);
67 cls.def("getParameterVector", &Ellipse::getParameterVector);
68 cls.def("setParameterVector", &Ellipse::setParameterVector);
69 cls.def(
70 "transform",
71 [](Ellipse const &self, lsst::geom::AffineTransform const &t) -> Ellipse {
72 return self.transform(t);
73 },
74 "transform"_a);
75 cls.def("getGridTransform", [](Ellipse &self) -> lsst::geom::AffineTransform {
76 return self.getGridTransform(); // delibarate conversion to lsst::geom::AffineTransform
77 });
78 cls.def("computeBBox", &Ellipse::computeBBox);
79 });
80}
An ellipse defined by an arbitrary BaseCore and a center point.
Definition Ellipse.h:51
Transformer transform(lsst::geom::AffineTransform const &transform)
An affine coordinate transformation consisting of a linear transformation and an offset.

◆ wrapEllipticityBase()

void lsst::afw::geom::ellipses::wrapEllipticityBase ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 37 of file _ellipticityBase.cc.

37 {
38 wrappers.wrapType(py::class_<detail::EllipticityBase>(wrappers.module, "EllipticityBase"),
39 [](auto &mod, auto &cls) {
40 /* Member types and enums */
41 py::enum_<detail::EllipticityBase::ParameterEnum>(cls, "ParameterEnum")
42 .value("E1", detail::EllipticityBase::ParameterEnum::E1)
43 .value("E2", detail::EllipticityBase::ParameterEnum::E2)
44 .export_values();
45
46 /* Members */
47 cls.def("getComplex", (std::complex<double> & (detail::EllipticityBase::*)()) &
48 detail::EllipticityBase::getComplex);
49 cls.def("setComplex", &detail::EllipticityBase::setComplex);
50 cls.def("getE1", &detail::EllipticityBase::getE1);
51 cls.def("setE1", &detail::EllipticityBase::setE1);
52 cls.def("getE2", &detail::EllipticityBase::getE2);
53 cls.def("setE2", &detail::EllipticityBase::setE2);
54 cls.def("getTheta", &detail::EllipticityBase::getTheta);
55 cls.def("__str__", [](detail::EllipticityBase const &self) {
56 return py::str("({}, {})").format(self.getE1(), self.getE2());
57 });
58 });
59}

◆ wrapPixelRegion()

void lsst::afw::geom::ellipses::wrapPixelRegion ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 35 of file _pixelRegion.cc.

35 {
36 wrappers.wrapType(py::class_<PixelRegion>(wrappers.module, "PixelRegion"), [](auto &mod, auto &cls) {
37 /* Constructors */
38 cls.def(py::init<Ellipse const &>());
39
40 /* Members */
41 cls.def("getBBox", &PixelRegion::getBBox, py::return_value_policy::copy);
42 cls.def("getSpanAt", &PixelRegion::getSpanAt);
43 cls.def(
44 "__iter__",
45 [](const PixelRegion &self) { return py::make_iterator(self.begin(), self.end()); },
46 py::keep_alive<0, 1>() /* Essential: keep object alive while iterator exists */);
47 });
48}

◆ wrapQuadrupole()

void lsst::afw::geom::ellipses::wrapQuadrupole ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 39 of file _quadrupole.cc.

39 {
40 wrappers.wrapType(
41 py::class_<Quadrupole, std::shared_ptr<Quadrupole>, BaseCore>(wrappers.module, "Quadrupole"),
42 [](auto &mod, auto &cls) {
43 /* Member types and enums */
44 using Matrix = Eigen::Matrix<double, 2, 2, Eigen::DontAlign>;
45
46 /* Constructors */
47 cls.def(py::init<double, double, double, bool>(), "ixx"_a = 1.0, "iyy"_a = 1.0, "ixy"_a = 0.0,
48 "normalize"_a = false);
49 cls.def(py::init<BaseCore::ParameterVector const &, bool>(), "vector"_a,
50 "normalize"_a = false);
51 cls.def(py::init<Matrix const &, bool>(), "matrix"_a, "normalize"_a = true);
52 cls.def(py::init<Quadrupole const &>());
53 cls.def(py::init<BaseCore const &>());
54 cls.def(py::init<BaseCore::Convolution const &>());
55
56 py::implicitly_convertible<BaseCore::Convolution, Quadrupole>();
57
58 /* Operators */
59 cls.def(
60 "__eq__", [](Quadrupole &self, Quadrupole &other) { return self == other; },
61 py::is_operator());
62 cls.def(
63 "__ne__", [](Quadrupole &self, Quadrupole &other) { return self != other; },
64 py::is_operator());
65
66 /* Members */
67 cls.def("getIxx", &Quadrupole::getIxx);
68 cls.def("getIyy", &Quadrupole::getIyy);
69 cls.def("getIxy", &Quadrupole::getIxy);
70 cls.def("setIxx", &Quadrupole::setIxx);
71 cls.def("setIyy", &Quadrupole::setIyy);
72 cls.def("setIxy", &Quadrupole::setIxy);
73 cls.def("assign", [](Quadrupole &self, Quadrupole &other) { self = other; });
74 cls.def("assign", [](Quadrupole &self, BaseCore &other) { self = other; });
75 cls.def("transform", [](Quadrupole &self, lsst::geom::LinearTransform const &t) {
76 return std::static_pointer_cast<Quadrupole>(self.transform(t).copy());
77 });
78 cls.def("transformInPlace", [](Quadrupole &self, lsst::geom::LinearTransform const &t) {
79 self.transform(t).inPlace();
80 });
81 // TODO: pybind11 based on swig wrapper for now. Hopefully can be removed once pybind11 gets
82 // smarter handling of implicit conversions
83 cls.def("convolve", [](Quadrupole &self, BaseCore const &other) {
84 return Quadrupole(self.convolve(other));
85 });
86 });
87}
An ellipse core with quadrupole moments as parameters.
Definition Quadrupole.h:47

◆ wrapRadii()

void lsst::afw::geom::ellipses::wrapRadii ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 37 of file _radii.cc.

37 {
38 wrappers.wrapType(
39 py::class_<DeterminantRadius>(wrappers.module, "DeterminantRadius"), [](auto &mod, auto &cls) {
40 cls.def(py::init<double>(), "value"_a = 1.0);
41 cls.def("normalize", &DeterminantRadius::normalize);
42 cls.def_static("getName", DeterminantRadius::getName);
43 cls.def("__str__", [](DeterminantRadius const &self) { return std::to_string(self); });
44 cls.def("__repr__", [](DeterminantRadius const &self) {
45 return self.getName() + "(" + std::to_string(self) + ")";
46 });
47 });
48
49 wrappers.wrapType(py::class_<TraceRadius>(wrappers.module, "TraceRadius"), [](auto &mod, auto &cls) {
50 cls.def(py::init<double>(), "value"_a = 1.0);
51 cls.def("normalize", &TraceRadius::normalize);
52 cls.def_static("getName", TraceRadius::getName);
53 cls.def("__str__", [](TraceRadius const &self) { return std::to_string(self); });
54 cls.def("__repr__",
55 [](TraceRadius const &self) { return self.getName() + "(" + std::to_string(self) + ")"; });
56 });
57
58 wrappers.wrapType(py::class_<LogDeterminantRadius>(wrappers.module, "LogDeterminantRadius"),
59 [](auto &mod, auto &cls) {
60 cls.def(py::init<double>(), "value"_a = 0.0);
61 cls.def("normalize", &LogDeterminantRadius::normalize);
62 cls.def_static("getName", LogDeterminantRadius::getName);
63 cls.def("__str__",
64 [](LogDeterminantRadius const &self) { return std::to_string(self); });
65 cls.def("__repr__", [](LogDeterminantRadius const &self) {
66 return self.getName() + "(" + std::to_string(self) + ")";
67 });
68 });
69
70 wrappers.wrapType(py::class_<LogTraceRadius>(wrappers.module, "LogTraceRadius"),
71 [](auto &mod, auto &cls) {
72 cls.def(py::init<double>(), "value"_a = 0.0);
73 cls.def("normalize", &LogTraceRadius::normalize);
74 cls.def_static("getName", LogTraceRadius::getName);
75 cls.def("__str__", [](LogTraceRadius const &self) { return std::to_string(self); });
76 cls.def("__repr__", [](LogTraceRadius const &self) {
77 return self.getName() + "(" + std::to_string(self) + ")";
78 });
79 });
80}
The radius defined as the 4th root of the determinant of the quadrupole matrix.
Definition radii.h:57
T to_string(T... args)

◆ wrapReducedShear()

void lsst::afw::geom::ellipses::wrapReducedShear ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 38 of file _reducedShear.cc.

38 {
39 wrappers.wrapType(py::class_<ReducedShear, detail::EllipticityBase>(wrappers.module, "ReducedShear"),
40 [](auto &mod, auto &cls) {
41 /* Constructors */
42 cls.def(py::init<std::complex<double> const &>());
43 cls.def(py::init<double, double>(), "e1"_a = 0.0, "e2"_a = 0.0);
44
45 /* Members */
46 // cls.def("dAssign", (Jacobian (ReducedShear::*)(Distortion const &))
47 // &ReducedShear::dAssign); cls.def("dAssign", (Jacobian
48 // (ReducedShear::*)(ReducedShear const &)) &ReducedShear::dAssign);
49 cls.def("getAxisRatio", &ReducedShear::getAxisRatio);
50 cls.def("normalize", &ReducedShear::normalize);
51 cls.def("getName", &ReducedShear::getName);
52 cls.def("__repr__", [](ReducedShear const &self) {
53 return py::str("{}({}, {})").format(self.getName(), self.getE1(), self.getE2());
54 });
55 });
56}

◆ wrapSeparable()

void lsst::afw::geom::ellipses::wrapSeparable ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 82 of file _separable.cc.

82 {
83 declareSeparable<Distortion, DeterminantRadius>(wrappers, "DistortionDeterminantRadius");
84 declareSeparable<Distortion, TraceRadius>(wrappers, "DistortionTraceRadius");
85 declareSeparable<Distortion, LogDeterminantRadius>(wrappers, "DistortionLogDeterminantRadius");
86 declareSeparable<Distortion, LogTraceRadius>(wrappers, "DistortionLogTraceRadius");
87
88 declareSeparable<ConformalShear, DeterminantRadius>(wrappers, "ConformalShearDeterminantRadius");
89 declareSeparable<ConformalShear, TraceRadius>(wrappers, "ConformalShearTraceRadius");
90 declareSeparable<ConformalShear, LogDeterminantRadius>(wrappers, "ConformalShearLogDeterminantRadius");
91 declareSeparable<ConformalShear, LogTraceRadius>(wrappers, "ConformalShearLogTraceRadius");
92
93 declareSeparable<ReducedShear, DeterminantRadius>(wrappers, "ReducedShearDeterminantRadius");
94 declareSeparable<ReducedShear, TraceRadius>(wrappers, "ReducedShearTraceRadius");
95 declareSeparable<ReducedShear, LogDeterminantRadius>(wrappers, "ReducedShearLogDeterminantRadius");
96 declareSeparable<ReducedShear, LogTraceRadius>(wrappers, "ReducedShearLogTraceRadius");
97}

Variable Documentation

◆ MatplotlibInterface

lsst.afw.geom.ellipses.MatplotlibInterface

Definition at line 128 of file __init__.py.

◆ plot

lsst.afw.geom.ellipses.plot

Definition at line 129 of file __init__.py.

◆ Separable

Initial value:
1= {
2 (Distortion, DeterminantRadius): SeparableDistortionDeterminantRadius,
3 (Distortion, TraceRadius): SeparableDistortionTraceRadius,
4 (Distortion, LogDeterminantRadius): SeparableDistortionLogDeterminantRadius,
5 (Distortion, LogTraceRadius): SeparableDistortionLogTraceRadius,
6 (ConformalShear, DeterminantRadius): SeparableConformalShearDeterminantRadius,
7 (ConformalShear, TraceRadius): SeparableConformalShearTraceRadius,
8 (ConformalShear, LogDeterminantRadius): SeparableConformalShearLogDeterminantRadius,
9 (ConformalShear, LogTraceRadius): SeparableConformalShearLogTraceRadius
10}

Definition at line 30 of file __init__.py.