LSSTApplications  18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
lsst::afw::geom::ellipses::BaseCore Class Referenceabstract

A base class for parametrizations of the "core" of an ellipse - the ellipticity and size. More...

#include <BaseCore.h>

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

Classes

struct  Converter
 
class  Convolution
 A temporary-only expression object for ellipse core convolution. More...
 
class  GridTransform
 A temporary-only expression object representing an lsst::geom::LinearTransform that maps the ellipse core to a unit circle. More...
 
struct  Registrar
 
class  Transformer
 A temporary-only expression object for ellipse core transformations. More...
 

Public Types

typedef Eigen::Vector3d ParameterVector
 Parameter vector type. More...
 
typedef Eigen::Matrix3d Jacobian
 Parameter Jacobian matrix type. More...
 

Public Member Functions

virtual std::string getName () const =0
 Return a string that identifies this parametrization. More...
 
std::shared_ptr< BaseCoreclone () const
 Deep-copy the Core. More...
 
virtual void normalize ()=0
 Put the parameters into a "standard form", and throw InvalidParameterError if they cannot be normalized. 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...
 
GridTransform const getGridTransform () const
 Return the transform that maps the ellipse to the unit circle. More...
 
lsst::geom::Extent2D computeDimensions () const
 Return the size of the bounding box for the ellipse core. More...
 
virtual void readParameters (double const *iter)=0
 
virtual void writeParameters (double *iter) const =0
 
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...
 
BaseCoreoperator= (BaseCore const &other)
 Set the parameters of this ellipse core from another. More...
 
BaseCoreoperator= (BaseCore &&other)
 
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...
 
virtual ~BaseCore ()=default
 
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)
 
Transformer const transform (lsst::geom::LinearTransform const &transform) const
 
Convolve two bivariate Gaussians defined by their 1-sigma ellipses.
Convolution convolve (BaseCore const &other)
 
Convolution const convolve (BaseCore const &other) const
 

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

 BaseCore ()=default
 
virtual std::shared_ptr< BaseCore_clone () const =0
 
virtual void _assignToQuadrupole (double &ixx, double &iyy, double &ixy) const =0
 
virtual void _assignFromQuadrupole (double ixx, double iyy, double ixy)=0
 
virtual void _assignToAxes (double &a, double &b, double &theta) const =0
 
virtual void _assignFromAxes (double a, double b, double theta)=0
 
virtual Jacobian _dAssignToQuadrupole (double &ixx, double &iyy, double &ixy) const =0
 
virtual Jacobian _dAssignFromQuadrupole (double ixx, double iyy, double ixy)=0
 
virtual Jacobian _dAssignToAxes (double &a, double &b, double &theta) const =0
 
virtual Jacobian _dAssignFromAxes (double a, double b, double theta)=0
 

Static Protected Member Functions

static void registerSubclass (std::shared_ptr< BaseCore > const &example)
 
static void _assignQuadrupoleToAxes (double ixx, double iyy, double ixy, double &a, double &b, double &theta)
 
static Jacobian _dAssignQuadrupoleToAxes (double ixx, double iyy, double ixy, double &a, double &b, double &theta)
 
static void _assignAxesToQuadrupole (double a, double b, double theta, double &ixx, double &iyy, double &ixy)
 
static Jacobian _dAssignAxesToQuadrupole (double a, double b, double theta, double &ixx, double &iyy, double &ixy)
 

Friends

class Parametric
 

Detailed Description

A base class for parametrizations of the "core" of an ellipse - the ellipticity and size.

A subclass of BaseCore provides a particular interpretation of the three pointing point values that define an ellipse's size and ellipticity (including position angle). All core subclasses are implicitly convertible and can be assigned to from any other core.

Definition at line 55 of file BaseCore.h.

Member Typedef Documentation

◆ Jacobian

Parameter Jacobian matrix type.

Definition at line 64 of file BaseCore.h.

◆ ParameterVector

Parameter vector type.

Definition at line 61 of file BaseCore.h.

Constructor & Destructor Documentation

◆ ~BaseCore()

virtual lsst::afw::geom::ellipses::BaseCore::~BaseCore ( )
virtualdefault

◆ BaseCore()

lsst::afw::geom::ellipses::BaseCore::BaseCore ( )
protecteddefault

Member Function Documentation

