Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-37428

Support non-zero image XY0 for PeakLikelihoodFluxAlgorithm

    XMLWordPrintable

    Details

      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.

        Attachments

          Issue Links

            Activity

            Hide
            sullivan Ian Sullivan added a comment -

            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.

            Show
            sullivan Ian Sullivan added a comment - 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.
            Hide
            jbosch Jim Bosch added a comment -

            Looks good!

            Show
            jbosch Jim Bosch added a comment - Looks good!

              People

              Assignee:
              sullivan Ian Sullivan
              Reporter:
              sullivan Ian Sullivan
              Reviewers:
              Jim Bosch
              Watchers:
              Ian Sullivan, Jim Bosch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.