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
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 >
 Parameter vector type. More...
 

Public Member Functions

lsst::geom::Point2D const & getCenter () const
 Return the center point. More...
 
lsst::geom::Point2DgetCenter ()
 Return the center point. More...
 
void setCenter (lsst::geom::Point2D const &center)
 Set the center point. More...
 
BaseCore const & getCore () const
 Return the ellipse core. More...
 
BaseCoregetCore ()
 Return the ellipse core. More...
 
std::shared_ptr< BaseCore const > getCorePtr () const
 Return the ellipse core. More...
 
std::shared_ptr< BaseCoregetCorePtr ()
 Return the ellipse core. More...
 
void setCore (BaseCore const &core)
 Set the ellipse core; the type of the core is not changed. More...
 
void normalize ()
 Put the parameters in a standard form. More...
 
void grow (double buffer)
 Increase the major and minor radii of the ellipse by the given buffer. More...
 
void scale (double factor)
 Scale the size of the ellipse by the given factor. More...
 
void shift (lsst::geom::Extent2D const &offset)
 Move the ellipse center by the given offset. More...
 
ParameterVector const getParameterVector () const
 Return the ellipse parameters as a vector. More...
 
void setParameterVector (ParameterVector const &vector)
 Set the ellipse parameters from a vector. More...
 
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. More...
 
Convolution const convolve (Ellipse const &other) const
 Return the transform that maps the ellipse to the unit circle. More...
 
GridTransform const getGridTransform () const
 Return the transform that maps the ellipse to the unit circle. More...
 
lsst::geom::Box2D computeBBox () const
 Return the bounding box of the ellipse. More...
 
Ellipseoperator= (Ellipse const &other)
 Set the parameters of this ellipse from another. More...
 
Ellipseoperator= (Ellipse &&other)
 Return the transform that maps the ellipse to the unit circle. More...
 
bool operator== (Ellipse const &other) const
 Compare two ellipses for equality. More...
 
bool operator!= (Ellipse const &other) const
 Compare two ellipses for inequality. More...
 
virtual ~Ellipse ()=default
 Return the transform that maps the ellipse to the unit circle. More...
 
 Ellipse (BaseCore const &core, lsst::geom::Point2D const &center=lsst::geom::Point2D())
 Return the transform that maps the ellipse to the unit circle. More...
 
 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. More...
 
 Ellipse (Transformer const &other)
 Return the transform that maps the ellipse to the unit circle. More...
 
 Ellipse (Convolution const &other)
 Return the transform that maps the ellipse to the unit circle. More...
 
 Ellipse (Ellipse const &other)
 Return the transform that maps the ellipse to the unit circle. More...
 
 Ellipse (Ellipse &&other)
 Return the transform that maps the ellipse to the unit circle. More...
 

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>

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  {
58 }
afw::table::PointKey< int > dimensions
Definition: GaussianPsf.cc:48
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
Parameter vector type.
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.

95 { _center += offset; }

◆ 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 }
Transformer transform(lsst::geom::AffineTransform const &transform)
Definition: Transformer.h:124

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