Class CentroidChecker

Class Documentation

class CentroidChecker

Public Functions

CentroidChecker(afw::table::Schema &schema, std::string const &name, bool inside = true, double maxDistFromPeak = -1.0)

Check source record produced by a centroid algorithm called “name”.

If the centroid is accompanied by uncertainties (the xErr and yErr fields), these should not be NaN. If they are, the algorithmName + “_flag_badError” flag and the general failure flag for the algorithm are both set.

If the centroid set by the algorithm lies outside the footprint attached to the record, or the centroid is more than “dist” pixels from the footprint peak:

(1) the general failure flag for the algorithm is set (2) algorithmName + “_flag_resetToPeak” flag is set (3) the position of the centroid is changed to that of the footprint Peak

Parameters
  • [inout] schema: Schema to which the flag_resetToPeak is to be added

  • [in] name: The name of the algorithm we will be checking

  • [in] doFootprintCheck: Check if centroid is within footprint

  • [in] maxDistFromPeak: Check if centroid is more than dist from footprint peak

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 footprint center, or if it is outside the footprint. Set appropriate flags to indicate any changes to the centroid, and to indicate if uncertainties are set to invalid (“NaN”) values.