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.