File ShapeUtilities.h

namespace lsst

Class for a simple mapping implementing a generic AstrometryTransform.

Remove all non-astronomical counts from the Chunk Exposure’s pixels.

Forward declarations for lsst::utils::Cache

For details on the Cache class, see the Cache.h file.

It uses a template rather than a pointer so that the derived classes can use the specifics of the transform. The class simplePolyMapping overloads a few routines.

A base class for image defects

Numeric constants used by the Integrate.h integrator routines.

Compute Image Statistics

Note

Gauss-Kronrod-Patterson quadrature coefficients for use in quadpack routine qng. These coefficients were calculated with 101 decimal digit arithmetic by L. W. Fullerton, Bell Labs, Nov 1981.

Note

The Statistics class itself can only handle lsst::afw::image::MaskedImage() types. The philosophy has been to handle other types by making them look like lsst::afw::image::MaskedImage() and reusing that code. Users should have no need to instantiate a Statistics object directly, but should use the overloaded makeStatistics() factory functions.

namespace meas
namespace base

Functions

ShapeTrMatrix makeShapeTransformMatrix(geom::LinearTransform const &xform)

Construct a matrix suitable for transforming second moments.

Given an LinearTransform which maps from positions (x, y) to (a, d), returns a 3-by-3 matrix which transforms (xx, yy, xy) to (aa, dd, ad).

That is, given an input transform described by the matrix

| A11 | A12 | | A21 | A22 |

we return the matrix

| A11*A11 | A12*A12 | 2*A11*A12 | | A21*A21 | A22*A22 | 2*A21*A22 | | A11*A21 | A12*A22 | A11*A22 + A12*A21 |

Return

A 3-by-3 transformation matrix for the second order moments

Parameters
  • [in] xform: LinearTransform describing the coordinate mapping

struct ShapeResult
#include <ShapeUtilities.h>

A reusable struct for moments-based shape measurements.

Shape measurements and their errors should always be in pixels coordinates. This struct should generally be preferred over a custom struct with other ellipse parametrizations unless the measurement takes place in another parametrization and a transformation to this one would result in a loss of information or obfuscate the results of the measurement (i.e. use this one unless you have a good reason not to).

Subclassed by lsst::meas::base::SdssShapeResult

Public Functions

ShapeResult()

Constructor; initializes everything to NaN.

ShapeResult(ShapeElement xx_, ShapeElement yy_, ShapeElement xy_, ShapeCov const &matrix)

Constructor; initializes everything from values.

ShapeResult(ShapeElement xx_, ShapeElement yy_, ShapeElement xy_, ErrElement xxErr_, ErrElement yyErr_, ErrElement xyErr_)

Constructor; initializes everything from values.

Shape const getShape() const

Return an afw::geom::ellipses object corresponding to xx, yy, xy.

This method can be used to return an average radius for the measured shape, e.g. getShape().getDeterminantRadius()

afw::geom::ellipses::Quadrupole getQuadrupole()
void setShape(Shape const &shape)

Set struct elements from the given Quadrupole object.

ShapeCov const getShapeErr() const

Return the 3x3 symmetric covariance matrix, with rows and columns ordered (xx, yy, xy)

void setShapeErr(ShapeCov const &matrix)

Set the struct standard deviation elements from the given matrix, with rows and columns ordered (xx, yy, xy)

void setShapeErr(ErrElement xxErr, ErrElement yyErr, ErrElement xyErr)

Set the struct standard deviation elements from the given values.

Public Members

ShapeElement xx

image or model second moment for x^2

ShapeElement yy

image or model second moment for y^2

ShapeElement xy

image or model second moment for xy^2

ErrElement xxErr

standard deviation of xx

ErrElement yyErr

standard deviation of yy

ErrElement xyErr

standard deviation of xy

ErrElement xx_yy_Cov

xx,yy term in the uncertainty convariance matrix

ErrElement xx_xy_Cov

xx,xy term in the uncertainty convariance matrix

ErrElement yy_xy_Cov

yy,xy term in the uncertainty convariance matrix

class ShapeResultKey : public lsst::afw::table::FunctorKey<ShapeResult>
#include <ShapeUtilities.h>

A FunctorKey for ShapeResult.

This class makes it easy to copy shapes and their uncertainties to and from records, and provides a method to add the appropriate fields to a Schema.

Unnamed Group

bool operator==(ShapeResultKey const &other) const

Compare the FunctorKey for equality with another, using the underlying Keys.

bool operator!=(ShapeResultKey const &other) const

Public Functions

ShapeResultKey()

Default constructor; instance will not be usuable unless subsequently assigned to.

ShapeResultKey(afw::table::QuadrupoleKey const &shape, afw::table::CovarianceMatrixKey<ErrElement, 3> const &shapeErr)

Construct from a pair of Keys.

ShapeResultKey(afw::table::SubSchema const &s)

Construct from a subschema, assuming _xx, _yy, etc. subfields.

If a schema has “a_xx”, “a_yy”, etc. fields, this constructor allows you to construct a ShapeResultKey via:

ShapeResultKey k(schema["a"]);

virtual ShapeResult get(afw::table::BaseRecord const &record) const

Get a ShapeResult from the given record.

virtual void set(afw::table::BaseRecord &record, ShapeResult const &value) const

Set a ShapeResult in the given record.

bool isValid() const

Return True if the shape key is valid.

afw::table::QuadrupoleKey getShape() const

Return a FunctorKey to just the shape value.

afw::table::CovarianceMatrixKey<ErrElement, 3> getShapeErr() const

Return a FunctorKey to just the uncertainty matrix.

afw::table::Key<ShapeElement> getIxx() const

Return a Key for the xx moment.

afw::table::Key<ShapeElement> getIyy() const

Return a Key for the yy moment.

afw::table::Key<ShapeElement> getIxy() const

Return a Key for the xy moment.

Public Static Functions

static ShapeResultKey addFields(afw::table::Schema &schema, std::string const &name, std::string const &doc, UncertaintyEnum uncertainty, afw::table::CoordinateType coordType = afw::table::CoordinateType::PIXEL)

Add the appropriate fields to a Schema, and return a ShapeResultKey that manages them.

The unit for all fields will be pixels^2 (pixels^4 for covariances).

Parameters
  • [inout] schema: Schema to add fields to.

  • [in] name: Name prefix for all fields; “_xx”, “_yy”, etc. will be appended to this to form the full field names.

  • [in] doc: String used as the documentation for the xx, yy, xy fields.

  • [in] uncertainty: Enum indicating which (if any) uncertainty values will be saved.

Private Members

afw::table::QuadrupoleKey _shape
afw::table::CovarianceMatrixKey<ErrElement, 3> _shapeErr