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
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
lsst::afw::geom::ellipses::Quadrupole Class Reference

An ellipse core with quadrupole moments as parameters. More...

#include <Quadrupole.h>

Inheritance diagram for lsst::afw::geom::ellipses::Quadrupole:
lsst::afw::geom::ellipses::BaseCore

Public Types

enum  ParameterEnum { IXX = 0, IYY = 1, IXY = 2 }
 
typedef Eigen::Matrix< double, 2, 2, Eigen::DontAlign > Matrix
 Matrix type for the matrix representation of Quadrupole parameters. More...
 
typedef Eigen::Vector3d ParameterVector
 Parameter vector type. More...
 
typedef Eigen::Matrix3d Jacobian
 Parameter Jacobian matrix type. More...
 

Public Member Functions

double const getIxx () const
 
void setIxx (double ixx)
 
double const getIyy () const
 
void setIyy (double iyy)
 
double const getIxy () const
 
void setIxy (double ixy)
 
std::shared_ptr< Quadrupoleclone () const
 Deep copy the ellipse core. More...
 
std::string getName () const override
 Return a string that identifies this parametrization. More...
 
void normalize () override
 Put the parameters into a "standard form", and throw InvalidParameterError if they cannot be normalized. More...
 
void readParameters (double const *iter) override
 Return the size of the bounding box for the ellipse core. More...
 
void writeParameters (double *iter) const override
 Return the size of the bounding box for the ellipse core. More...
 
Matrix const & getMatrix () const
 Return a 2x2 symmetric matrix of the parameters. More...
 
double getDeterminant () const
 Return the determinant of the matrix representation. More...
 
Quadrupoleoperator= (Quadrupole const &other)
 Standard assignment. More...
 
Quadrupoleoperator= (Quadrupole &&other)
 
Quadrupoleoperator= (BaseCore const &other)
 Converting assignment. More...
 
 Quadrupole (double ixx=1.0, double iyy=1.0, double ixy=0.0, bool normalize=false)
 Construct from parameter values. More...
 
 Quadrupole (BaseCore::ParameterVector const &vector, bool normalize=false)
 Construct from a parameter vector. More...
 
 Quadrupole (Matrix const &matrix, bool normalize=true)
 Construct from a 2x2 matrix. More...
 
 Quadrupole (Quadrupole const &other)
 Copy constructor. More...
 
 Quadrupole (Quadrupole &&other)
 
 ~Quadrupole () override=default
 
 Quadrupole (BaseCore const &other)
 Converting copy constructor. More...
 
 Quadrupole (BaseCore::Transformer const &transformer)
 Converting copy constructor. More...
 
 Quadrupole (BaseCore::Convolution const &convolution)
 Converting copy constructor. More...
 
void grow (double buffer)
 Increase the major and minor radii of the ellipse core by the given buffer. More...
 
void scale (double factor)
 Scale the size of the ellipse core by the given factor. More...
 
double getArea () const
 Return the area of the ellipse core. More...
 
double getDeterminantRadius () const
 Return the radius defined as the 4th root of the determinant of the quadrupole matrix. More...
 
double getTraceRadius () const
 Return the radius defined as the square root of one half the trace of the quadrupole matrix. More...
 
Coordinate transforms

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

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::LinearTransform const &transform)
 Return the transform that maps the ellipse to the unit circle. More...
 
Transformer const transform (lsst::geom::LinearTransform const &transform) 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...
 
Coordinate transforms

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

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::LinearTransform const &transform)
 Return the transform that maps the ellipse to the unit circle. More...
 
Transformer const transform (lsst::geom::LinearTransform const &transform) 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...
 
Coordinate transforms

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

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::LinearTransform const &transform)
 Return the transform that maps the ellipse to the unit circle. More...
 
Transformer const transform (lsst::geom::LinearTransform const &transform) 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...
 

Static Public Member Functions

static std::shared_ptr< BaseCoremake (std::string const &name)
 
static std::shared_ptr< BaseCoremake (std::string const &name, ParameterVector const &parameters)
 
static std::shared_ptr< BaseCoremake (std::string const &name, double v1, double v2, double v3)
 
static std::shared_ptr< BaseCoremake (std::string const &name, BaseCore const &other)
 
static std::shared_ptr< BaseCoremake (std::string const &name, Transformer const &other)
 
static std::shared_ptr< BaseCoremake (std::string const &name, Convolution const &other)
 

Protected Member Functions

std::shared_ptr< BaseCore_clone () const override
 Return the size of the bounding box for the ellipse core. More...
 
void _assignToQuadrupole (double &ixx, double &iyy, double &ixy) const override
 Return the size of the bounding box for the ellipse core. More...
 
void _assignFromQuadrupole (double ixx, double iyy, double ixy) override
 Return the size of the bounding box for the ellipse core. More...
 
void _assignToAxes (double &a, double &b, double &theta) const override
 Return the size of the bounding box for the ellipse core. More...
 
void _assignFromAxes (double a, double b, double theta) override
 Return the size of the bounding box for the ellipse core. More...
 
Jacobian _dAssignToQuadrupole (double &ixx, double &iyy, double &ixy) const override
 Return the size of the bounding box for the ellipse core. More...
 
