Class CentroidResultKey

Inheritance Relationships

Base Type

Class Documentation

class CentroidResultKey : public lsst::afw::table::FunctorKey<CentroidResult>

A FunctorKey for CentroidResult.

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

Unnamed Group

bool operator==(CentroidResultKey const &other) const

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

bool operator!=(CentroidResultKey const &other) const

Public Functions

CentroidResultKey()

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

CentroidResultKey(afw::table::PointKey<CentroidElement> const &centroid, afw::table::CovarianceMatrixKey<ErrElement, 2> const &centroidErr)

Construct from a pair of Keys.

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

Construct from a subschema, assuming _x, _y, etc. subfields.

If a schema has “a_x”, “a_y”, etc. fields, this constructor allows you to construct a CentroidResultKey via:

CentroidResultKey k(schema["a"]);

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

Get a CentroidResult from the given record.

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

Set a CentroidResult in the given record.

bool isValid() const

Return True if the centroid key is valid.

afw::table::PointKey<CentroidElement> getCentroid() const

Return a FunctorKey to just the centroid value.

afw::table::CovarianceMatrixKey<ErrElement, 2> getCentroidErr() const

Return a FunctorKey to just the uncertainty matrix.

afw::table::Key<CentroidElement> getX() const

Return a Key for the x coordinate.

afw::table::Key<CentroidElement> getY() const

Return a Key for the y coordinate.

Public Static Functions

static CentroidResultKey addFields(afw::table::Schema &schema, std::string const &name, std::string const &doc, UncertaintyEnum uncertainty)

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

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

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

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

  • [in] doc: String used as the documentation for the x and y fields.

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