LSST Applications g063fba187b+cac8b7c890,g0f08755f38+6aee506743,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+b4475c5878,g1dcb35cd9c+8f9bc1652e,g20f6ffc8e0+6aee506743,g217e2c1bcf+73dee94bd0,g28da252d5a+1f19c529b9,g2bbee38e9b+3f2625acfc,g2bc492864f+3f2625acfc,g3156d2b45e+6e55a43351,g32e5bea42b+1bb94961c2,g347aa1857d+3f2625acfc,g35bb328faa+a8ce1bb630,g3a166c0a6a+3f2625acfc,g3e281a1b8c+c5dd892a6c,g3e8969e208+a8ce1bb630,g414038480c+5927e1bc1e,g41af890bb2+8a9e676b2a,g7af13505b9+809c143d88,g80478fca09+6ef8b1810f,g82479be7b0+f568feb641,g858d7b2824+6aee506743,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+2903d499ea,gb58c049af0+d64f4d3760,gc28159a63d+3f2625acfc,gcab2d0539d+b12535109e,gcf0d15dbbd+46a3f46ba9,gda6a2b7d83+46a3f46ba9,gdaeeff99f8+1711a396fd,ge79ae78c31+3f2625acfc,gef2f8181fd+0a71e47438,gf0baf85859+c1f95f4921,gfa517265be+6aee506743,gfa999e8aa5+17cd334064,w.2024.51
LSST Data Management Base Package
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
lsst::afw::geom::ellipses::Ellipse Class Reference

An ellipse defined by an arbitrary BaseCore and a center point. More...

#include <Ellipse.h>

Classes

class  GridTransform
 A temporary-only expression object representing an lsst::geom::AffineTransform that maps the Ellipse to a unit circle at the origin. More...
 
class  Transformer
 A temporary-only expression object for ellipse transformations. More...
 

Public Types

enum  ParameterEnum { X = 3 , Y = 4 }
 
using ParameterVector = Eigen::Matrix<double, 5, 1>
 Proxy return type for Ellipse::convolve().
 

Public Member Functions

lsst::geom::Point2D const & getCenter () const
 Return the center point.
 
lsst::geom::Point2DgetCenter ()
 Return the center point.
 
void setCenter (lsst::geom::Point2D const &center)
 Set the center point.
 
BaseCore const & getCore () const
 Return the ellipse core.
 
BaseCoregetCore ()
 Return the ellipse core.
 
std::shared_ptr< BaseCore const > getCorePtr () const
 Return the ellipse core.
 
std::shared_ptr< BaseCoregetCorePtr ()
 Return the ellipse core.
 
void setCore (BaseCore const &core)
 Set the ellipse core; the type of the core is not changed.
 
void normalize ()
 Put the parameters in a standard form.
 
void grow (double buffer)
 Increase the major and minor radii of the ellipse by the given buffer.
 
void scale (double factor)
 Scale the size of the ellipse by the given factor.
 
void shift (lsst::geom::Extent2D const &offset)
 Move the ellipse center by the given offset.
 
ParameterVector const getParameterVector () const
 Return the ellipse parameters as a vector.
 
void setParameterVector (ParameterVector const &vector)
 Set the ellipse parameters from a vector.
 
void readParameters (double const *iter)
 
void writeParameters (double *iter) const
 
Coordinate transforms

These member functions transform the ellipse by the given lsst::geom::AffineTransform.

The transform can be done in-place by calling inPlace() on the returned expression object, or returned as a new shared_ptr by calling copy().

Transformer transform (lsst::geom::AffineTransform const &transform)
 
Transformer const transform (lsst::geom::AffineTransform const &transform) const
 

Convolve two bivariate Gaussians defined by their 1-sigma ellipses.

Convolution convolve (Ellipse const &other)
 Return the transform that maps the ellipse to the unit circle.
 
Convolution const convolve (Ellipse const &other) const
 Return the transform that maps the ellipse to the unit circle.
 
GridTransform const getGridTransform () const
 Return the transform that maps the ellipse to the unit circle.
 
lsst::geom::Box2D computeBBox () const
 Return the bounding box of the ellipse.
 
Ellipseoperator= (Ellipse const &other)
 Set the parameters of this ellipse from another.
 
Ellipseoperator= (Ellipse &&other)
 Return the transform that maps the ellipse to the unit circle.
 
bool operator== (Ellipse const &other) const
 Compare two ellipses for equality.
 
bool operator!= (Ellipse const &other) const
 Compare two ellipses for inequality.
 