Jacobian _dAssignFromQuadrupole (double ixx, double iyy, double ixy) override
 Return the size of the bounding box for the ellipse core. More...
 
Jacobian _dAssignToAxes (double &a, double &b, double &theta) const override
 Return the size of the bounding box for the ellipse core. More...
 
Jacobian _dAssignFromAxes (double a, double b, double theta) override
 Return the size of the bounding box for the ellipse core. More...
 

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

Convolution convolve (BaseCore const &other)
 Return the size of the bounding box for the ellipse core. More...
 
Convolution const convolve (BaseCore const &other) const
 Return the size of the bounding box for the ellipse core. More...
 
lsst::geom::Extent2D computeDimensions () const
 Return the size of the bounding box for the ellipse core. More...
 
ParameterVector const getParameterVector () const
 Return the core parameters as a vector. More...
 
void setParameterVector (ParameterVector const &vector)
 Set the core parameters from a vector. More...
 
bool operator== (BaseCore const &other) const
 Compare two ellipse cores for equality. More...
 
bool operator!= (BaseCore const &other) const
 Compare two ellipse cores for inequality. More...
 
Jacobian dAssign (BaseCore const &other)
 Assign other to this and return the derivative of the conversion, d(this)/d(other). More...
 
template<typename Output >
Converter< Output > as () const
 Convert this to the core type specified as a template parameter. More...
 
static void registerSubclass (std::shared_ptr< BaseCore > const &example)
 Return the size of the bounding box for the ellipse core. More...
 
static void _assignQuadrupoleToAxes (double ixx, double iyy, double ixy, double &a, double &b, double &theta)
 Return the size of the bounding box for the ellipse core. More...
 
static Jacobian _dAssignQuadrupoleToAxes (double ixx, double iyy, double ixy, double &a, double &b, double &theta)
 Return the size of the bounding box for the ellipse core. More...
 
static void _assignAxesToQuadrupole (double a, double b, double theta, double &ixx, double &iyy, double &ixy)
 Return the size of the bounding box for the ellipse core. More...
 
static Jacobian _dAssignAxesToQuadrupole (double a, double b, double theta, double &ixx, double &iyy, double &ixy)
 Return the size of the bounding box for the ellipse core. More...
 

Detailed Description

An ellipse core with quadrupole moments as parameters.

Definition at line 47 of file Quadrupole.h.

Member Typedef Documentation

◆ Jacobian

typedef Eigen::Matrix3d lsst::afw::geom::ellipses::BaseCore::Jacobian
inherited

Parameter Jacobian matrix type.

Definition at line 64 of file BaseCore.h.

◆ Matrix

typedef Eigen::Matrix<double, 2, 2, Eigen::DontAlign> lsst::afw::geom::ellipses::Quadrupole::Matrix

Matrix type for the matrix representation of Quadrupole parameters.

Definition at line 52 of file Quadrupole.h.

◆ ParameterVector

typedef Eigen::Vector3d lsst::afw::geom::ellipses::BaseCore::ParameterVector
inherited

Parameter vector type.

Definition at line 63 of file BaseCore.h.

Member Enumeration Documentation

◆ ParameterEnum

Enumerator
IXX 
IYY 
IXY 

Definition at line 49 of file Quadrupole.h.

49 { IXX = 0, IYY = 1, IXY = 2 };

Constructor & Destructor Documentation

◆ Quadrupole() [1/8]

lsst::afw::geom::ellipses::Quadrupole::Quadrupole ( double  ixx = 1.0,
double  iyy = 1.0,
double  ixy = 0.0,
bool  normalize = false 
)
explicit

Construct from parameter values.

Definition at line 60 of file Quadrupole.cc.

60  {
61  setIxx(ixx);
62  setIyy(iyy);
63  setIxy(ixy);
64  if (normalize) this->normalize();
65 }

◆ Quadrupole() [2/8]

lsst::afw::geom::ellipses::Quadrupole::Quadrupole ( BaseCore::ParameterVector const &  vector,
bool  normalize = false 
)
explicit

Construct from a parameter vector.

Definition at line 67 of file Quadrupole.cc.

67  {
68  setIxx(vector[IXX]);
69  setIyy(vector[IYY]);
70  setIxy(vector[IXY]);
71  if (normalize) this->normalize();
72 }

◆ Quadrupole() [3/8]

lsst::afw::geom::ellipses::Quadrupole::Quadrupole ( Matrix const &  matrix,
bool  normalize = true 
)
explicit

Construct from a 2x2 matrix.

Definition at line 74 of file Quadrupole.cc.

74  : _matrix(matrix) {
75  if (normalize) this->normalize();
76 }

◆ Quadrupole() [4/8]

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

Copy constructor.

Definition at line 110 of file Quadrupole.h.

110 : _matrix(other._matrix) {}

◆ Quadrupole() [5/8]

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

Definition at line 113 of file Quadrupole.h.

113 : Quadrupole(other) {}

◆ ~Quadrupole()

lsst::afw::geom::ellipses::Quadrupole::~Quadrupole ( )
overridedefault

◆ Quadrupole() [6/8]

