Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Labels:
-
Story Points:1
-
Epic Link:
-
Sprint:AP S23-1 (December)
-
Team:Alert Production
-
Urgent?:No
Description
The PeakLikelihoodFluxAlgorithm in meas_base appears to support non-zero image XY0, and the check on line 210 uses the XY0 correctly:
if (!geom::Box2D(mimage.getBBox()).contains(center)) { |
std::ostringstream os;
|
os << "Center = " << center << " not in exposure bbox" << mimage.getBBox(); |
throw LSST_EXCEPT(pex::exceptions::RangeError, os.str()); |
However, when the index of the center pixel of the source is calculated a few lines down with:
std::pair<int, double> const xCtrPixParentIndFrac = afw::image::positionToIndex(center.getX(), true); |
It calls afw.image.positionToIndex where on line 44 of imageUtils.h the index of the corner pixel is hard-coded as (0, 0).
It if it desired behavior that this code only works with images that have XY0 set to (0, 0) we should add a check in PeakLikelihoodFluxAlgorithm (and perhaps other places as well) to catch any non-zero value and throw a useful error. If it is not desired behavior, we should pass XY0 as a keyword to afw.image.positionToIndex or add XY0 to ctrPixParentInd in PeakLikelihoodFluxAlgorithm.
I took the minimal approach to fix the specific bug I was hitting, which does not fix the root problem with afwImage's positionToIndex not respecting the image XY0.