LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Namespaces | Classes | Typedefs | Functions | Variables
lsst::afw::geom::ellipses Namespace Reference

Namespaces

 _axes
 
 _ellipse
 
 _quadrupole
 
 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  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  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  Separable
 An ellipse core with a complex ellipticity and radius parameterization. More...
 
class  DeterminantRadius
 The radius defined as the 4th root of the determinant of the quadrupole matrix. More...
 
class  TraceRadius
 The radius defined as \(\sqrt{0.5(I_{xx} + I_{yy})}\). More...
 
class  LogDeterminantRadius
 The natural logarithm of the DeterminantRadius. More...
 
class  LogTraceRadius
 The natural logarithm of the TraceRadius. More...
 
class  ReducedShear
 A complex ellipticity with magnitude \(|e| = \frac{a-b}{a+b} \). More...
 
class  EllipseMatplotlibInterface
 
class  EllipseHorizontalLineIntersection
 

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

def 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

dictionary Separable
 

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  {
44  using Class = Separable<Ellipticity_, Radius_>;
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 }
table::Key< int > transform
A 2D linear coordinate transformation.
T copy(T... args)

◆ Ellipse_plot()

def 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.

90 def 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 
128 Ellipse.MatplotlibInterface = EllipseMatplotlibInterface
129 Ellipse.plot = Ellipse_plot
def Ellipse_plot(self, axes=None, scale=1.0, show=True, rescale=True, **kwds)
Definition: __init__.py:90

◆ 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 &)
Definition: _pixelRegion.cc:35
void wrapConformalShear(lsst::utils::python::WrapperCollection &wrappers)
void wrapEllipse(lsst::utils::python::WrapperCollection &wrappers)
Definition: _ellipse.cc:44
void wrapQuadrupole(lsst::utils::python::WrapperCollection &)
Definition: _quadrupole.cc:39
void wrapRadii(lsst::utils::python::WrapperCollection &)
Definition: _radii.cc:37
void wrapDistortion(lsst::utils::python::WrapperCollection &wrappers)
Definition: _distortion.cc:38
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 }
std::string const & getName() const noexcept
Return a filter's name.
Definition: Filter.h:78

◆ 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 affine coordinate transformation consisting of a linear transformation and an offset.
def scale(algorithm, min, max=None, frame=None)
Definition: ds9.py:108

◆ 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 }
void convolve(OutImageT &convolvedImage, InImageT const &inImage, KernelT const &kernel, ConvolutionControl const &convolutionControl=ConvolutionControl())
Convolve an Image or MaskedImage with a Kernel, setting pixels of an existing output image.

◆ 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 }
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

◆ 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.