lsst::afw::geom::ellipses::Quadrupole::Quadrupole ( BaseCore const &  other)
inline

Converting copy constructor.

Definition at line 118 of file Quadrupole.h.

118 { *this = other; }

◆ Quadrupole() [7/8]

lsst::afw::geom::ellipses::Quadrupole::Quadrupole ( BaseCore::Transformer const &  transformer)
inline

Converting copy constructor.

Definition at line 121 of file Quadrupole.h.

121 { transformer.apply(*this); }

◆ Quadrupole() [8/8]

lsst::afw::geom::ellipses::Quadrupole::Quadrupole ( BaseCore::Convolution const &  convolution)
inline

Converting copy constructor.

Definition at line 124 of file Quadrupole.h.

124 { convolution.apply(*this); }

Member Function Documentation

◆ _assignAxesToQuadrupole()

void lsst::afw::geom::ellipses::BaseCore::_assignAxesToQuadrupole ( double  a,
double  b,
double  theta,
double &  ixx,
double &  iyy,
double &  ixy 
)
staticprotectedinherited

Return the size of the bounding box for the ellipse core.

Definition at line 219 of file BaseCore.cc.

220  {
221  a *= a;
222  b *= b;
223  double c = std::cos(theta);
224  double s = std::sin(theta);
225  ixy = (a - b) * c * s;
226  c *= c;
227  s *= s;
228  ixx = c * a + s * b;
229  iyy = s * a + c * b;
230 }

◆ _assignFromAxes()

void lsst::afw::geom::ellipses::Quadrupole::_assignFromAxes ( double  a,
double  b,
double  theta 
)
overrideprotectedvirtual

Return the size of the bounding box for the ellipse core.

Implements lsst::afw::geom::ellipses::BaseCore.

Definition at line 112 of file Quadrupole.cc.

112  {
113  BaseCore::_assignAxesToQuadrupole(a, b, theta, _matrix(0, 0), _matrix(1, 1), _matrix(0, 1));
114  _matrix(1, 0) = _matrix(0, 1);
115 }

◆ _assignFromQuadrupole()

void lsst::afw::geom::ellipses::Quadrupole::_assignFromQuadrupole ( double  ixx,
double  iyy,
double  ixy 
)
overrideprotectedvirtual

Return the size of the bounding box for the ellipse core.

Implements lsst::afw::geom::ellipses::BaseCore.

Definition at line 99 of file Quadrupole.cc.

99  {
100  setIxx(ixx);
101  setIyy(iyy);
102  setIxy(ixy);
103 }

◆ _assignQuadrupoleToAxes()

void lsst::afw::geom::ellipses::BaseCore::_assignQuadrupoleToAxes ( double  ixx,
double  iyy,
double  ixy,
double &  a,
double &  b,
double &  theta 
)
staticprotectedinherited

Return the size of the bounding box for the ellipse core.

Definition at line 184 of file BaseCore.cc.

185  {
186  double xx_p_yy = ixx + iyy;
187  double xx_m_yy = ixx - iyy;
188  double t = std::sqrt(xx_m_yy * xx_m_yy + 4 * ixy * ixy);
189  a = std::sqrt(0.5 * (xx_p_yy + t));
190  b = std::sqrt(0.5 * (xx_p_yy - t));
191  theta = 0.5 * std::atan2(2.0 * ixy, xx_m_yy);
192 }

◆ _assignToAxes()

void lsst::afw::geom::ellipses::Quadrupole::_assignToAxes ( double &  a,
double &  b,
double &  theta 
) const
overrideprotectedvirtual

Return the size of the bounding box for the ellipse core.

Implements lsst::afw::geom::ellipses::BaseCore.

Definition at line 91 of file Quadrupole.cc.

91  {
93 }

◆ _assignToQuadrupole()

void lsst::afw::geom::ellipses::Quadrupole::_assignToQuadrupole ( double &  ixx,
double &  iyy,
double &  ixy 
) const
overrideprotectedvirtual

Return the size of the bounding box for the ellipse core.

Implements lsst::afw::geom::ellipses::BaseCore.

Definition at line 78 of file Quadrupole.cc.

78  {
79  ixx = getIxx();
80  iyy = getIyy();
81  ixy = getIxy();
82 }

◆ _clone()

std::shared_ptr<BaseCore> lsst::afw::geom::ellipses::Quadrupole::_clone ( ) const
inlineoverrideprotectedvirtual

Return the size of the bounding box for the ellipse core.

Implements lsst::afw::geom::ellipses::BaseCore.

Definition at line 127 of file Quadrupole.h.

127 { return std::make_shared<Quadrupole>(*this); }

◆ _dAssignAxesToQuadrupole()

BaseCore::Jacobian lsst::afw::geom::ellipses::BaseCore::_dAssignAxesToQuadrupole ( double  a,
double  b,
double  theta,
double &  ixx,
double &  iyy,
double &  ixy 
)
staticprotectedinherited

Return the size of the bounding box for the ellipse core.

Definition at line 232 of file BaseCore.cc.

