LSST Applications g0265f82a02+0e5473021a,g02d81e74bb+0dd8ce4237,g1470d8bcf6+3ea6592b6f,g2079a07aa2+86d27d4dc4,g2305ad1205+5ca4c0b359,g295015adf3+d10818ec9d,g2a9a014e59+6f9be1b9cd,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g3ddfee87b4+703ba97ebf,g487adcacf7+4fa16da234,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+ffa42b374e,g5a732f18d5+53520f316c,g64a986408d+0dd8ce4237,g858d7b2824+0dd8ce4237,g8a8a8dda67+585e252eca,g99cad8db69+d39438377f,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+f1d96605c8,gb0e22166c9+60f28cb32d,gb6a65358fc+0e5473021a,gba4ed39666+c2a2e4ac27,gbb8dafda3b+e5339d463f,gc120e1dc64+da31e9920e,gc28159a63d+0e5473021a,gcf0d15dbbd+703ba97ebf,gdaeeff99f8+f9a426f77a,ge6526c86ff+889fc9d533,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gf18bd8381d+7268b93478,gff1a9f87cc+0dd8ce4237,w.2024.16
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::utils::python::WrapperCollection &wrappers)
 
void wrapBaseCore (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapConformalShear (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapDistortion (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapEllipse (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapPixelRegion (lsst::utils::python::WrapperCollection &)
 
void wrapRadii (lsst::utils::python::WrapperCollection &)
 
void wrapEllipticityBase (lsst::utils::python::WrapperCollection &)
 
void wrapReducedShear (lsst::utils::python::WrapperCollection &)
 
void wrapQuadrupole (lsst::utils::python::WrapperCollection &)
 
void wrapSeparable (lsst::utils::python::WrapperCollection &)
 
 PYBIND11_MODULE (_ellipses, mod)
 
template<typename Ellipticity_ , typename Radius_ >
void declareSeparable (lsst::utils::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::utils::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
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::utils::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}
void wrapSeparable(lsst::utils::python::WrapperCollection &)
Definition _separable.cc:82
void wrapPixelRegion(lsst::utils::python::WrapperCollection &)
void wrapConformalShear(lsst::utils::python::WrapperCollection &wrappers)
void wrapEllipse(lsst::utils::python::WrapperCollection &wrappers)
Definition _ellipse.cc:44
void wrapQuadrupole(lsst::utils::python::WrapperCollection &)
void wrapRadii(lsst::utils::python::WrapperCollection &)
Definition _radii.cc:37
void wrapDistortion(lsst::utils::python::WrapperCollection &wrappers)
void wrapEllipticityBase(lsst::utils::python::WrapperCollection &)
void wrapAxes(lsst::utils::python::WrapperCollection &wrappers)
Definition _axes.cc:37
void wrapReducedShear(lsst::utils::python::WrapperCollection &)
void wrapBaseCore(lsst::utils::python::WrapperCollection &wrappers)
Definition _baseCore.cc:40

◆ wrapAxes()

void lsst::afw::geom::ellipses::wrapAxes ( lsst::utils::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::utils::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::utils::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::utils::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::utils::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::utils::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::utils::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::utils::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::utils::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::utils::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::utils::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.