virtual ~Ellipse ()=default
 Return the transform that maps the ellipse to the unit circle.
 
 Ellipse (BaseCore const &core, lsst::geom::Point2D const &center=lsst::geom::Point2D())
 Return the transform that maps the ellipse to the unit circle.
 
 Ellipse (std::shared_ptr< BaseCore const > const &core, lsst::geom::Point2D const &center=lsst::geom::Point2D())
 Return the transform that maps the ellipse to the unit circle.
 
 Ellipse (Transformer const &other)
 Return the transform that maps the ellipse to the unit circle.
 
 Ellipse (Convolution const &other)
 Return the transform that maps the ellipse to the unit circle.
 
 Ellipse (Ellipse const &other)
 Return the transform that maps the ellipse to the unit circle.
 
 Ellipse (Ellipse &&other)
 Return the transform that maps the ellipse to the unit circle.
 

Detailed Description

An ellipse defined by an arbitrary BaseCore and a center point.

An ellipse is composed of its center coordinate and its Core - a parametrization of the ellipticity and size of the ellipse. Setting the core of an ellipse never changes the type of the contained core, it merely sets the parameters of that core by converting the parameters.

Definition at line 51 of file Ellipse.h.

Member Typedef Documentation

◆ ParameterVector

using lsst::afw::geom::ellipses::Ellipse::ParameterVector = Eigen::Matrix<double, 5, 1>

Proxy return type for Ellipse::convolve().

Parameter vector type.

Definition at line 57 of file Ellipse.h.

Member Enumeration Documentation

◆ ParameterEnum

Enumerator

Definition at line 59 of file Ellipse.h.

Constructor & Destructor Documentation

◆ ~Ellipse()

virtual lsst::afw::geom::ellipses::Ellipse::~Ellipse ( )
virtualdefault

Return the transform that maps the ellipse to the unit circle.

The returned proxy object is implicitly convertible to lsst::geom::AffineTransform and also supports differentiation.

◆ Ellipse() [1/6]

lsst::afw::geom::ellipses::Ellipse::Ellipse ( BaseCore const & core,
lsst::geom::Point2D const & center = lsst::geom::Point2D() )
inlineexplicit

Return the transform that maps the ellipse to the unit circle.

The returned proxy object is implicitly convertible to lsst::geom::AffineTransform and also supports differentiation.

Definition at line 164 of file Ellipse.h.

165 : _core(core.clone()), _center(center) {}

◆ Ellipse() [2/6]

lsst::afw::geom::ellipses::Ellipse::Ellipse ( std::shared_ptr< BaseCore const > const & core,
lsst::geom::Point2D const & center = lsst::geom::Point2D() )
inlineexplicit

Return the transform that maps the ellipse to the unit circle.

The returned proxy object is implicitly convertible to lsst::geom::AffineTransform and also supports differentiation.

Definition at line 167 of file Ellipse.h.

169 : _core(core->clone()), _center(center) {}

◆ Ellipse() [3/6]

lsst::afw::geom::ellipses::Ellipse::Ellipse ( Ellipse::Transformer const & other)
inline

Return the transform that maps the ellipse to the unit circle.

The returned proxy object is implicitly convertible to lsst::geom::AffineTransform and also supports differentiation.

Definition at line 132 of file Transformer.h.

133 : _core(other.input.getCore().transform(other.transform.getLinear()).copy()),
134 _center(other.transform(other.input.getCenter())) {}

◆ Ellipse() [4/6]

lsst::afw::geom::ellipses::Ellipse::Ellipse ( Convolution const & other)

Return the transform that maps the ellipse to the unit circle.

The returned proxy object is implicitly convertible to lsst::geom::AffineTransform and also supports differentiation.

Definition at line 75 of file Convolution.cc.

76 : _core(convolution.self.getCore().convolve(convolution.other.getCore()).copy()),
77 _center(convolution.self.getCenter() + lsst::geom::Extent2D(convolution.other.getCenter())) {}

◆ Ellipse() [5/6]

lsst::afw::geom::ellipses::Ellipse::Ellipse ( Ellipse const & other)
inline

Return the transform that maps the ellipse to the unit circle.

The returned proxy object is implicitly convertible to lsst::geom::AffineTransform and also supports differentiation.

Definition at line 174 of file Ellipse.h.

174: _core(other.getCore().clone()), _center(other.getCenter()) {}

◆ Ellipse() [6/6]

lsst::afw::geom::ellipses::Ellipse::Ellipse ( Ellipse && other)
inline

Return the transform that maps the ellipse to the unit circle.