◆ _assignAxesToQuadrupole()

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

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

◆ _assignFromAxes()

virtual void lsst::afw::geom::ellipses::BaseCore::_assignFromAxes ( double  a,
double  b,
double  theta 
)
protectedpure virtual

◆ _assignFromQuadrupole()

virtual void lsst::afw::geom::ellipses::BaseCore::_assignFromQuadrupole ( double  ixx,
double  iyy,
double  ixy 
)
protectedpure virtual

◆ _assignQuadrupoleToAxes()

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

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 }
table::Key< int > b
table::Key< int > a
T atan2(T... args)
T sqrt(T... args)

◆ _assignToAxes()

virtual void lsst::afw::geom::ellipses::BaseCore::_assignToAxes ( double &  a,
double &  b,
double &  theta 
) const
protectedpure virtual

◆ _assignToQuadrupole()

virtual void lsst::afw::geom::ellipses::BaseCore::_assignToQuadrupole ( double &  ixx,
double &  iyy,
double &  ixy 
) const
protectedpure virtual

◆ _clone()

virtual std::shared_ptr<BaseCore> lsst::afw::geom::ellipses::BaseCore::_clone ( ) const
protectedpure virtual

◆ _dAssignAxesToQuadrupole()

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

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 }
table::Key< int > b
table::Key< int > a
T sin(T... args)
T cos(T... args)
Eigen::Matrix3d Jacobian
Parameter Jacobian matrix type.
Definition: BaseCore.h:64
int m
Definition: SpanSet.cc:49

◆ _dAssignFromAxes()

virtual Jacobian lsst::afw::geom::ellipses::BaseCore::_dAssignFromAxes ( double  a,
double  b,
double  theta 
)
protectedpure virtual

◆ _dAssignFromQuadrupole()

virtual Jacobian lsst::afw::geom::ellipses::BaseCore::_dAssignFromQuadrupole ( double  ixx,
double  iyy,
double  ixy 
)
protectedpure virtual

◆ _dAssignQuadrupoleToAxes()

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

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 }
table::Key< int > b
table::Key< int > a
T atan2(T... args)
Eigen::Matrix3d Jacobian
Parameter Jacobian matrix type.
Definition: BaseCore.h:64
int m
Definition: SpanSet.cc:49
T sqrt(T... args)

◆ _dAssignToAxes()

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

◆ _dAssignToQuadrupole()

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

◆ as()

template<typename Output >
BaseCore::Converter< Output > lsst::afw::geom::ellipses::BaseCore::as ( ) const
inline

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<BaseCore> lsst::afw::geom::ellipses::BaseCore::clone ( ) const
inline

Deep-copy the Core.

Definition at line 82 of file BaseCore.h.

82 { return _clone(); }
virtual std::shared_ptr< BaseCore > _clone() const =0

◆ computeDimensions()

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

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 }
table::Key< int > b
table::Key< int > a
T sin(T... args)
afw::table::PointKey< int > dimensions
Definition: GaussianPsf.cc:49
T cos(T... args)
virtual void _assignToAxes(double &a, double &b, double &theta) const =0
T sqrt(T... args)

◆ convolve() [1/2]

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

Definition at line 93 of file Convolution.h.

93  {
94  return BaseCore::Convolution(*this, other);
95 }
ItemVariant const * other
Definition: Schema.cc:56

◆ convolve() [2/2]

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

Definition at line 97 of file Convolution.h.

97  {
98  return BaseCore::Convolution(const_cast<BaseCore &>(*this), other);
99 }
ItemVariant const * other
Definition: Schema.cc:56

◆ dAssign()

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

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 }
ItemVariant const * other
Definition: Schema.cc:56
BaseCore & operator=(BaseCore const &other)
Set the parameters of this ellipse core from another.
Definition: BaseCore.cc:156
Eigen::Matrix3d Jacobian
Parameter Jacobian matrix type.
Definition: BaseCore.h:64
virtual std::string getName() const =0
Return a string that identifies this parametrization.
virtual Jacobian _dAssignFromQuadrupole(double ixx, double iyy, double ixy)=0

◆ getArea()

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

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 }
table::Key< int > b
table::Key< int > a
virtual void _assignToAxes(double &a, double &b, double &theta) const =0
double constexpr PI
The ratio of a circle&#39;s circumference to diameter.
Definition: Angle.h:39