233  {
234  Jacobian m;
235  m.col(0).setConstant(2 * a);
236  m.col(1).setConstant(2 * b);
237  a *= a;
238  b *= b;
239  m.col(2).setConstant(a - b);
240  double c = std::cos(theta);
241  double s = std::sin(theta);
242  double cs = c * s;
243  ixy = (a - b) * c * s;
244  c *= c;
245  s *= s;
246  ixx = c * a + s * b;
247  iyy = s * a + c * b;
248  m(0, 0) *= c;
249  m(0, 1) *= s;
250  m(0, 2) *= -2.0 * cs;
251  m(1, 0) *= s;
252  m(1, 1) *= c;
253  m(1, 2) *= 2.0 * cs;
254  m(2, 0) *= cs;
255  m(2, 1) *= -cs;
256  m(2, 2) *= (c - s);
257  return m;
258 }

◆ _dAssignFromAxes()

BaseCore::Jacobian lsst::afw::geom::ellipses::Quadrupole::_dAssignFromAxes ( double  a,
double  b,
double  theta 
)
overrideprotectedvirtual

Return the size of the bounding box for the ellipse core.

Implements lsst::afw::geom::ellipses::BaseCore.

Definition at line 117 of file Quadrupole.cc.

117  {
118  Jacobian r = BaseCore::_dAssignAxesToQuadrupole(a, b, theta, _matrix(0, 0), _matrix(1, 1), _matrix(0, 1));
119  _matrix(1, 0) = _matrix(0, 1);
120  return r;
121 }

◆ _dAssignFromQuadrupole()

BaseCore::Jacobian lsst::afw::geom::ellipses::Quadrupole::_dAssignFromQuadrupole ( double  ixx,
double  iyy,
double  ixy 
)
overrideprotectedvirtual

Return the size of the bounding box for the ellipse core.

Implements lsst::afw::geom::ellipses::BaseCore.

Definition at line 105 of file Quadrupole.cc.

105  {
106  setIxx(ixx);
107  setIyy(iyy);
108  setIxy(ixy);
109  return Jacobian::Identity();
110 }

◆ _dAssignQuadrupoleToAxes()

BaseCore::Jacobian lsst::afw::geom::ellipses::BaseCore::_dAssignQuadrupoleToAxes ( double  ixx,
double  iyy,
double  ixy,
double &  a,
double &  b,
double &  theta 
)
staticprotectedinherited

Return the size of the bounding box for the ellipse core.

Definition at line 194 of file BaseCore.cc.

195  {
196  double xx_p_yy = ixx + iyy;
197  double xx_m_yy = ixx - iyy;
198  double t2 = xx_m_yy * xx_m_yy + 4.0 * ixy * ixy;
199  Eigen::Vector3d dt2(2.0 * xx_m_yy, -2.0 * xx_m_yy, 8.0 * ixy);
200  double t = std::sqrt(t2);
201  a = std::sqrt(0.5 * (xx_p_yy + t));
202  b = std::sqrt(0.5 * (xx_p_yy - t));
203  theta = 0.5 * std::atan2(2.0 * ixy, xx_m_yy);
204  Jacobian m = Jacobian::Zero();
205  m(0, 0) = 0.25 * (1.0 + 0.5 * dt2[0] / t) / a;
206  m(0, 1) = 0.25 * (1.0 + 0.5 * dt2[1] / t) / a;
207  m(0, 2) = 0.25 * (0.5 * dt2[2] / t) / a;
208  m(1, 0) = 0.25 * (1.0 - 0.5 * dt2[0] / t) / b;
209  m(1, 1) = 0.25 * (1.0 - 0.5 * dt2[1] / t) / b;
210  m(1, 2) = 0.25 * (-0.5 * dt2[2] / t) / b;
211 
212  m.row(2).setConstant(1.0 / (t * t));
213  m(2, 0) *= -ixy;
214  m(2, 1) *= ixy;
215  m(2, 2) *= xx_m_yy;
216  return m;
217 }

◆ _dAssignToAxes()

BaseCore::Jacobian lsst::afw::geom::ellipses::Quadrupole::_dAssignToAxes ( double &  a,
double &  b,
double &  theta 
) const
overrideprotectedvirtual

Return the size of the bounding box for the ellipse core.

Implements lsst::afw::geom::ellipses::BaseCore.

Definition at line 95 of file Quadrupole.cc.

95  {
96  return BaseCore::_dAssignQuadrupoleToAxes(getIxx(), getIyy(), getIxy(), a, b, theta);
97 }

◆ _dAssignToQuadrupole()

BaseCore::Jacobian lsst::afw::geom::ellipses::Quadrupole::_dAssignToQuadrupole ( double &  ixx,
double &  iyy,
double &  ixy 
) const
overrideprotectedvirtual

Return the size of the bounding box for the ellipse core.

Implements lsst::afw::geom::ellipses::BaseCore.

Definition at line 84 of file Quadrupole.cc.

84  {
85  ixx = getIxx();
86  iyy = getIyy();
87  ixy = getIxy();
88  return Jacobian::Identity();
89 }

◆ as()

template<typename Output >
BaseCore::Converter< Output > lsst::afw::geom::ellipses::BaseCore::as
inlineinherited

Convert this to the core type specified as a template parameter.

Definition at line 238 of file BaseCore.h.

238  {
239  return Converter<Output>(*this);
240 }

◆ clone()

std::shared_ptr<Quadrupole> lsst::afw::geom::ellipses::Quadrupole::clone ( ) const
inline

Deep copy the ellipse core.

Definition at line 64 of file Quadrupole.h.

64 { return std::static_pointer_cast<Quadrupole>(_clone()); }

◆ computeDimensions()

lsst::geom::Extent2D lsst::afw::geom::ellipses::BaseCore::computeDimensions ( ) const
inherited

Return the size of the bounding box for the ellipse core.

Definition at line 130 of file BaseCore.cc.

130  {
131  double a, b, theta;
132  _assignToAxes(a, b, theta);
133  double c = std::cos(theta);
134  double s = std::sin(theta);
135  c *= c;
136  s *= s;
137  b *= b;
138  a *= a;
139  lsst::geom::Extent2D dimensions(std::sqrt(b * s + a * c), std::sqrt(a * s + b * c));
140  dimensions *= 2;
141  return dimensions;
142 }

◆ convolve() [1/2]

BaseCore::Convolution lsst::afw::geom::ellipses::BaseCore::convolve ( BaseCore const &  other)
inlineinherited

Return the size of the bounding box for the ellipse core.

Definition at line 93 of file Convolution.h.

93  {
94  return BaseCore::Convolution(*this, other);
95 }

◆ convolve() [2/2]

BaseCore::Convolution const lsst::afw::geom::ellipses::BaseCore::convolve ( BaseCore const &  other) const
inlineinherited

Return the size of the bounding box for the ellipse core.

Definition at line 97 of file Convolution.h.

97  {
98  return BaseCore::Convolution(const_cast<BaseCore &>(*this), other);
99 }

◆ dAssign()

BaseCore::Jacobian lsst::afw::geom::ellipses::BaseCore::dAssign ( BaseCore const &  other)
inherited

Assign other to this and return the derivative of the conversion, d(this)/d(other).

Definition at line 169 of file BaseCore.cc.

169  {
170  if (getName() == other.getName()) {
171  this->operator=(other);
172  return Jacobian::Identity();
173  }
174  // We use Quadrupole instead of Axes here because the ambiguity of the position angle
175  // in the circular case causes some of the Jacobians to/from Axes to be undefined for
176  // exact circles. Quadrupoles don't have that problem, and the Axes-to-Axes case is
177  // handled by the above if block.
178  double ixx, iyy, ixy;
179  Jacobian rhs = other._dAssignToQuadrupole(ixx, iyy, ixy);
180  Jacobian lhs = _dAssignFromQuadrupole(ixx, iyy, ixy);
181  return lhs * rhs;
182 }

◆ getArea()

double lsst::afw::geom::ellipses::BaseCore::getArea ( ) const
inherited

Return the area of the ellipse core.

Definition at line 112 of file BaseCore.cc.

112  {
113  double a, b, theta;
114  _assignToAxes(a, b, theta);
115  return a * b * lsst::geom::PI;
116 }

◆ getDeterminant()

double lsst::afw::geom::ellipses::Quadrupole::getDeterminant ( ) const
inline

Return the determinant of the matrix representation.

Definition at line 83 of file Quadrupole.h.

83 { return getIxx() * getIyy() - getIxy() * getIxy(); }

◆ getDeterminantRadius()

double lsst::afw::geom::ellipses::BaseCore::getDeterminantRadius ( ) const
inherited

Return the radius defined as the 4th root of the determinant of the quadrupole matrix.

The determinant radius is equal to the standard radius for a circle, and its square times pi is the area of the ellipse.

Definition at line 118 of file BaseCore.cc.

118  {
119  double a, b, theta;
120  _assignToAxes(a, b, theta);
121  return std::sqrt(a * b);
122 }

◆ getGridTransform()

BaseCore::GridTransform const lsst::afw::geom::ellipses::BaseCore::getGridTransform ( ) const
inlineinherited

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

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

Definition at line 120 of file GridTransform.h.

120  {
121  return BaseCore::GridTransform(*this);
122 }

◆ getIxx()

double const lsst::afw::geom::ellipses::Quadrupole::getIxx ( ) const
inline

Definition at line 54 of file Quadrupole.h.

54 { return _matrix(0, 0); }

◆ getIxy()

double const lsst::afw::geom::ellipses::Quadrupole::getIxy ( ) const
inline

Definition at line 60 of file Quadrupole.h.

60 { return _matrix(1, 0); }

◆ getIyy()

double const lsst::afw::geom::ellipses::Quadrupole::getIyy ( ) const
inline

Definition at line 57 of file Quadrupole.h.

57 { return _matrix(1, 1); }

◆ getMatrix()

Matrix const& lsst::afw::geom::ellipses::Quadrupole::getMatrix ( ) const
inline

Return a 2x2 symmetric matrix of the parameters.

Definition at line 80 of file Quadrupole.h.

80 { return _matrix; }

◆ getName()

std::string lsst::afw::geom::ellipses::Quadrupole::getName ( ) const
overridevirtual

Return a string that identifies this parametrization.

Implements lsst::afw::geom::ellipses::BaseCore.

Definition at line 34 of file Quadrupole.cc.

34 { return "Quadrupole"; }

◆ getParameterVector()

BaseCore::ParameterVector const lsst::afw::geom::ellipses::BaseCore::getParameterVector ( ) const
inherited

Return the core parameters as a vector.

Definition at line 144 of file BaseCore.cc.

144  {
145  ParameterVector r;
146  writeParameters(r.data());
147  return r;
148 }

◆ getTraceRadius()

double lsst::afw::geom::ellipses::BaseCore::getTraceRadius ( ) const
inherited

Return the radius defined as the square root of one half the trace of the quadrupole matrix.

The trace radius is equal to the standard radius for a circle.

Definition at line 124 of file BaseCore.cc.

124  {
125  double ixx, iyy, ixy;
126  _assignToQuadrupole(ixx, iyy, ixy);
127  return std::sqrt(0.5 * (ixx + iyy));
128 }

◆ grow()

void lsst::afw::geom::ellipses::BaseCore::grow ( double  buffer)
inherited

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

Definition at line 96 of file BaseCore.cc.

96  {
97  double a, b, theta;
98  _assignToAxes(a, b, theta);
99  a += buffer;
100  b += buffer;
101  _assignFromAxes(a, b, theta);
102 }

◆ make() [1/6]

std::shared_ptr< BaseCore > lsst::afw::geom::ellipses::BaseCore::make ( std::string const &  name)
staticinherited

Definition at line 56 of file BaseCore.cc.

56  {
57  std::shared_ptr<BaseCore> result = getRegistryCopy(name);
58  *result = Quadrupole();
59  return result;
60 }

◆ make() [2/6]

std::shared_ptr< BaseCore > lsst::afw::geom::ellipses::BaseCore::make ( std::string const &  name,
BaseCore const &  other 
)
staticinherited

Definition at line 74 of file BaseCore.cc.

74  {
75  std::shared_ptr<BaseCore> result = getRegistryCopy(name);
76  *result = other;
77  return result;
78 }

◆ make() [3/6]

std::shared_ptr< BaseCore > lsst::afw::geom::ellipses::BaseCore::make ( std::string const &  name,
Convolution const &  other 
)
staticinherited

Definition at line 86 of file BaseCore.cc.

86  {
87  std::shared_ptr<BaseCore> result = getRegistryCopy(name);
88  other.apply(*result);
89  return result;
90 }

◆ make() [4/6]

std::shared_ptr< BaseCore > lsst::afw::geom::ellipses::BaseCore::make ( std::string const &  name,
double  v1,
double  v2,
double  v3 
)
staticinherited

Definition at line 68 of file BaseCore.cc.

68  {
69  std::shared_ptr<BaseCore> result = getRegistryCopy(name);
70  result->setParameterVector(ParameterVector(v1, v2, v3));
71  return result;
72 }

◆ make() [5/6]

std::shared_ptr< BaseCore > lsst::afw::geom::ellipses::BaseCore::make ( std::string const &  name,
ParameterVector const &  parameters 
)
staticinherited

Definition at line 62 of file BaseCore.cc.

62  {
63  std::shared_ptr<BaseCore> result = getRegistryCopy(name);
64  result->setParameterVector(parameters);
65  return result;
66 }

◆ make() [6/6]

std::shared_ptr< BaseCore > lsst::afw::geom::ellipses::BaseCore::make ( std::string const &  name,
Transformer const &  other 
)
staticinherited

Definition at line 80 of file BaseCore.cc.

80  {
81  std::shared_ptr<BaseCore> result = getRegistryCopy(name);
82  other.apply(*result);
83  return result;
84 }

◆ normalize()

void lsst::afw::geom::ellipses::Quadrupole::normalize ( )
overridevirtual

Put the parameters into a "standard form", and throw InvalidParameterError if they cannot be normalized.

Implements lsst::afw::geom::ellipses::BaseCore.

Definition at line 36 of file Quadrupole.cc.

36  {
37  if (_matrix(0, 1) != _matrix(1, 0))
39  "Quadrupole matrix must be symmetric.");
40  if (getIxx() < 0 || getIyy() < 0)
42  "Quadrupole matrix cannot have negative diagonal elements.");
43  if (getDeterminant() < 0)
45  "Quadrupole matrix cannot have negative determinant.");
46 }

◆ operator!=()

bool lsst::afw::geom::ellipses::BaseCore::operator!= ( BaseCore const &  other) const
inlineinherited

Compare two ellipse cores for inequality.

Ellipses are only equal if they have the same type.

Definition at line 167 of file BaseCore.h.

167 { return !operator==(other); }

◆ operator=() [1/3]

Quadrupole& lsst::afw::geom::ellipses::Quadrupole::operator= ( BaseCore const &  other)
inline

Converting assignment.

Definition at line 95 of file Quadrupole.h.

95  {
97  return *this;
98  }

◆ operator=() [2/3]

Quadrupole& lsst::afw::geom::ellipses::Quadrupole::operator= ( Quadrupole &&  other)
inline

Definition at line 92 of file Quadrupole.h.

92 { return *this = other; }

◆ operator=() [3/3]

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

Standard assignment.

Definition at line 86 of file Quadrupole.h.

86  {
87  _matrix = other._matrix;
88  return *this;
89  }

◆ operator==()

bool lsst::afw::geom::ellipses::BaseCore::operator== ( BaseCore const &  other) const
inherited

Compare two ellipse cores for equality.

Ellipse cores are only equal if they have the same type.

Definition at line 152 of file BaseCore.cc.

152  {
153  return getParameterVector() == other.getParameterVector() && getName() == other.getName();
154 }

◆ readParameters()

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

Return the size of the bounding box for the ellipse core.

Implements lsst::afw::geom::ellipses::BaseCore.

Definition at line 48 of file Quadrupole.cc.

48  {
49  setIxx(*iter++);
50  setIyy(*iter++);
51  setIxy(*iter++);
52 }

◆ registerSubclass()

void lsst::afw::geom::ellipses::BaseCore::registerSubclass ( std::shared_ptr< BaseCore > const &  example)
staticprotectedinherited

Return the size of the bounding box for the ellipse core.

Definition at line 92 of file BaseCore.cc.

92  {
93  getRegistry()[example->getName()] = example;
94 }

◆ scale()

void lsst::afw::geom::ellipses::BaseCore::scale ( double  factor)
inherited

Scale the size of the ellipse core by the given factor.

Definition at line 104 of file BaseCore.cc.

104  {
105  double a, b, theta;
106  _assignToAxes(a, b, theta);
107  a *= factor;
108  b *= factor;
109  _assignFromAxes(a, b, theta);
110 }

◆ setIxx()

void lsst::afw::geom::ellipses::Quadrupole::setIxx ( double  ixx)
inline

Definition at line 55 of file Quadrupole.h.

55 { _matrix(0, 0) = ixx; }

◆ setIxy()

void lsst::afw::geom::ellipses::Quadrupole::setIxy ( double  ixy)
inline

Definition at line 61 of file Quadrupole.h.

61 { _matrix(0, 1) = _matrix(1, 0) = ixy; }

◆ setIyy()

void lsst::afw::geom::ellipses::Quadrupole::setIyy ( double  iyy)
inline

Definition at line 58 of file Quadrupole.h.

58 { _matrix(1, 1) = iyy; }

◆ setParameterVector()

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

Set the core parameters from a vector.

Definition at line 150 of file BaseCore.cc.

150 { readParameters(p.data()); }

◆ transform() [1/2]

BaseCore::Transformer lsst::afw::geom::ellipses::BaseCore::transform ( lsst::geom::LinearTransform const &  transform)
inlineinherited

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

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

Definition at line 116 of file Transformer.h.

116  {
117  return BaseCore::Transformer(*this, transform);
118 }

◆ transform() [2/2]

BaseCore::Transformer const lsst::afw::geom::ellipses::BaseCore::transform ( lsst::geom::LinearTransform const &  transform) const
inlineinherited

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

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

Definition at line 120 of file Transformer.h.

120  {
121  return BaseCore::Transformer(const_cast<BaseCore &>(*this), transform);
122 }

◆ writeParameters()

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

Return the size of the bounding box for the ellipse core.

Implements lsst::afw::geom::ellipses::BaseCore.

Definition at line 54 of file Quadrupole.cc.

54  {
55  *iter++ = getIxx();
56  *iter++ = getIyy();
57  *iter++ = getIxy();
58 }

The documentation for this class was generated from the following files:
lsst::afw::geom::ellipses::Quadrupole::getIxx
double const getIxx() const
Definition: Quadrupole.h:54
lsst::afw::geom::ellipses::Quadrupole::setIxx
void setIxx(double ixx)
Definition: Quadrupole.h:55
lsst::afw::geom::ellipses::Quadrupole::setIyy
void setIyy(double iyy)
Definition: Quadrupole.h:58
lsst::afw::geom::ellipses::BaseCore::_assignToQuadrupole
virtual void _assignToQuadrupole(double &ixx, double &iyy, double &ixy) const =0
Return the size of the bounding box for the ellipse core.
lsst::geom::PI
constexpr double PI
The ratio of a circle's circumference to diameter.
Definition: Angle.h:39
std::shared_ptr
STL class.
std::atan2
T atan2(T... args)
std::cos
T cos(T... args)
lsst::afw::geom::ellipses::BaseCore::BaseCore
BaseCore()=default
Return the size of the bounding box for the ellipse core.
lsst::afw::geom::ellipses::BaseCore::writeParameters
virtual void writeParameters(double *iter) const =0
Return the size of the bounding box for the ellipse core.
lsst::afw::geom::ellipses::BaseCore::_dAssignAxesToQuadrupole
static Jacobian _dAssignAxesToQuadrupole(double a, double b, double theta, double &ixx, double &iyy, double &ixy)
Return the size of the bounding box for the ellipse core.
Definition: BaseCore.cc:232
lsst::afw::geom::ellipses::Quadrupole::getIxy
double const getIxy() const
Definition: Quadrupole.h:60
lsst::afw::geom::ellipses::Quadrupole::Quadrupole
Quadrupole(double ixx=1.0, double iyy=1.0, double ixy=0.0, bool normalize=false)
Construct from parameter values.
Definition: Quadrupole.cc:60
lsst::afw::geom.transform.transformContinued.name
string name
Definition: transformContinued.py:32
lsst::afw::geom::ellipses::BaseCore::getParameterVector
ParameterVector const getParameterVector() const
Return the core parameters as a vector.
Definition: BaseCore.cc:144
std::sqrt
T sqrt(T... args)
lsst::afw::geom::ellipses::BaseCore::operator==
bool operator==(BaseCore const &other) const
Compare two ellipse cores for equality.
Definition: BaseCore.cc:152
lsst::afw::geom::ellipses::BaseCore::_assignToAxes
virtual void _assignToAxes(double &a, double &b, double &theta) const =0
Return the size of the bounding box for the ellipse core.
lsst::afw::geom::ellipses::Quadrupole::IXY
@ IXY
Definition: Quadrupole.h:49
lsst::afw::geom::ellipses::BaseCore::_dAssignQuadrupoleToAxes
static Jacobian _dAssignQuadrupoleToAxes(double ixx, double iyy, double ixy, double &a, double &b, double &theta)
Return the size of the bounding box for the ellipse core.
Definition: BaseCore.cc:194
lsst::afw::geom::ellipses::Quadrupole::setIxy
void setIxy(double ixy)
Definition: Quadrupole.h:61
lsst::afw::geom::ellipses::BaseCore::readParameters
virtual void readParameters(double const *iter)=0
Return the size of the bounding box for the ellipse core.
lsst::afw::geom::ellipses::Quadrupole::getIyy
double const getIyy() const
Definition: Quadrupole.h:57
other
ItemVariant const * other
Definition: Schema.cc:56
lsst::afw::geom::ellipses::Quadrupole::_clone
std::shared_ptr< BaseCore > _clone() const override
Return the size of the bounding box for the ellipse core.
Definition: Quadrupole.h:127
lsst::afw::geom::ellipses::BaseCore::ParameterVector
Eigen::Vector3d ParameterVector
Parameter vector type.
Definition: BaseCore.h:61
dimensions
afw::table::PointKey< int > dimensions
Definition: GaussianPsf.cc:49
result
py::object result
Definition: _schema.cc:429
b
table::Key< int > b
Definition: TransmissionCurve.cc:467
LSST_EXCEPT
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
lsst::afw::geom::ellipses::Quadrupole::IXX
@ IXX
Definition: Quadrupole.h:49
std::sin
T sin(T... args)
lsst::afw::geom::ellipses::BaseCore::_dAssignFromQuadrupole
virtual Jacobian _dAssignFromQuadrupole(double ixx, double iyy, double ixy)=0
Return the size of the bounding box for the ellipse core.
lsst::afw::geom::ellipses::BaseCore::Jacobian
Eigen::Matrix3d Jacobian
Parameter Jacobian matrix type.
Definition: BaseCore.h:64
lsst::pex::exceptions::InvalidParameterError
Reports invalid arguments.
Definition: Runtime.h:66
lsst::afw::geom::ellipses::BaseCore::_assignAxesToQuadrupole
static void _assignAxesToQuadrupole(double a, double b, double theta, double &ixx, double &iyy, double &ixy)
Return the size of the bounding box for the ellipse core.
Definition: BaseCore.cc:219
a
table::Key< int > a
Definition: TransmissionCurve.cc:466
lsst::afw::geom::ellipses::BaseCore::getName
virtual std::string getName() const =0
Return a string that identifies this parametrization.
lsst::afw::geom::ellipses::BaseCore::transform
Transformer transform(lsst::geom::LinearTransform const &transform)
Return the transform that maps the ellipse to the unit circle.
Definition: Transformer.h:116
lsst::afw::geom::ellipses::Quadrupole::getDeterminant
double getDeterminant() const
Return the determinant of the matrix representation.
Definition: Quadrupole.h:83
lsst::afw::geom::ellipses::Quadrupole::normalize
void normalize() override
Put the parameters into a "standard form", and throw InvalidParameterError if they cannot be normaliz...
Definition: Quadrupole.cc:36
lsst::afw::geom::ellipses::BaseCore::operator=
BaseCore & operator=(BaseCore const &other)
Set the parameters of this ellipse core from another.
Definition: BaseCore.cc:156
lsst::geom::Extent< double, 2 >
astshim.fitsChanContinued.iter
def iter(self)
Definition: fitsChanContinued.py:88
lsst::afw::geom::ellipses::BaseCore::_assignFromAxes
virtual void _assignFromAxes(double a, double b, double theta)=0
Return the size of the bounding box for the ellipse core.
lsst::afw::geom::ellipses::BaseCore::_assignQuadrupoleToAxes
static void _assignQuadrupoleToAxes(double ixx, double iyy, double ixy, double &a, double &b, double &theta)
Return the size of the bounding box for the ellipse core.
Definition: BaseCore.cc:184
lsst::afw::geom::ellipses::Quadrupole::IYY
@ IYY
Definition: Quadrupole.h:49
m
int m
Definition: SpanSet.cc:49