Skip to content

Commit

Permalink
Introduce offImage flag
Browse files Browse the repository at this point in the history
Introduce a flag which can be set to indicate when a paticular record
seems to be off the image being measured.
  • Loading branch information
natelust committed Oct 29, 2015
1 parent a0f3626 commit ad20eaa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/lsst/meas/base/PixelFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class PixelFlagsAlgorithm : public SimpleAlgorithm {
KeyMap _centerKeys;
KeyMap _anyKeys;
afw::table::Key<afw::table::Flag> _generalFailureKey;
afw::table::Key<afw::table::Flag> _offImageKey;
};

}}} // namespace lsst::meas::base
Expand Down
3 changes: 3 additions & 0 deletions src/PixelFlags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ PixelFlagsAlgorithm::PixelFlagsAlgorithm(
// Add generic keys first, which don't correspond to specific mask planes
_generalFailureKey = schema.addField<afw::table::Flag>(name + "_flag",
"general failure flag, set if anything went wring");
_offImageKey = schema.addField<afw::table::Flag>(name+"_flag" + "_offimage",
"Source center is off image");
// Set all the flags that correspond to mask planes anywhere in the footprint
_anyKeys["EDGE"] = schema.addField<afw::table::Flag>(name + "_flag_edge",
"Source is outside usable exposure region (masked EDGE or NO_DATA)");
Expand Down Expand Up @@ -165,6 +167,7 @@ void PixelFlagsAlgorithm::measure(

// Catch centroids off the image
if (!mimage.getBBox().contains(afw::geom::Point2I(center))) {
measRecord.set(_offImageKey, true);
measRecord.set(_anyKeys.at("EDGE"), true);
}

Expand Down

0 comments on commit ad20eaa

Please sign in to comment.