New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
meas_base review for DM-4926: centroids outside Footprints. #43
Conversation
@@ -201,6 +201,42 @@ class CentroidTransform : public BaseTransform { | |||
afw::table::CovarianceMatrixKey<ErrElement,2> _coordErrKey; | |||
}; | |||
|
|||
class CentroidChecker { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quibble: this newline is unnecessary.
It wasn't introduced on this issue, but since I've noticed it here, could you fix the "instnace" type in the |
|
||
# This is a measure routine which does nothing except to raise Exceptions | ||
# as requested by the caller. Errors normally don't occur unless there is | ||
# something wrong in the inputs, or if there is an error during the measurement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find "as requested by the caller" a bit confusing here. do you mean "Exceptions caused by moving the true result the amount specified in the config"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is no longer relevant. It was for a previous incarnation.
6293fd7
to
48d5d64
Compare
The CentroidChecker should be used by a Centroid Plugin. It fixes centroider errors whose result is outside the footprint. It must be constructed during __init__, as it adds a flag_resetToPeak to the subschema of the centroid plugin. The centroidChecker(measRecord) should be called after a plugin stores it measured centroid in its measRecord. If the centroid found lies outside the footprint, the result will be "reset" to the footprint peak. If maxDistFromPeak > 0 in the config of the plugin, a check and reset is also done for centroids which fall further than specified from the footprint peak. When a reset if done, flag and flag_resetToPeak are set. Unit test for CentroidChecker.py including toy plugin to simulate errors. Also check that the plugin works with the base Centroid algorithms. Naive, Gaussian and SdssCentroid changed to use checker.
I think this is leftover from an older style of setting flags, which allowed the algorithm to set flags to True, then throw out from anywhere. Such failures will now be caught by the framework. Plus, this strategy would circumvent any other code (such as the Centroid Checker itself) which might set a failure flag but allow the plugin to continue on.
48d5d64
to
a2db85c
Compare
No description provided.