30 namespace lsst {
namespace meas {
namespace base {
34 std::string
const &
name,
38 _isCentroider(isCentroider)
44 std::string aliasedFlagName = schema.
join(
"slot",
"Centroid",
"flag");
45 std::string slotFlagName = schema.
getAliasMap()->apply(aliasedFlagName);
47 if (slotFlagName != schema.
join(name,
"flag")) {
49 schema.
getAliasMap()->set(schema.
join(name,
"flag",
"badInitialCentroid"), slotFlagName);
52 if (aliasedFlagName == slotFlagName) {
54 pex::exceptions::LogicError,
55 (
boost::format(
"Alias for '%s' must be defined before initializing '%s' plugin.")
56 % aliasedFlagName % name).str()
59 schema.
getAliasMap()->set(schema.
join(name,
"flag",
"badCentroid"), slotFlagName);
70 pex::exceptions::RuntimeError,
71 (
boost::format(
"%s: Centroid slot value is NaN, but no Footprint attached to record")
75 if (footprint->getPeaks().empty()) {
77 pex::exceptions::RuntimeError,
78 (
boost::format(
"%s: Centroid slot value is NaN, but Footprint has no Peaks")
82 result.setX(footprint->getPeaks().front().getFx());
83 result.setY(footprint->getPeaks().front().getFy());
93 if (!record.
getTable()->getCentroidKey().isValid()) {
95 return extractPeak(record,
_name);
99 (
boost::format(
"%s requires a centroid, but the centroid slot is not defined") %
_name).str()
105 if (!record.
getTable()->getCentroidFlagKey().isValid()) {
107 return extractPeak(record,
_name);
110 pex::exceptions::RuntimeError,
111 (
boost::format(
"%s: Centroid slot value is NaN, but there is no Centroid slot flag "
112 "(is the executionOrder for %s lower than that of the slot Centroid?)")
119 pex::exceptions::RuntimeError,
120 (
boost::format(
"%s: Centroid slot value is NaN, but the Centroid slot flag is not set "
121 "(is the executionOrder for %s lower than that of the slot Centroid?)")
125 result = extractPeak(record,
_name);
146 std::string aliasedFlagName = schema.
join(
"slot",
"Shape",
"flag");
147 std::string slotFlagName = schema.
getAliasMap()->apply(aliasedFlagName);
148 if (aliasedFlagName == slotFlagName) {
150 pex::exceptions::LogicError,
151 (
boost::format(
"Alias for '%s' must be defined before initializing '%s' plugin.")
152 % aliasedFlagName % name).str()
155 schema.
getAliasMap()->set(schema.
join(name,
"flag",
"badShape"), slotFlagName);
162 if (!record.
getTable()->getShapeKey().isValid()) {
165 (
boost::format(
"%s requires a shape, but the shape slot is not defined") %
_name).str()
172 if (!record.
getTable()->getShapeFlagKey().isValid()) {
174 pex::exceptions::RuntimeError,
175 (
boost::format(
"%s: Shape slot value is NaN, but there is no Shape slot flag "
176 "(is the executionOrder for %s lower than that of the slot Shape?)")
182 pex::exceptions::RuntimeError,
183 (
boost::format(
"%s: Shape slot value is NaN, but the Shape slot flag is not set "
184 "(is the executionOrder for %s lower than that of the slot Shape?)")
190 (
boost::format(
"%s: Shape needed, and Shape slot measurement failed.") %
_name).str(),
An ellipse core with quadrupole moments as parameters.
Defines the fields and offsets for a table.
bool getShapeFlag() const
Return true if the measurement in the Shape slot failed.
CentroidSlotDefinition::MeasValue getCentroid() const
Get the value of the Centroid slot measurement.
boost::shared_ptr< SourceTable const > getTable() const
table::Key< std::string > name
std::string const & _name
boost::shared_ptr< AliasMap > getAliasMap() const
double const getIyy() const
Exception to be thrown when a measurement algorithm experiences a known failure mode.
bool getCentroidFlag() const
Return true if the measurement in the Centroid slot failed.
if(width!=gim.getWidth()||height!=gim.getHeight()||x0!=gim.getX0()||y0!=gim.getY0())
void setValue(afw::table::BaseRecord &record, int i, bool value) const
double const getIxx() const
ShapeSlotDefinition::MeasValue getShape() const
Get the value of the Shape slot measurement.
#define LSST_EXCEPT(type,...)
std::string join(std::string const &a, std::string const &b) const
Join strings using the field delimiter appropriate for this Schema.
double getDeterminant() const
Return the determinant of the matrix representation.
double const getIxy() const
Record class that contains measurements made on a single exposure.