LSSTApplications  19.0.0-10-g920eed2,19.0.0-11-g48a0200+2,19.0.0-18-gfc4e62b+11,19.0.0-2-g3b2f90d+2,19.0.0-2-gd671419+5,19.0.0-20-g5a5a17ab+9,19.0.0-21-g2644856+11,19.0.0-22-gc5dc5b1+6,19.0.0-23-gdc29a50+3,19.0.0-24-g923e380+11,19.0.0-25-g6c8df7140,19.0.0-28-g9b887e2,19.0.0-3-g2b32d65+5,19.0.0-3-g8227491+10,19.0.0-3-g9c54d0d+10,19.0.0-3-gca68e65+6,19.0.0-3-gcfc5f51+5,19.0.0-3-ge110943+9,19.0.0-3-ge74d124,19.0.0-3-gfe04aa6+11,19.0.0-4-g06f5963+5,19.0.0-4-g3d16501+11,19.0.0-4-g4a9c019+5,19.0.0-4-g5a8b323,19.0.0-4-g66397f0+1,19.0.0-4-g8278b9b+1,19.0.0-4-g8557e14,19.0.0-4-g8964aba+11,19.0.0-4-ge404a01+10,19.0.0-5-g40f3a5a,19.0.0-5-g4db63b3,19.0.0-5-gfb03ce7+11,19.0.0-6-gbaebbfb+10,19.0.0-60-gafafd468+11,19.0.0-67-g3ab1e6e,19.0.0-7-g039c0b5+9,19.0.0-7-gbea9075+4,19.0.0-7-gc567de5+11,19.0.0-8-g3a3ce09+6,19.0.0-9-g463f923+10,w.2020.21
LSSTDataManagementBasePackage
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 }
 
typedef Eigen::Matrix< double, 5, 1 > ParameterVector
 Proxy return type for Ellipse::convolve(). 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

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

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.

59 { X = 3, Y = 4 };

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) {}

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.

◆ 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 101 of file Convolution.h.

101  {
102  return Ellipse::Convolution(*this, other);
103 }

◆ 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 105 of file Convolution.h.

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

◆ 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 124 of file GridTransform.h.

124  {
125  return Ellipse::GridTransform(*this);
126 }

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

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

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

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

◆ 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:
lsst::afw::geom::ellipses::Ellipse::Y
@ Y
Definition: Ellipse.h:59
lsst::afw::geom::ellipses::Ellipse::ParameterVector
Eigen::Matrix< double, 5, 1 > ParameterVector
Proxy return type for Ellipse::convolve().
Definition: Ellipse.h:55
lsst::afw::geom::ellipses::Ellipse::operator==
bool operator==(Ellipse const &other) const
Compare two ellipses for equality.
Definition: Ellipse.h:151
lsst::afw::geom::ellipses::BaseCore::computeDimensions
lsst::geom::Extent2D computeDimensions() const
Return the size of the bounding box for the ellipse core.
Definition: BaseCore.cc:130
lsst::geom::Point2D
Point< double, 2 > Point2D
Definition: Point.h:324
lsst::afw::geom::ellipses::Ellipse::transform
Transformer transform(lsst::geom::AffineTransform const &transform)
Definition: Transformer.h:124
lsst::afw::geom::ellipses::Ellipse::getCenter
lsst::geom::Point2D const & getCenter() const
Return the center point.
Definition: Ellipse.h:62
other
ItemVariant const * other
Definition: Schema.cc:56
dimensions
afw::table::PointKey< int > dimensions
Definition: GaussianPsf.cc:49
lsst::afw::geom::ellipses::Ellipse::X
@ X
Definition: Ellipse.h:59
lsst::afw::geom::ellipses::Ellipse::getCore
BaseCore const & getCore() const
Return the ellipse core.
Definition: Ellipse.h:71
lsst::geom::Box2D
A floating-point coordinate rectangle geometry.
Definition: Box.h:413
lsst::geom::Extent< double, 2 >
astshim.fitsChanContinued.iter
def iter(self)
Definition: fitsChanContinued.py:88
lsst::afw::geom::ellipses::Ellipse::Ellipse
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