Class Ellipse

Class Documentation

class Ellipse

An ellipse defined by an arbitrary BaseCore and a center point.

An ellipse is composed of its center coordinate and its Core - a parametrization of the ellipticity and size of the ellipse. Setting the core of an ellipse never changes the type of the contained core, it merely sets the parameters of that core by converting the parameters.

Coordinate transforms

These member functions transform the ellipse by the given lsst::geom::AffineTransform. 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().

Ellipse::Transformer transform(lsst::geom::AffineTransform const &transform)
Ellipse::Transformer const transform(lsst::geom::AffineTransform const &transform) const

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

Ellipse::Convolution convolve(Ellipse const &other)
Ellipse::Convolution const convolve(Ellipse const &other) const

Public Types

enum ParameterEnum

Values:

X = 3
Y = 4
typedef Eigen::Matrix<double, 5, 1> ParameterVector

Proxy return type for Ellipse::convolve().

Parameter vector type.

Public Functions

lsst::geom::Point2D const &getCenter() const

Return the center point.

lsst::geom::Point2D &getCenter()

Return the center point.

void setCenter(lsst::geom::Point2D const &center)

Set the center point.

BaseCore const &getCore() const

Return the ellipse core.

BaseCore &getCore()

Return the ellipse core.

std::shared_ptr<BaseCore const> getCorePtr() const

Return the ellipse core.

std::shared_ptr<BaseCore> getCorePtr()

Return the ellipse core.

void setCore(BaseCore const &core)

Set the ellipse core; the type of the core is not changed.

void normalize()

Put the parameters in a standard form.

void grow(double buffer)

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

void scale(double factor)

Scale the size of the ellipse by the given factor.

void shift(lsst::geom::Extent2D const &offset)

Move the ellipse center by the given offset.

ParameterVector const getParameterVector() const

Return the ellipse parameters as a vector.

void setParameterVector(ParameterVector const &vector)

Set the ellipse parameters from a vector.

void readParameters(double const *iter)
void writeParameters(double *iter) const
Ellipse::GridTransform const getGridTransform() const

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

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

lsst::geom::Box2D computeBBox() const

Return the bounding box of the ellipse.

Ellipse &operator=(Ellipse const &other)

Set the parameters of this ellipse from another.

This does not change the parametrization of the ellipse.

Ellipse &operator=(Ellipse &&other)
bool operator==(Ellipse const &other) const

Compare two ellipses for equality.

Ellipses are only equal if they have the same Core types.

bool operator!=(Ellipse const &other) const

Compare two ellipses for inequality.

Ellipses are only equal if they have the same Core types.

virtual ~Ellipse()
Ellipse(BaseCore const &core, lsst::geom::Point2D const &center = lsst::geom::Point2D())
Ellipse(std::shared_ptr<BaseCore const> const &core, lsst::geom::Point2D const &center = lsst::geom::Point2D())
Ellipse(Transformer const &other)
Ellipse(Convolution const &other)
Ellipse(Ellipse const &other)
Ellipse(Ellipse &&other)
class Convolution

A temporary-only expression object for ellipse convolution.

Public Types

typedef Eigen::Matrix<double, 5, 5> DerivativeMatrix

Matrix type for derivative with respect to input ellipse parameters.

Public Functions

Convolution(Ellipse &self, Ellipse const &other)

Standard constructor.

std::shared_ptr<Ellipse> copy() const

Return a new convolved ellipse.

void inPlace()

Convolve the ellipse in-place.

DerivativeMatrix d() const

Return the derivative of convolved ellipse with respect to self.

Public Members

Ellipse &self
Ellipse const &other
class GridTransform

A temporary-only expression object representing an lsst::geom::AffineTransform that maps the Ellipse to a unit circle at the origin.

Public Types

typedef Eigen::Matrix<double, 6, 5> DerivativeMatrix

Matrix type for derivative with respect to input ellipse parameters.

Public Functions

GridTransform(Ellipse const &input)

Standard constructor.

lsst::geom::AffineTransform::Matrix getMatrix() const

Return the transform matrix as an Eigen object.

DerivativeMatrix d() const

Return the derivative of transform with respect to input ellipse.

double getDeterminant() const

Return the determinant of the lsst::geom::AffineTransform.

operator lsst::geom::AffineTransform() const

Convert the proxy to an lsst::geom::AffineTransform.

lsst::geom::AffineTransform inverted() const

Return the inverse of the AffineTransform.

lsst::geom::AffineTransform invert() const
class Transformer

A temporary-only expression object for ellipse transformations.

Transformer simply provides a clean syntax for transform-related operations, including in-place and new-object transformations, derivatives of the transformations, and implicit conversion to an auto_ptr to a new transformed ellipse.

Public Types

typedef Eigen::Matrix<double, 5, 5> DerivativeMatrix

Matrix type for derivative with respect to input ellipse parameters.

typedef Eigen::Matrix<double, 5, 6> TransformDerivativeMatrix

Matrix type for derivative with respect to transform parameters.

Public Functions

Transformer(Ellipse &input_, lsst::geom::AffineTransform const &transform_)

Standard constructor.

std::shared_ptr<Ellipse> copy() const

Return a new transformed ellipse.

void inPlace()

Transform the ellipse in-place.

void apply(Ellipse &other) const
DerivativeMatrix d() const

Return the derivative of transform output ellipse with respect to input ellipse.

TransformDerivativeMatrix dTransform() const

Return the derivative of transform output ellipse with respect to transform parameters.

Public Members

Ellipse &input

input ellipse to be transformed

lsst::geom::AffineTransform const &transform

transform object