LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
#include <InputUtilities.h>
Public Member Functions | |
SafeShapeExtractor (afw::table::Schema &schema, std::string const &name) | |
afw::geom::ellipses::Quadrupole | operator() (afw::table::SourceRecord &record, FlagHandler const &flags) const |
Private Attributes | |
std::string | _name |
Utility class for measurement algorithms that extracts an ellipse from the Shape slot and handles errors in a safe and consistent way.
Definition at line 92 of file InputUtilities.h.
lsst::meas::base::SafeShapeExtractor::SafeShapeExtractor | ( | afw::table::Schema & | schema, |
std::string const & | name | ||
) |
Construct the extractor, creating a flag alias that indicates failure in the input centroid by linking to the slot shape flag.
[out] | schema | Schema to which the alias should be added. The "slot_Shape" alias must already be present in the Schema's AliasMap. |
[in] | name | The name of the algorithm; the flag alias added will be "<name>_flag_badShape". |
Definition at line 139 of file InputUtilities.cc.
afw::geom::ellipses::Quadrupole lsst::meas::base::SafeShapeExtractor::operator() | ( | afw::table::SourceRecord & | record, |
FlagHandler const & | flags | ||
) | const |
Extract a shape from the given record.
We use the Shape slot if it is not NaN, and throw MeasurementError if it is (with only the general failure code attached to the MeasurementError).
If the Shape slot is not defined, we throw FatalAlgorithmError, as this indicates a configuration problem.
If the Shape slot value is NaN and is not flagged (or there is no Shape slot flag), we throw RuntimeError, which should cause the measurement framework to log a warning and set the current algorithm's general failure flag if it is allowed to propagate out of the algorithm implementation.
If the Shape slot is flagged and we nevertheless obtain a usable ellipse, we set the current algorithm's general failure flag, but return the ellipse as well, allowing it to continue while indicating that the result may not be reliable. A singular ellipse (i.e. one with a non-positive quadrupole matrix determinant) is treated the same as a NaN ellipse; it is not considered usable.
Definition at line 158 of file InputUtilities.cc.
|
private |
Definition at line 130 of file InputUtilities.h.