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

An ellipse core with a complex ellipticity and radius parameterization. More...

#include <Separable.h>

Inheritance diagram for lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >:
lsst::afw::geom::ellipses::BaseCore

Public Types

enum  ParameterEnum { E1 = 0 , E2 = 1 , RADIUS = 2 }
 
using Ellipticity = Ellipticity_
 
using Radius = Radius_
 
using ParameterVector = Eigen::Vector3d
 Parameter vector type. More...
 
using Jacobian = Eigen::Matrix3d
 Parameter Jacobian matrix type. More...
 

Public Member Functions

double const getE1 () const
 
void setE1 (double e1)
 
double const getE2 () const
 
void setE2 (double e2)
 
Radius const & getRadius () const
 
RadiusgetRadius ()
 
void setRadius (double radius)
 
void setRadius (Radius const &radius)
 
Ellipticity const & getEllipticity () const
 
EllipticitygetEllipticity ()
 
std::shared_ptr< Separableclone () 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...
 
Separableoperator= (Separable const &other)
 Standard assignment. More...
 
Separableoperator= (Separable &&other)
 
Separableoperator= (BaseCore const &other)
 Converting assignment. More...
 
 Separable (double e1=0.0, double e2=0.0, double radius=Radius(), bool normalize=true)
 Construct from parameter values. More...
 
 Separable (std::complex< double > const &complex, double radius=Radius(), bool normalize=true)
 Construct from parameter values. More...
 
 Separable (Ellipticity const &ellipticity, double radius=Radius(), bool normalize=true)
 Construct from parameter values. More...
 
 Separable (BaseCore::ParameterVector const &vector, bool normalize=false)
 Construct from a parameter vector. More...
 
 Separable (Separable const &other)
 Copy constructor. More...
 
 Separable (Separable &&other)
 
 ~Separable () override=default
 
 Separable (BaseCore const &other)
 Converting copy constructor. More...
 
 Separable (BaseCore::Transformer const &transformer)
 Converting copy constructor. More...
 
 Separable (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...
 

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

template<typename Ellipticity_, typename Radius_>
class lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >

An ellipse core with a complex ellipticity and radius parameterization.

Definition at line 50 of file Separable.h.

Member Typedef Documentation

◆ Ellipticity

template<typename Ellipticity_ , typename Radius_ >
using lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::Ellipticity = Ellipticity_

Definition at line 54 of file Separable.h.

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

◆ Radius

template<typename Ellipticity_ , typename Radius_ >
using lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::Radius = Radius_

Definition at line 55 of file Separable.h.

Member Enumeration Documentation

◆ ParameterEnum

template<typename Ellipticity_ , typename Radius_ >
enum lsst::afw::geom::ellipses::Separable::ParameterEnum
Enumerator
E1 
E2 
RADIUS 

Definition at line 52 of file Separable.h.

Constructor & Destructor Documentation

◆ Separable() [1/9]

template<typename Ellipticity_ , typename Radius_ >
lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::Separable ( double  e1 = 0.0,
double  e2 = 0.0,
double  radius = Radius(),
bool  normalize = true 
)
explicit

Construct from parameter values.

Definition at line 78 of file Separable.cc.

79  : _ellipticity(e1, e2), _radius(radius) {
80  if (normalize) this->normalize();
81 }
void normalize() override
Put the parameters into a "standard form", and throw InvalidParameterError if they cannot be normaliz...
Definition: Separable.cc:44

◆ Separable() [2/9]

template<typename Ellipticity_ , typename Radius_ >
lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::Separable ( std::complex< double > const &  complex,
double  radius = Radius(),
bool  normalize = true 
)
explicit

Construct from parameter values.

Definition at line 84 of file Separable.cc.

86  : _ellipticity(complex), _radius(radius) {
87  if (normalize) this->normalize();
88 }

◆ Separable() [3/9]

template<typename Ellipticity_ , typename Radius_ >
lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::Separable ( Ellipticity const &  ellipticity,
double  radius = Radius(),
bool  normalize = true 
)
explicit

Construct from parameter values.

Definition at line 91 of file Separable.cc.

92  : _ellipticity(ellipticity), _radius(radius) {
93  if (normalize) this->normalize();
94 }

◆ Separable() [4/9]

template<typename Ellipticity_ , typename Radius_ >
lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::Separable ( BaseCore::ParameterVector const &  vector,
bool  normalize = false 
)
explicit

Construct from a parameter vector.

Definition at line 97 of file Separable.cc.

98  : _ellipticity(vector[0], vector[1]), _radius(vector[2]) {
99  if (normalize) this->normalize();
100 }

◆ Separable() [5/9]

template<typename Ellipticity_ , typename Radius_ >
lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::Separable ( Separable< Ellipticity_, Radius_ > const &  other)
inline

Copy constructor.

Definition at line 111 of file Separable.h.

111 : _ellipticity(other._ellipticity), _radius(other._radius) {}

◆ Separable() [6/9]

template<typename Ellipticity_ , typename Radius_ >
lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::Separable ( Separable< Ellipticity_, Radius_ > &&  other)
inline

Definition at line 114 of file Separable.h.

114 : Separable(other) {}
Separable(double e1=0.0, double e2=0.0, double radius=Radius(), bool normalize=true)
Construct from parameter values.
Definition: Separable.cc:78

◆ ~Separable()

template<typename Ellipticity_ , typename Radius_ >
lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::~Separable ( )
overridedefault

◆ Separable() [7/9]

template<typename Ellipticity_ , typename Radius_ >
lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::Separable ( BaseCore const &  other)
inline

Converting copy constructor.

Definition at line 119 of file Separable.h.

119 { *this = other; }

◆ Separable() [8/9]

template<typename Ellipticity_ , typename Radius_ >
lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::Separable ( BaseCore::Transformer const &  transformer)
inline

Converting copy constructor.

Definition at line 122 of file Separable.h.

122 { transformer.apply(*this); }

◆ Separable() [9/9]

template<typename Ellipticity_ , typename Radius_ >
lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::Separable ( BaseCore::Convolution const &  convolution)
inline

Converting copy constructor.

Definition at line 125 of file Separable.h.

125 { 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 > b
table::Key< int > a
T cos(T... args)
T sin(T... args)

◆ _assignFromAxes()

template<typename Ellipticity_ , typename Radius_ >
void lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::_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 152 of file Separable.cc.

152  {
153  double ixx, iyy, ixy;
154  BaseCore::_assignAxesToQuadrupole(a, b, theta, ixx, iyy, ixy);
155  this->_assignFromQuadrupole(ixx, iyy, ixy);
156 }
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
void _assignFromQuadrupole(double ixx, double iyy, double ixy) override
Return the size of the bounding box for the ellipse core.
Definition: Separable.cc:135

◆ _assignFromQuadrupole()

template<typename Ellipticity_ , typename Radius_ >
void lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::_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 135 of file Separable.cc.

135  {
136  Distortion distortion;
137  _radius.assignFromQuadrupole(ixx, iyy, ixy, distortion);
138  _ellipticity = distortion;
139 }

◆ _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()

template<typename Ellipticity_ , typename Radius_ >
void lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::_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 119 of file Separable.cc.

119  {
120  double ixx, iyy, ixy;
121  this->_assignToQuadrupole(ixx, iyy, ixy);
122  BaseCore::_assignQuadrupoleToAxes(ixx, iyy, ixy, a, b, theta);
123 }
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
void _assignToQuadrupole(double &ixx, double &iyy, double &ixy) const override
Return the size of the bounding box for the ellipse core.
Definition: Separable.cc:103

◆ _assignToQuadrupole()

template<typename Ellipticity_ , typename Radius_ >
void lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::_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 103 of file Separable.cc.

103  {
104  Distortion distortion(_ellipticity);
105  _radius.assignToQuadrupole(distortion, ixx, iyy, ixy);
106 }

◆ _clone()

template<typename Ellipticity_ , typename Radius_ >
std::shared_ptr<BaseCore> lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::_clone ( ) const
inlineoverrideprotectedvirtual

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

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

Definition at line 128 of file Separable.h.

128 { return std::make_shared<Separable>(*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()

template<typename Ellipticity_ , typename Radius_ >
BaseCore::Jacobian lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::_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 159 of file Separable.cc.

159  {
160  double ixx, iyy, ixy;
161  BaseCore::Jacobian rhs = BaseCore::_dAssignAxesToQuadrupole(a, b, theta, ixx, iyy, ixy);
162  BaseCore::Jacobian lhs = this->_dAssignFromQuadrupole(ixx, iyy, ixy);
163  return lhs * rhs;
164 }
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
Jacobian _dAssignFromQuadrupole(double ixx, double iyy, double ixy) override
Return the size of the bounding box for the ellipse core.
Definition: Separable.cc:142

◆ _dAssignFromQuadrupole()

template<typename Ellipticity_ , typename Radius_ >
BaseCore::Jacobian lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::_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 142 of file Separable.cc.

143  {
144  Distortion distortion;
145  BaseCore::Jacobian rhs = _radius.dAssignFromQuadrupole(ixx, iyy, ixy, distortion);
146  BaseCore::Jacobian lhs = BaseCore::Jacobian::Identity();
147  lhs.block<2, 2>(0, 0) = _ellipticity.dAssign(distortion);
148  return lhs * rhs;
149 }

◆ _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()

template<typename Ellipticity_ , typename Radius_ >
BaseCore::Jacobian lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::_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 126 of file Separable.cc.

127  {
128  double ixx, iyy, ixy;
129  BaseCore::Jacobian rhs = this->_dAssignToQuadrupole(ixx, iyy, ixy);
130  BaseCore::Jacobian lhs = BaseCore::_dAssignQuadrupoleToAxes(ixx, iyy, ixy, a, b, theta);
131  return lhs * rhs;
132 }
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
Jacobian _dAssignToQuadrupole(double &ixx, double &iyy, double &ixy) const override
Return the size of the bounding box for the ellipse core.
Definition: Separable.cc:109

◆ _dAssignToQuadrupole()

template<typename Ellipticity_ , typename Radius_ >
BaseCore::Jacobian lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::_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 109 of file Separable.cc.

110  {
111  Distortion distortion;
112  BaseCore::Jacobian rhs = Jacobian::Identity();
113  rhs.block<2, 2>(0, 0) = distortion.dAssign(_ellipticity);
114  BaseCore::Jacobian lhs = _radius.dAssignToQuadrupole(distortion, ixx, iyy, ixy);
115  return lhs * rhs;
116 }

◆ 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()

template<typename Ellipticity_ , typename Radius_ >
std::shared_ptr<Separable> lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::clone ( ) const
inline

Deep copy the ellipse core.

Definition at line 72 of file Separable.h.

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

◆ 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
Definition: GaussianPsf.cc:48
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

◆ 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 }
constexpr double PI
The ratio of a circle's circumference to diameter.
Definition: Angle.h:39

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

◆ getE1()

template<typename Ellipticity_ , typename Radius_ >
double const lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::getE1 ( ) const
inline

Definition at line 57 of file Separable.h.

57 { return _ellipticity.getE1(); }

◆ getE2()

template<typename Ellipticity_ , typename Radius_ >
double const lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::getE2 ( ) const
inline

Definition at line 60 of file Separable.h.

60 { return _ellipticity.getE2(); }

◆ getEllipticity() [1/2]

template<typename Ellipticity_ , typename Radius_ >
Ellipticity& lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::getEllipticity ( )
inline

Definition at line 69 of file Separable.h.

69 { return _ellipticity; }

◆ getEllipticity() [2/2]

template<typename Ellipticity_ , typename Radius_ >
Ellipticity const& lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::getEllipticity ( ) const
inline

Definition at line 68 of file Separable.h.

68 { return _ellipticity; }

◆ 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()

template<typename Ellipticity_ , typename Radius_ >
std::string lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::getName
overridevirtual

Return a string that identifies this parametrization.

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

Definition at line 39 of file Separable.cc.

39  {
40  return "Separable" + Ellipticity_::getName() + Radius_::getName();
41 }
std::string const & getName() const noexcept
Return a filter's name.
Definition: Filter.h:78

◆ 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  {
144  ParameterVector r;
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

◆ getRadius() [1/2]

template<typename Ellipticity_ , typename Radius_ >
Radius& lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::getRadius ( )
inline

Definition at line 64 of file Separable.h.

64 { return _radius; }

◆ getRadius() [2/2]

template<typename Ellipticity_ , typename Radius_ >
Radius const& lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::getRadius ( ) const
inline

Definition at line 63 of file Separable.h.

63 { return _radius; }

◆ 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
table::Key< std::string > name
Definition: Amplifier.cc:116

◆ 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()

template<typename Ellipticity_ , typename Radius_ >
void lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::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 44 of file Separable.cc.

44  {
45  _ellipticity.normalize();
46  _radius.normalize();
47 }

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

template<typename Ellipticity_ , typename Radius_ >
Separable& lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::operator= ( BaseCore const &  other)
inline

Converting assignment.

Definition at line 93 of file Separable.h.

93  {
94  BaseCore::operator=(other);
95  return *this;
96  }

◆ operator=() [2/3]

template<typename Ellipticity_ , typename Radius_ >
Separable< Ellipticity_, Radius_ > & lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::operator= ( Separable< Ellipticity_, Radius_ > &&  other)

Definition at line 73 of file Separable.cc.

74  {
75  return *this = other;
76 }

◆ operator=() [3/3]

template<typename Ellipticity_ , typename Radius_ >
Separable< Ellipticity_, Radius_ > & lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::operator= ( Separable< Ellipticity_, Radius_ > const &  other)

Standard assignment.

Definition at line 64 of file Separable.cc.

65  {
66  _ellipticity = other._ellipticity;
67  _radius = other._radius;
68  return *this;
69 }

◆ 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()

template<typename Ellipticity_ , typename Radius_ >
void lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::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 50 of file Separable.cc.

50  {
51  setE1(*iter++);
52  setE2(*iter++);
53  setRadius(*iter++);
54 }
void setRadius(double radius)
Definition: Separable.h:65

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

◆ setE1()

template<typename Ellipticity_ , typename Radius_ >
void lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::setE1 ( double  e1)
inline

Definition at line 58 of file Separable.h.

58 { _ellipticity.setE1(e1); }

◆ setE2()

template<typename Ellipticity_ , typename Radius_ >
void lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::setE2 ( double  e2)
inline

Definition at line 61 of file Separable.h.

61 { _ellipticity.setE2(e2); }

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

◆ setRadius() [1/2]

template<typename Ellipticity_ , typename Radius_ >
void lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::setRadius ( double  radius)
inline

Definition at line 65 of file Separable.h.

65 { _radius = radius; }

◆ setRadius() [2/2]

template<typename Ellipticity_ , typename Radius_ >
void lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::setRadius ( Radius const &  radius)
inline

Definition at line 66 of file Separable.h.

66 { _radius = radius; }

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

◆ 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()

template<typename Ellipticity_ , typename Radius_ >
void lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >::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 57 of file Separable.cc.

57  {
58  *iter++ = getE1();
59  *iter++ = getE2();
60  *iter++ = getRadius();
61 }
double const getE1() const
Definition: Separable.h:57
Radius const & getRadius() const
Definition: Separable.h:63
double const getE2() const
Definition: Separable.h:60

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