26 namespace lsst {
namespace meas {
namespace base {
31 xSigma(std::numeric_limits<
ErrElement>::quiet_NaN()),
32 ySigma(std::numeric_limits<
ErrElement>::quiet_NaN()),
33 x_y_Cov(std::numeric_limits<
ErrElement>::quiet_NaN())
52 xSigma = std::sqrt(matrix(0, 0));
53 ySigma = std::sqrt(matrix(1, 1));
65 std::string
const &
name,
66 std::string
const & doc,
77 std::vector< afw::table::Key<ErrElement> >
sigma(2);
78 std::vector< afw::table::Key<ErrElement> > cov;
80 schema.
join(name,
"xSigma"),
"1-sigma uncertainty on x position",
"pixels"
83 schema.
join(name,
"ySigma"),
"1-sigma uncertainty on y position",
"pixels"
88 schema.
join(name,
"x_y_Cov"),
"uncertainty covariance in x and y",
"pixels^2"
99 std::vector<std::string> getNameVector() {
100 std::vector<std::string> v;
111 static std::vector<std::string> names = getNameVector();
114 }
catch (pex::exceptions::NotFoundError &) {}
134 std::string
const &
name,
140 mapper.addMapping(mapper.getInputSchema().find<afw::table::Flag>(
name +
"_flag").key);
143 auto & s = mapper.editOutputSchema();
150 std::vector< afw::table::Key<ErrElement> >
sigma(2);
151 std::vector< afw::table::Key<ErrElement> > cov(1);
152 sigma[0] = s.addField<
ErrElement>(s.join(
name,
"raSigma"),
"Uncertainty on RA",
"radians");
153 sigma[1] = s.addField<
ErrElement>(s.join(
name,
"decSigma"),
"Uncertainty on dec",
"radians");
155 "Uncertainty covariance in RA and dec",
"radians^2");
173 for (; inSrc != inputCatalog.
end() && outSrc != outputCatalog.
end(); ++inSrc, ++outSrc) {
178 if (centroidResultKey.getCentroidErr().isValid()) {
184 transform.transpose()).cast<ErrElement>());
Defines the fields and offsets for a table.
A proxy type for name lookups in a Schema.
ErrElement ySigma
1-Sigma uncertainty on y (sqrt of variance)
static PointKey addFields(Schema &schema, std::string const &name, std::string const &doc, std::string const &unit)
table::Key< std::string > name
geom::AffineTransform linearizePixelToSky(coord::Coord const &coord, geom::AngleUnit skyUnit=geom::degrees) const
Return the local linear approximation to Wcs::pixelToSky at a point given in sky coordinates.
UncertaintyEnum
An enum used to specify how much uncertainty information measurement algorithms provide.
A custom container class for records, based on std::vector.
afw::table::Schema schema
A mapping between the keys of two Schemas, used to copy data between them.
A reusable struct for centroid measurements.
Centroid const getCentroid() const
Return a Point object containing the measured x and y.
ErrElement xSigma
1-Sigma uncertainty on x (sqrt of variance)
The full covariance matrix is provided.
CentroidElement x
x (column) coordinate of the measured position
Implementation of the WCS standard for a any projection.
bool isValid() const
Return True if the centroid key is valid.
boost::shared_ptr< coord::Coord > pixelToSky(double pix1, double pix2) const
Convert from pixel position to sky coordinates (e.g. RA/dec)
void setCentroid(Centroid const ¢roid)
Set the struct fields from the given Point object.
Key< T > addField(Field< T > const &field, bool doReplace=false)
Add a new field to the Schema, and return the associated Key.
static CoordKey addFields(afw::table::Schema &schema, std::string const &name, std::string const &doc)
A coordinate class intended to represent absolute positions.
afw::table::Key< double > sigma
CentroidResult()
Constructor; initializes everything to NaN.
Custom catalog class for record/table subclasses that are guaranteed to have an ID, and should generally be sorted by that ID.
ErrElement x_y_Cov
x,y term in the uncertainty convariance matrix
AngleUnit const radians
constant with units of radians
Iterator class for CatalogT.
virtual void set(BaseRecord &record, coord::IcrsCoord const &value) const
Set an IcrsCoord in the given record.
virtual CentroidResult get(afw::table::BaseRecord const &record) const
Get a CentroidResult from the given record.
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...
virtual void set(afw::table::BaseRecord &record, CentroidResult const &value) const
Set a CentroidResult in the given record.
Base class for all records.
std::string join(std::string const &a, std::string const &b) const
Join strings using the field delimiter appropriate for this Schema.
Algorithm provides no uncertainy information at all.
virtual void set(BaseRecord &record, Eigen::Matrix< T, N, N > const &value) const
Set a covariance matrix in the given record (uses only the lower triangle of the given matrix) ...
CentroidCov const getCentroidErr() const
Return the 2x2 symmetric covariance matrix, with rows and columns ordered (x, y)
A FunctorKey for CentroidResult.
void set(Key< T > const &key, U const &value)
Set value of a field for the given key.
CentroidElement y
y (row) coordinate of the measured position
Field< T >::Value get(Key< T > const &key) const
Return the value of a field for the given key.
Eigen::Matrix< ErrElement, 2, 2, Eigen::DontAlign > CentroidCov
afw::geom::Point< CentroidElement, 2 > Centroid
bool isValid() const
Return True if all the constituent sigma Keys are valid.
afw::table::PointKey< CentroidElement > _centroid
CentroidResultKey()
Default constructor; instance will not be usuable unless subsequently assigned to.
afw::table::CovarianceMatrixKey< ErrElement, 2 > _centroidErr
Schema getSchema() const
Return the schema associated with the catalog's table.
void setCentroidErr(CentroidCov const &matrix)
Set the struct uncertainty fields from the given matrix, with rows and columns ordered (x...