◆ getDeterminantRadius()

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

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 }
table::Key< int > b
table::Key< int > a
virtual void _assignToAxes(double &a, double &b, double &theta) const =0
T sqrt(T... args)

◆ getGridTransform()

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

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 }

◆ getName()

virtual std::string lsst::afw::geom::ellipses::BaseCore::getName ( ) const
pure virtual

◆ getParameterVector()

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

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 }
Eigen::Vector3d ParameterVector
Parameter vector type.
Definition: BaseCore.h:61
virtual void writeParameters(double *iter) const =0

◆ getTraceRadius()

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

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 }
T sqrt(T... args)
virtual void _assignToQuadrupole(double &ixx, double &iyy, double &ixy) const =0

◆ grow()

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

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 }
table::Key< int > b
table::Key< int > a
virtual void _assignFromAxes(double a, double b, double theta)=0
virtual void _assignToAxes(double &a, double &b, double &theta) const =0

◆ make() [1/6]

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

Definition at line 56 of file BaseCore.cc.

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

◆ make() [2/6]

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

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 }
py::object result
Definition: _schema.cc:429

◆ make() [3/6]

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

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 }
Eigen::Vector3d ParameterVector
Parameter vector type.
Definition: BaseCore.h:61
py::object result
Definition: _schema.cc:429

◆ make() [4/6]

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

Definition at line 74 of file BaseCore.cc.

74  {
75  std::shared_ptr<BaseCore> result = getRegistryCopy(name);
76  *result = other;
77  return result;
78 }
ItemVariant const * other
Definition: Schema.cc:56
py::object result
Definition: _schema.cc:429

◆ make() [5/6]

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

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 }
ItemVariant const * other
Definition: Schema.cc:56
py::object result
Definition: _schema.cc:429

◆ make() [6/6]

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

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 }
ItemVariant const * other
Definition: Schema.cc:56
py::object result
Definition: _schema.cc:429

◆ normalize()

virtual void lsst::afw::geom::ellipses::BaseCore::normalize ( )
pure virtual

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

Implemented in lsst::afw::geom::ellipses::Separable< Ellipticity_, Radius_ >, lsst::afw::geom::ellipses::Quadrupole, and lsst::afw::geom::ellipses::Axes.

◆ operator!=()

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

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

◆ operator=() [1/2]

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

Set the parameters of this ellipse core from another.

This does not change the parametrization of the ellipse core.

Definition at line 156 of file BaseCore.cc.

156  {
157  if (&other != this) {
158  // We use Axes instead of Quadrupole here because it allows us to copy Axes without
159  // implicitly normalizing them.
160  double a, b, theta;
161  other._assignToAxes(a, b, theta);
162  _assignFromAxes(a, b, theta);
163  }
164  return *this;
165 }
table::Key< int > b
table::Key< int > a
ItemVariant const * other
Definition: Schema.cc:56
virtual void _assignFromAxes(double a, double b, double theta)=0

◆ operator=() [2/2]

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

Definition at line 167 of file BaseCore.cc.

167 { return *this = other; }
ItemVariant const * other
Definition: Schema.cc:56

◆ operator==()

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

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 }
ItemVariant const * other
Definition: Schema.cc:56
ParameterVector const getParameterVector() const
Return the core parameters as a vector.
Definition: BaseCore.cc:144
virtual std::string getName() const =0
Return a string that identifies this parametrization.

◆ readParameters()

virtual void lsst::afw::geom::ellipses::BaseCore::readParameters ( double const *  iter)
pure virtual

◆ registerSubclass()

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

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)

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 }
table::Key< int > b
table::Key< int > a
virtual void _assignFromAxes(double a, double b, double theta)=0
virtual void _assignToAxes(double &a, double &b, double &theta) const =0

◆ setParameterVector()

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

Set the core parameters from a vector.

Definition at line 150 of file BaseCore.cc.

150 { readParameters(p.data()); }
virtual void readParameters(double const *iter)=0

◆ transform() [1/2]

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

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
inline

Definition at line 120 of file Transformer.h.

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

◆ writeParameters()

virtual void lsst::afw::geom::ellipses::BaseCore::writeParameters ( double *  iter) const
pure virtual

Friends And Related Function Documentation

◆ Parametric

friend class Parametric
friend

Definition at line 189 of file BaseCore.h.


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