The returned proxy object is implicitly convertible to lsst::geom::AffineTransform and also supports differentiation.

Definition at line 176 of file Ellipse.h.

176: Ellipse(other) {}
Ellipse(BaseCore const &core, lsst::geom::Point2D const &center=lsst::geom::Point2D())
Return the transform that maps the ellipse to the unit circle.
Definition Ellipse.h:164

Member Function Documentation

◆ computeBBox()

lsst::geom::Box2D lsst::afw::geom::ellipses::Ellipse::computeBBox ( ) const

Return the bounding box of the ellipse.

Definition at line 55 of file Ellipse.cc.

55 {
57 return lsst::geom::Box2D(getCenter() - dimensions * 0.5, dimensions);
58}
lsst::geom::Extent2D computeDimensions() const
Return the size of the bounding box for the ellipse core.
Definition BaseCore.cc:129
lsst::geom::Point2D const & getCenter() const
Return the center point.
Definition Ellipse.h:62
BaseCore const & getCore() const
Return the ellipse core.
Definition Ellipse.h:71
A floating-point coordinate rectangle geometry.
Definition Box.h:413

◆ convolve() [1/2]

Ellipse::Convolution lsst::afw::geom::ellipses::Ellipse::convolve ( Ellipse const & other)
inline

Return the transform that maps the ellipse to the unit circle.

The returned proxy object is implicitly convertible to lsst::geom::AffineTransform and also supports differentiation.

Definition at line 99 of file Convolution.h.

99 {
100 return Ellipse::Convolution(*this, other);
101}

◆ convolve() [2/2]

Ellipse::Convolution const lsst::afw::geom::ellipses::Ellipse::convolve ( Ellipse const & other) const
inline

Return the transform that maps the ellipse to the unit circle.

The returned proxy object is implicitly convertible to lsst::geom::AffineTransform and also supports differentiation.

Definition at line 103 of file Convolution.h.

103 {
104 return Ellipse::Convolution(const_cast<Ellipse &>(*this), other);
105}

◆ getCenter() [1/2]

lsst::geom::Point2D & lsst::afw::geom::ellipses::Ellipse::getCenter ( )
inline

Return the center point.

Definition at line 65 of file Ellipse.h.

65{ return _center; }

◆ getCenter() [2/2]

lsst::geom::Point2D const & lsst::afw::geom::ellipses::Ellipse::getCenter ( ) const
inline

Return the center point.

Definition at line 62 of file Ellipse.h.

62{ return _center; }

◆ getCore() [1/2]

BaseCore & lsst::afw::geom::ellipses::Ellipse::getCore ( )
inline

Return the ellipse core.

Definition at line 74 of file Ellipse.h.

74{ return *_core; }

◆ getCore() [2/2]

BaseCore const & lsst::afw::geom::ellipses::Ellipse::getCore ( ) const
inline

Return the ellipse core.

Definition at line 71 of file Ellipse.h.

71{ return *_core; }

◆ getCorePtr() [1/2]

std::shared_ptr< BaseCore > lsst::afw::geom::ellipses::Ellipse::getCorePtr ( )
inline

Return the ellipse core.

Definition at line 80 of file Ellipse.h.

80{ return _core; }

◆ getCorePtr() [2/2]

std::shared_ptr< BaseCore const > lsst::afw::geom::ellipses::Ellipse::getCorePtr ( ) const
inline

Return the ellipse core.

Definition at line 77 of file Ellipse.h.

77{ return _core; }

◆ getGridTransform()

Ellipse::GridTransform const lsst::afw::geom::ellipses::Ellipse::getGridTransform ( ) const
inline

Return the transform that maps the ellipse to the unit circle.

The returned proxy object is implicitly convertible to lsst::geom::AffineTransform and also supports differentiation.

Definition at line 114 of file GridTransform.h.

114 {
115 return Ellipse::GridTransform(*this);
116}

◆ getParameterVector()

Ellipse::ParameterVector const lsst::afw::geom::ellipses::Ellipse::getParameterVector ( ) const

Return the ellipse parameters as a vector.

Definition at line 31 of file Ellipse.cc.

31 {
33 r.head<3>() = _core->getParameterVector();
34 r.tail<2>() = _center.asEigen();
35 return r;
36}
Eigen::Matrix< double, 5, 1 > ParameterVector
Proxy return type for Ellipse::convolve().
Definition Ellipse.h:57
EigenVector const & asEigen() const noexcept(IS_ELEMENT_NOTHROW_COPYABLE)
Return a fixed-size Eigen representation of the coordinate object.

◆ grow()

