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
DM-35265: Reduce usage of MeasurementError #213
Conversation
It no longer raises MeasurementError so there is no longer a log message to capture.
We no longer use lsst.log so there is no need to capture log output to files and read the files back again.
This makes the code a bit simpler and puts all the flag handling directly in measure(). It also removes a try/except.
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.
Looks good! Only comment is a suggestion for how to get rid of the remaining try/catch
on LengthError
.
@@ -381,8 +367,7 @@ std::pair<MaskedImageT, double> smoothAndBinImage(std::shared_ptr<afw::detection | |||
try { | |||
subImage.reset(new MaskedImageT(mimage, bbox, afw::image::LOCAL)); | |||
} catch (pex::exceptions::LengthError &err) { | |||
throw LSST_EXCEPT(MeasurementError, SdssCentroidAlgorithm::EDGE.doc, | |||
SdssCentroidAlgorithm::EDGE.number); | |||
return std::make_tuple(mimage, 0, SdssCentroidAlgorithm::EDGE.number); |
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.
If you want to remove this try/catch
as well, I think the replacement is:
if (!mimage.getBBox(afw::image::LOCAL).contains(bbox)) {
return std::make_tuple(mimage, 0, SdssCentroidAlgorithm::EDGE.number);
}
subImage.reset(new MaskedImageT(mimage, bbox, afw::image::LOCAL));
No description provided.