-
Notifications
You must be signed in to change notification settings - Fork 10
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
Review for DM-3483: don't throw when transforming negative fluxes #24
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -354,10 +354,15 @@ void ApertureFluxTransform::operator()( | |
} | ||
afw::table::SourceCatalog::const_iterator inSrc = inputCatalog.begin(); | ||
afw::table::BaseCatalog::iterator outSrc = outputCatalog.begin(); | ||
for (; inSrc < inputCatalog.end() && outSrc < outputCatalog.end(); ++inSrc, ++outSrc) { | ||
for (std::size_t i = 0; i < _ctrl.radii.size(); ++i) { | ||
FluxResult fluxResult = fluxKeys[i].get(*inSrc); | ||
_magKeys[i].set(*outSrc, calib.getMagnitude(fluxResult.flux, fluxResult.fluxSigma)); | ||
{ | ||
// While noThrow is in scope, converting a negative flux to a magnitude | ||
// returns NaN rather than throwing. | ||
NoThrowOnNegativeFluxContext noThrow; | ||
for (; inSrc < inputCatalog.end() && outSrc < outputCatalog.end(); ++inSrc, ++outSrc) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part of these lines isn't what's been changed, but...
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, to clarify, |
||
for (std::size_t i = 0; i < _ctrl.radii.size(); ++i) { | ||
FluxResult fluxResult = fluxKeys[i].get(*inSrc); | ||
_magKeys[i].set(*outSrc, calib.getMagnitude(fluxResult.flux, fluxResult.fluxSigma)); | ||
} | ||
} | ||
} | ||
} | ||
|
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 like this a lot. I'd like it even better if we could integrate it more closely with Calib, but I don't think that's appropriate for this ticket (it's more disruptive), so I've opened DM-3489 for that.