lsst.afw
20.0.0-9-g61a2a9a3d+63f5489896
|
Go to the documentation of this file.
28 #include <boost/format.hpp>
40 RegistryMap& getRegistry() {
41 static RegistryMap instance;
46 RegistryMap::iterator i = getRegistry().find(
name);
47 if (i == getRegistry().
end()) {
49 (boost::format(
"Ellipse core with name '%s' not found in registry.") %
name).str());
51 return i->second->clone();
64 result->setParameterVector(parameters);
93 getRegistry()[example->getName()] = example;
125 double ixx, iyy, ixy;
157 if (&
other !=
this) {
161 other._assignToAxes(
a,
b, theta);
172 return Jacobian::Identity();
178 double ixx, iyy, ixy;
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);
195 double&
b,
double& theta) {
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);
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;
212 m.row(2).setConstant(1.0 / (t * t));
225 ixy = (
a -
b) * c * s;
233 double& iyy,
double& ixy) {
235 m.col(0).setConstant(2 *
a);
236 m.col(1).setConstant(2 *
b);
239 m.col(2).setConstant(
a -
b);
243 ixy = (
a -
b) * c * s;
250 m(0, 2) *= -2.0 * cs;
virtual void _assignToQuadrupole(double &ixx, double &iyy, double &ixy) const =0
Return the size of the bounding box for the ellipse core.
virtual void writeParameters(double *iter) const =0
Return the size of the bounding box for the ellipse core.
double getArea() const
Return the area of 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.
static std::shared_ptr< BaseCore > make(std::string const &name)
void grow(double buffer)
Increase the major and minor radii of the ellipse core by the given buffer.
lsst::geom::Extent2D computeDimensions() const
Return the size of the bounding box for the ellipse core.
double getDeterminantRadius() const
Return the radius defined as the 4th root of the determinant of the quadrupole matrix.
ParameterVector const getParameterVector() const
Return the core parameters as a vector.
bool operator==(BaseCore const &other) const
Compare two ellipse cores for equality.
virtual void _assignToAxes(double &a, double &b, double &theta) const =0
Return the size of the bounding box for the ellipse core.
void setParameterVector(ParameterVector const &vector)
Set the core parameters from a vector.
std::unique_ptr< SchemaItem< U > > result
A base class for parametrizations of the "core" of an ellipse - the ellipticity and size.
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.
virtual void readParameters(double const *iter)=0
Return the size of the bounding box for the ellipse core.
ItemVariant const * other
Eigen::Vector3d ParameterVector
Parameter vector type.
afw::table::PointKey< int > dimensions
Jacobian dAssign(BaseCore const &other)
Assign other to this and return the derivative of the conversion, d(this)/d(other).
double getTraceRadius() const
Return the radius defined as the square root of one half the trace of the quadrupole matrix.
static void registerSubclass(std::shared_ptr< BaseCore > const &example)
Return the size of the bounding box for the ellipse core.
A base class for image defects.
#define LSST_EXCEPT(type,...)
virtual Jacobian _dAssignFromQuadrupole(double ixx, double iyy, double ixy)=0
Return the size of the bounding box for the ellipse core.
An ellipse core with quadrupole moments as parameters.
Eigen::Matrix3d Jacobian
Parameter Jacobian matrix type.
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.
virtual std::string getName() const =0
Return a string that identifies this parametrization.
BaseCore & operator=(BaseCore const &other)
Set the parameters of this ellipse core from another.
virtual void _assignFromAxes(double a, double b, double theta)=0
Return the size of the bounding box for the ellipse core.
void scale(double factor)
Scale the size of the ellipse core by the given factor.
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.
A temporary-only expression object for ellipse core convolution.