void lsst::afw::geom::ellipses::Ellipse::grow ( double buffer)
inline

Increase the major and minor radii of the ellipse by the given buffer.

Definition at line 89 of file Ellipse.h.

89{ _core->grow(buffer); }

◆ normalize()

void lsst::afw::geom::ellipses::Ellipse::normalize ( )
inline

Put the parameters in a standard form.

Definition at line 86 of file Ellipse.h.

86{ _core->normalize(); }

◆ operator!=()

bool lsst::afw::geom::ellipses::Ellipse::operator!= ( Ellipse const & other) const
inline

Compare two ellipses for inequality.

Ellipses are only equal if they have the same Core types.

Definition at line 160 of file Ellipse.h.

160{ return !operator==(other); }
bool operator==(Ellipse const &other) const
Compare two ellipses for equality.
Definition Ellipse.h:151

◆ operator=() [1/2]

Ellipse & lsst::afw::geom::ellipses::Ellipse::operator= ( Ellipse && other)

Return the transform that maps the ellipse to the unit circle.

The returned proxy object is implicitly convertible to lsst::geom::AffineTransform and also supports differentiation.

Definition at line 66 of file Ellipse.cc.

66{ return *this = other; }

◆ operator=() [2/2]

Ellipse & lsst::afw::geom::ellipses::Ellipse::operator= ( Ellipse const & other)

Set the parameters of this ellipse from another.

This does not change the parametrization of the ellipse.

Definition at line 60 of file Ellipse.cc.

60 {
61 _center = other.getCenter();
62 *_core = other.getCore();
63 return *this;
64}

◆ operator==()

bool lsst::afw::geom::ellipses::Ellipse::operator== ( Ellipse const & other) const
inline

Compare two ellipses for equality.

Ellipses are only equal if they have the same Core types.

Definition at line 151 of file Ellipse.h.

151 {
152 return getCenter() == other.getCenter() && getCore() == other.getCore();
153 }

◆ readParameters()

void lsst::afw::geom::ellipses::Ellipse::readParameters ( double const * iter)

Definition at line 43 of file Ellipse.cc.

43 {
44 _core->readParameters(iter);
45 _center.setX(iter[3]);
46 _center.setY(iter[4]);
47}

◆ scale()

void lsst::afw::geom::ellipses::Ellipse::scale ( double factor)
inline

Scale the size of the ellipse by the given factor.

Definition at line 92 of file Ellipse.h.

92{ _core->scale(factor); }

◆ setCenter()

void lsst::afw::geom::ellipses::Ellipse::setCenter ( lsst::geom::Point2D const & center)
inline

Set the center point.

Definition at line 68 of file Ellipse.h.

68{ _center = center; }

◆ setCore()

void lsst::afw::geom::ellipses::Ellipse::setCore ( BaseCore const & core)
inline

Set the ellipse core; the type of the core is not changed.

Definition at line 83 of file Ellipse.h.

83{ *_core = core; }

◆ setParameterVector()

void lsst::afw::geom::ellipses::Ellipse::setParameterVector ( Ellipse::ParameterVector const & vector)

Set the ellipse parameters from a vector.

Definition at line 38 of file Ellipse.cc.

38 {
39 _core->setParameterVector(vector.head<3>());
40 _center = lsst::geom::Point2D(vector.tail<2>());
41}
Point< double, 2 > Point2D
Definition Point.h:324

◆ shift()

void lsst::afw::geom::ellipses::Ellipse::shift ( lsst::geom::Extent2D const & offset)
inline

Move the ellipse center by the given offset.

Definition at line 95 of file Ellipse.h.

◆ transform() [1/2]

Ellipse::Transformer lsst::afw::geom::ellipses::Ellipse::transform ( lsst::geom::AffineTransform const & transform)
inline

Definition at line 124 of file Transformer.h.

124 {
125 return Ellipse::Transformer(*this, transform);
126}

◆ transform() [2/2]

Ellipse::Transformer const lsst::afw::geom::ellipses::Ellipse::transform ( lsst::geom::AffineTransform const & transform) const
inline

Definition at line 128 of file Transformer.h.

128 {
129 return Ellipse::Transformer(const_cast<Ellipse &>(*this), transform);
130}

◆ writeParameters()

void lsst::afw::geom::ellipses::Ellipse::writeParameters ( double * iter) const

Definition at line 49 of file Ellipse.cc.

49 {
50 _core->writeParameters(iter);
51 iter[3] = _center.getX();
52 iter[4] = _center.getY();
53}

The documentation for this class was generated from the following files: