LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
lsst::afw::geom::ellipses::Axes Class Reference

An ellipse core for the semimajor/semiminor axis and position angle parametrization (a,b,theta). More...

#include <Axes.h>

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

Public Types

enum  ParameterEnum { A = 0 , B = 1 , THETA = 2 }
 
using ParameterVector = Eigen::Vector3d
 Parameter vector type.
 
using Jacobian = Eigen::Matrix3d
 Parameter Jacobian matrix type.
 

Public Member Functions

double const getA () const
 
void setA (double a)
 
double const getB () const
 
void setB (double b)
 
double const getTheta () const
 
void setTheta (double theta)
 
std::shared_ptr< Axesclone () const
 Deep copy the ellipse core.
 
std::string getName () const override
 Return a string that identifies this parametrization.
 
void normalize () override
 Put the parameters into a "standard form", if possible, and throw InvalidParameterError if they cannot be normalized.
 
void readParameters (double const *iter) override
 Return the size of the bounding box for the ellipse core.
 
void writeParameters (double *iter) const override
 Return the size of the bounding box for the ellipse core.
 
Axesoperator= (Axes const &other)
 Standard assignment.
 
Axesoperator= (Axes &&other)
 
Axesoperator= (BaseCore const &other)
 Converting assignment.
 
 Axes (double a=1.0, double b=1.0, double theta=0.0, bool normalize=false)
 Construct from parameter values.
 
 Axes (BaseCore::ParameterVector const &vector, bool normalize=false)
 Construct from a parameter vector.
 
 Axes (Axes const &other)
 Copy constructor.
 
 Axes (Axes &&other)
 
 ~Axes () override=default
 
 Axes (BaseCore const &other)
 Converting copy constructor.
 
 Axes (BaseCore::Transformer const &transformer)
 Converting copy constructor.
 
 Axes (BaseCore::Convolution const &convolution)
 Converting copy constructor.
 
void grow (double buffer)
 Increase the major and minor radii of the ellipse core by the given buffer.
 
void scale (double factor)
 Scale the size of the ellipse core by the given factor.
 
double getArea () const
 Return the area of the ellipse core.
 
double getDeterminantRadius () const
 Return the radius defined as the 4th root of the determinant of the quadrupole matrix.
 
double getTraceRadius () const
 Return the radius defined as the square root of one half the trace of the quadrupole matrix.
 
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.
 
Transformer const transform (lsst::geom::LinearTransform const &transform) 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.
 

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.
 
void _assignToQuadrupole (double &ixx, double &iyy, double &ixy) const override
 Return the size of the bounding box for the ellipse core.
 
void _assignFromQuadrupole (double ixx, double iyy, double ixy) override
 Return the size of the bounding box for the ellipse core.
 
void _assignToAxes (double &a, double &b, double &theta) const override
 Return the size of the bounding box for the ellipse core.
 
void _assignFromAxes (double a, double b, double theta) override
 Return the size of the bounding box for the ellipse core.
 
Jacobian _dAssignToQuadrupole (double &ixx, double &iyy, double &ixy) const override
 Return the size of the bounding box for the ellipse core.
 
Jacobian _dAssignFromQuadrupole (double ixx, double iyy, double ixy) override
 Return the size of the bounding box for the ellipse core.
 
Jacobian _dAssignToAxes (double &a, double &b, double &theta) const override
 Return the size of the bounding box for the ellipse core.
 
Jacobian _dAssignFromAxes (double a, double b, double theta) override
 Return the size of the bounding box for the ellipse core.
 

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

Detailed Description

An ellipse core for the semimajor/semiminor axis and position angle parametrization (a,b,theta).

Definition at line 47 of file Axes.h.

Member Typedef Documentation

◆ Jacobian

using lsst::afw::geom::ellipses::BaseCore::Jacobian = Eigen::Matrix3d
inherited

Parameter Jacobian matrix type.

Definition at line 64 of file BaseCore.h.

◆ ParameterVector

using lsst::afw::geom::ellipses::BaseCore::ParameterVector = Eigen::Vector3d
inherited

Parameter vector type.

Definition at line 63 of file BaseCore.h.

Member Enumeration Documentation

◆ ParameterEnum

Enumerator
THETA 

Definition at line 49 of file Axes.h.

Constructor & Destructor Documentation

◆ Axes() [1/7]

lsst::afw::geom::ellipses::Axes::Axes ( double a = 1.0,
double b = 1.0,
double theta = 0.0,
bool normalize = false )
inlineexplicit

Construct from parameter values.

Definition at line 91 of file Axes.h.

92 : _vector(a, b, theta) {
93 if (normalize) this->normalize();
94 }
table::Key< int > b
void normalize() override
Put the parameters into a "standard form", if possible, and throw InvalidParameterError if they canno...
Definition Axes.cc:36

◆ Axes() [2/7]

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

Construct from a parameter vector.

Definition at line 97 of file Axes.h.

97 : _vector(vector) {
98 if (normalize) this->normalize();
99 }

◆ Axes() [3/7]

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

Copy constructor.

Definition at line 102 of file Axes.h.

102: _vector(other._vector) {}

◆ Axes() [4/7]

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

Definition at line 104 of file Axes.h.

104: Axes(other) {}
Axes(double a=1.0, double b=1.0, double theta=0.0, bool normalize=false)
Construct from parameter values.
Definition Axes.h:91

◆ ~Axes()

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

◆ Axes() [5/7]

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

Converting copy constructor.

Definition at line 108 of file Axes.h.

108{ *this = other; }

◆ Axes() [6/7]

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

Converting copy constructor.

Definition at line 111 of file Axes.h.

111{ transformer.apply(*this); }

◆ Axes() [7/7]

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

Converting copy constructor.

Definition at line 114 of file Axes.h.

114{ 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 218 of file BaseCore.cc.

219 {
220 a *= a;
221 b *= b;
222 double c = std::cos(theta);
223 double s = std::sin(theta);
224 ixy = (a - b) * c * s;
225 c *= c;
226 s *= s;
227 ixx = c * a + s * b;
228 iyy = s * a + c * b;
229}
table::Key< int > a
T cos(T... args)
T sin(T... args)

◆ _assignFromAxes()

void lsst::afw::geom::ellipses::Axes::_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 92 of file Axes.cc.

92 {
93 _vector[A] = a;
94 _vector[B] = b;
95 _vector[THETA] = theta;
96}

◆ _assignFromQuadrupole()

void lsst::afw::geom::ellipses::Axes::_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 82 of file Axes.cc.

82 {
83 BaseCore::_assignQuadrupoleToAxes(ixx, iyy, ixy, _vector[A], _vector[B], _vector[THETA]);
84 normalize();
85}
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:183

◆ _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 183 of file BaseCore.cc.

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

◆ _assignToAxes()

void lsst::afw::geom::ellipses::Axes::_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 69 of file Axes.cc.

69 {
70 a = _vector[A];
71 b = _vector[B];
72 theta = _vector[THETA];
73}

◆ _assignToQuadrupole()

void lsst::afw::geom::ellipses::Axes::_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 61 of file Axes.cc.

61 {
62 BaseCore::_assignAxesToQuadrupole(_vector[A], _vector[B], _vector[THETA], ixx, iyy, ixy);
63}
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:218

◆ _clone()

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

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

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

Definition at line 117 of file Axes.h.

117{ return std::make_shared<Axes>(*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 231 of file BaseCore.cc.

232 {
233 Jacobian m;
234 m.col(0).setConstant(2 * a);
235 m.col(1).setConstant(2 * b);
236 a *= a;
237 b *= b;
238 m.col(2).setConstant(a - b);
239 double c = std::cos(theta);
240 double s = std::sin(theta);
241 double cs = c * s;
242 ixy = (a - b) * c * s;
243 c *= c;
244 s *= s;
245 ixx = c * a + s * b;
246 iyy = s * a + c * b;
247 m(0, 0) *= c;
248 m(0, 1) *= s;
249 m(0, 2) *= -2.0 * cs;
250 m(1, 0) *= s;
251 m(1, 1) *= c;
252 m(1, 2) *= 2.0 * cs;
253 m(2, 0) *= cs;
254 m(2, 1) *= -cs;
255 m(2, 2) *= (c - s);
256 return m;
257}
int m
Definition SpanSet.cc:48
Eigen::Matrix3d Jacobian
Parameter Jacobian matrix type.
Definition BaseCore.h:64

◆ _dAssignFromAxes()

BaseCore::Jacobian lsst::afw::geom::ellipses::Axes::_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 98 of file Axes.cc.

98 {
99 _vector[A] = a;
100 _vector[B] = b;
101 _vector[THETA] = theta;
102 return Jacobian::Identity();
103}

◆ _dAssignFromQuadrupole()

BaseCore::Jacobian lsst::afw::geom::ellipses::Axes::_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 87 of file Axes.cc.

87 {
88 return BaseCore::_dAssignQuadrupoleToAxes(ixx, iyy, ixy, _vector[A], _vector[B], _vector[THETA]);
89 normalize();
90}
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:193

◆ _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 193 of file BaseCore.cc.

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

◆ _dAssignToAxes()

BaseCore::Jacobian lsst::afw::geom::ellipses::Axes::_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 75 of file Axes.cc.

75 {
76 a = _vector[A];
77 b = _vector[B];
78 theta = _vector[THETA];
79 return Jacobian::Identity();
80}

◆ _dAssignToQuadrupole()

BaseCore::Jacobian lsst::afw::geom::ellipses::Axes::_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 65 of file Axes.cc.

65 {
66 return BaseCore::_dAssignAxesToQuadrupole(_vector[A], _vector[B], _vector[THETA], ixx, iyy, ixy);
67}
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:231

◆ as()

template<typename Output >
BaseCore::Converter< Output > lsst::afw::geom::ellipses::BaseCore::as ( ) const
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< Axes > lsst::afw::geom::ellipses::Axes::clone ( ) const
inline

Deep copy the ellipse core.

Definition at line 61 of file Axes.h.

61{ return std::static_pointer_cast<Axes>(_clone()); }
std::shared_ptr< BaseCore > _clone() const override
Return the size of the bounding box for the ellipse core.
Definition Axes.h:117

◆ 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 129 of file BaseCore.cc.

129 {
130 double a, b, theta;
131 _assignToAxes(a, b, theta);
132 double c = std::cos(theta);
133 double s = std::sin(theta);
134 c *= c;
135 s *= s;
136 b *= b;
137 a *= a;
138 lsst::geom::Extent2D dimensions(std::sqrt(b * s + a * c), std::sqrt(a * s + b * c));
139 dimensions *= 2;
140 return dimensions;
141}
afw::table::PointKey< int > dimensions
virtual void _assignToAxes(double &a, double &b, double &theta) const =0
Return the size of the bounding box for the ellipse core.

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

91 {
92 return BaseCore::Convolution(*this, other);
93}

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

95 {
96 return BaseCore::Convolution(const_cast<BaseCore &>(*this), other);
97}
BaseCore()=default
Return the size of the bounding box for the ellipse core.

◆ 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 168 of file BaseCore.cc.

168 {
169 if (getName() == other.getName()) {
170 this->operator=(other);
171 return Jacobian::Identity();
172 }
173 // We use Quadrupole instead of Axes here because the ambiguity of the position angle
174 // in the circular case causes some of the Jacobians to/from Axes to be undefined for
175 // exact circles. Quadrupoles don't have that problem, and the Axes-to-Axes case is
176 // handled by the above if block.
177 double ixx, iyy, ixy;
178 Jacobian rhs = other._dAssignToQuadrupole(ixx, iyy, ixy);
179 Jacobian lhs = _dAssignFromQuadrupole(ixx, iyy, ixy);
180 return lhs * rhs;
181}
virtual std::string getName() const =0
Return a string that identifies this parametrization.
virtual Jacobian _dAssignFromQuadrupole(double ixx, double iyy, double ixy)=0
Return the size of the bounding box for the ellipse core.
BaseCore & operator=(BaseCore const &other)
Set the parameters of this ellipse core from another.
Definition BaseCore.cc:155

◆ getA()

double const lsst::afw::geom::ellipses::Axes::getA ( ) const
inline

Definition at line 51 of file Axes.h.

51{ return _vector[A]; }

◆ getArea()

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

Return the area of the ellipse core.

Definition at line 111 of file BaseCore.cc.

111 {
112 double a, b, theta;
113 _assignToAxes(a, b, theta);
114 return a * b * lsst::geom::PI;
115}
double constexpr PI
The ratio of a circle's circumference to diameter.
Definition Angle.h:40

◆ getB()

double const lsst::afw::geom::ellipses::Axes::getB ( ) const
inline

Definition at line 54 of file Axes.h.

54{ return _vector[B]; }

◆ 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 117 of file BaseCore.cc.

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

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

110 {
111 return BaseCore::GridTransform(*this);
112}

◆ getName()

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

Return a string that identifies this parametrization.

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

Definition at line 34 of file Axes.cc.

34{ return "Axes"; }

◆ getParameterVector()

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

Return the core parameters as a vector.

Definition at line 143 of file BaseCore.cc.

143 {
145 writeParameters(r.data());
146 return r;
147}
virtual void writeParameters(double *iter) const =0
Return the size of the bounding box for the ellipse core.
Eigen::Vector3d ParameterVector
Parameter vector type.
Definition BaseCore.h:63

◆ getTheta()

double const lsst::afw::geom::ellipses::Axes::getTheta ( ) const
inline

Definition at line 57 of file Axes.h.

57{ return _vector[THETA]; }

◆ 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 123 of file BaseCore.cc.

123 {
124 double ixx, iyy, ixy;
125 _assignToQuadrupole(ixx, iyy, ixy);
126 return std::sqrt(0.5 * (ixx + iyy));
127}
virtual void _assignToQuadrupole(double &ixx, double &iyy, double &ixy) const =0
Return the size of the bounding box for the ellipse core.

◆ 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 95 of file BaseCore.cc.

95 {
96 double a, b, theta;
97 _assignToAxes(a, b, theta);
98 a += buffer;
99 b += buffer;
100 _assignFromAxes(a, b, theta);
101}
virtual void _assignFromAxes(double a, double b, double theta)=0
Return the size of the bounding box for the ellipse core.

◆ make() [1/6]

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

Definition at line 55 of file BaseCore.cc.

55 {
56 std::shared_ptr<BaseCore> result = getRegistryCopy(name);
57 *result = Quadrupole();
58 return result;
59}
py::object result
Definition _schema.cc:429

◆ make() [2/6]

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

Definition at line 73 of file BaseCore.cc.

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

◆ make() [3/6]

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

Definition at line 85 of file BaseCore.cc.

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

◆ 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 67 of file BaseCore.cc.

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

◆ make() [5/6]

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

Definition at line 61 of file BaseCore.cc.

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

◆ make() [6/6]

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

Definition at line 79 of file BaseCore.cc.

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

◆ normalize()

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

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

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

Definition at line 36 of file Axes.cc.

36 {
37 if (_vector[A] < 0 || _vector[B] < 0)
39 "Major and minor axes cannot be negative.");
40 if (_vector[A] < _vector[B]) {
41 std::swap(_vector[A], _vector[B]);
42 _vector[THETA] += M_PI_2;
43 }
44 if (_vector[THETA] > M_PI_2 || _vector[THETA] <= -M_PI_2) {
45 _vector[THETA] -= M_PI * std::ceil(_vector[THETA] / M_PI - 0.5);
46 }
47}
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48
#define M_PI
Definition ListMatch.cc:31
T ceil(T... args)
Reports invalid arguments.
Definition Runtime.h:66
T swap(T... args)

◆ 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); }
bool operator==(BaseCore const &other) const
Compare two ellipse cores for equality.
Definition BaseCore.cc:151

◆ operator=() [1/3]

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

Definition at line 82 of file Axes.h.

82{ return *this = other; }

◆ operator=() [2/3]

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

Standard assignment.

Definition at line 77 of file Axes.h.

77 {
78 _vector = other._vector;
79 return *this;
80 }

◆ operator=() [3/3]

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

Converting assignment.

Definition at line 85 of file Axes.h.

85 {
87 return *this;
88 }

◆ 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 151 of file BaseCore.cc.

151 {
152 return getParameterVector() == other.getParameterVector() && getName() == other.getName();
153}
ParameterVector const getParameterVector() const
Return the core parameters as a vector.
Definition BaseCore.cc:143

◆ readParameters()

void lsst::afw::geom::ellipses::Axes::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 49 of file Axes.cc.

49 {
50 setA(*iter++);
51 setB(*iter++);
52 setTheta(*iter++);
53}
void setTheta(double theta)
Definition Axes.h:58

◆ 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 91 of file BaseCore.cc.

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

◆ 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 103 of file BaseCore.cc.

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

◆ setA()

void lsst::afw::geom::ellipses::Axes::setA ( double a)
inline

Definition at line 52 of file Axes.h.

52{ _vector[A] = a; }

◆ setB()

void lsst::afw::geom::ellipses::Axes::setB ( double b)
inline

Definition at line 55 of file Axes.h.

55{ _vector[B] = b; }

◆ setParameterVector()

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

Set the core parameters from a vector.

Definition at line 149 of file BaseCore.cc.

149{ readParameters(p.data()); }
virtual void readParameters(double const *iter)=0
Return the size of the bounding box for the ellipse core.

◆ setTheta()

void lsst::afw::geom::ellipses::Axes::setTheta ( double theta)
inline

Definition at line 58 of file Axes.h.

58{ _vector[THETA] = theta; }

◆ 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::Axes::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 55 of file Axes.cc.

55 {
56 *iter++ = getA();
57 *iter++ = getB();
58 *iter++ = getTheta();
59}
double const getTheta() const
Definition Axes.h:57
double const getA() const
Definition Axes.h:51
double const getB() const
Definition Axes.h:54

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