74 "1-sigma uncertainty on x position",
"pixel");
76 "1-sigma uncertainty on y position",
"pixel");
79 "uncertainty covariance in x and y",
"pixel^2"));
127 auto &
s =
mapper.editOutputSchema();
136 sigma[0] =
s.addField<
ErrElement>(
s.join(
name,
"raErr"),
"1-sigma uncertainty on RA",
"rad");
137 sigma[1] =
s.addField<
ErrElement>(
s.join(
name,
"decErr"),
"1-sigma uncertainty on dec",
"rad");
138 cov[0] =
s.addField<
ErrElement>(
s.join(
name,
"ra_dec_Cov"),
"Uncertainty covariance in RA and dec",
153 for (; inSrc != inputCatalog.end() && outSrc != outputCatalog.
end(); ++inSrc, ++outSrc) {
158 if (centroidResultKey.getCentroidErr().isValid()) {
166 .cast<ErrElement>());
175 double maxDistFromPeak)
176 : _doFootprintCheck(doFootprintCheck), _maxDistFromPeak(maxDistFromPeak) {
177 _resetKey = schema.
addField<afw::table::Flag>(schema.
join(name,
"flag_resetToPeak"),
178 "set if CentroidChecker reset the centroid");
179 _failureKey = schema.
find<afw::table::Flag>(schema.
join(name,
"flag")).
key;
190 if (!_doFootprintCheck && _maxDistFromPeak < 0.0) {
202 double distsq = (x - footX) * (x - footX) + (y - footY) * (y - footY);
204 ((_maxDistFromPeak > 0) && (distsq > _maxDistFromPeak * _maxDistFromPeak))) {
205 record.
set(_xKey, footX);
206 record.
set(_yKey, footY);
207 record.
set(_failureKey,
true);
208 record.
set(_resetKey,
true);
void set(BaseRecord &record, Eigen::Matrix< T, N, N > const &value) const override
Set a covariance matrix in the given record (uses only the lower triangle of the given matrix) ...
Defines the fields and offsets for a table.
ErrElement yErr
standard deviation of y
Centroid const getCentroid() const
Return a Point object containing the measured x and y.
A 2-dimensional celestial WCS that transform pixels to ICRS RA/Dec, using the LSST standard for pixel...
A proxy type for name lookups in a Schema.
virtual void set(afw::table::BaseRecord &record, CentroidResult const &value) const
Set a CentroidResult in the given record.
UncertaintyEnum
An enum used to specify how much uncertainty information measurement algorithms provide.
lsst::geom::SpherePoint pixelToSky(lsst::geom::Point2D const &pixel) const
Compute sky position(s) from pixel position(s)
std::string join(std::string const &a, std::string const &b) const
Join strings using the field delimiter appropriate for this Schema.
A mapping between the keys of two Schemas, used to copy data between them.
A coordinate class intended to represent absolute positions.
A reusable struct for centroid measurements.
bool isValid() const
Return True if the centroid key is valid.
The full covariance matrix is provided.
std::shared_ptr< Footprint > getFootprint() const
static PointKey addFields(Schema &schema, std::string const &name, std::string const &doc, std::string const &unit)
Add a pair of _x, _y fields to a Schema, and return a PointKey that points to them.
ErrElement xErr
standard deviation of x
CentroidElement x
x (column) coordinate of the measured position
void setCentroid(Centroid const ¢roid)
Set the struct fields from the given Point object.
Field< T >::Value get(Key< T > const &key) const
Return the value of a field for the given key.
CentroidChecker(afw::table::Schema &schema, std::string const &name, bool inside=true, double maxDistFromPeak=-1.0)
Check source record for an centroid algorithm called name, noting if the centroid already set by the ...
AngleUnit constexpr radians
constant with units of radians
Describe an exposure's calibration.
table::Key< table::Array< std::uint8_t > > wcs
CentroidResult()
Constructor; initializes everything to NaN.
Reports attempts to access elements using an invalid key.
Eigen::Matrix< ErrElement, 2, 2, Eigen::DontAlign > CentroidCov
SchemaItem< T > find(std::string const &name) const
Find a SchemaItem in the Schema by name.
A base class for image defects.
UnitVector3d centroid(VertexIterator const begin, VertexIterator const end)
iterator end()
Iterator access.
ErrElement x_y_Cov
x,y term in the uncertainty convariance matrix
Iterator class for CatalogT.
lsst::geom::AffineTransform linearizePixelToSky(lsst::geom::SpherePoint const &coord, lsst::geom::AngleUnit const &skyUnit) const
Return the local linear approximation to pixelToSky at a point given in sky coordinates.
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...
afw::table::Key< double > sigma
geom::Point< CentroidElement, 2 > Centroid
bool operator()(afw::table::SourceRecord &record) const
Set the centroid to the first footprint if the centroid is either more than _dist pixels from the foo...
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Base class for all records.
Algorithm provides no uncertainy information at all.
static CoordKey addFields(afw::table::Schema &schema, std::string const &name, std::string const &doc)
Add a pair of _ra, _dec fields to a Schema, and return a CoordKey that points to them.
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
CentroidResultKey()
Default constructor; instance will not be usuable unless subsequently assigned to.
Record class that contains measurements made on a single exposure.
virtual CentroidResult get(afw::table::BaseRecord const &record) const
Get a CentroidResult from the given record.
void set(BaseRecord &record, lsst::geom::SpherePoint const &value) const override
Set an lsst::geom::SpherePoint in the given record.
CentroidCov const getCentroidErr() const
Return the 2x2 symmetric covariance matrix, with rows and columns ordered (x, y)
iterator begin()
Iterator access.
bool isValid() const noexcept
Return True if all the constituent error Keys are valid.
Key< T > addField(Field< T > const &field, bool doReplace=false)
Add a new field to the Schema, and return the associated Key.
void setCentroidErr(CentroidCov const &matrix)
Set the struct uncertainty fields from the given matrix, with rows and columns ordered (x...
Reports errors that are due to events beyond the control of the program.