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

psfex fails ungracefully when number of PSF stars is too small

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: psfex

      Description

      When the number of stars picked by the star selector is small, psfex fails, giving the following traceback:

      processCcd.charImage.measurePsf INFO: PSF star selector found 2 candidates
      processCcd.charImage.measurePsf.psfDeterminer WARN: NOT scaling kernelSize by stellar quadrupole moment, but using absolute value
       
      > WARNING: 1st context group removed (not enough samples)
       
      processCcd.charImage.measurePsf INFO: PSF determination using 1/2 stars.
      processCcd FATAL: Failed on dataId=DataId(initialdata={'visit': 242629702}, tag=set([])): 
        File "src/PsfexPsf.cc", line 216, in virtual std::shared_ptr<lsst::afw::image::Image<double> > lsst::meas::extensions::psfex::PsfexPsf::_doComputeImage(const Point2D&, const lsst::afw::image::Color&, const Point2D&) const
          Only spatial variation (ndim == 2) is supported; saw 0 {0}
      lsst::pex::exceptions::InvalidParameterError: 'Only spatial variation (ndim == 2) is supported; saw 0'
       
      Traceback (most recent call last):
        File "/ssd/lsstsw/stack_20170409/Linux64/pipe_base/13.0-3-g7fa07e0+5/python/lsst/pipe/base/cmdLineTask.py", line 347, in __call__
          result = task.run(dataRef, **kwargs)
        File "/ssd/lsstsw/stack_20170409/Linux64/pipe_base/13.0-3-g7fa07e0+5/python/lsst/pipe/base/timer.py", line 121, in wrapper
          res = func(self, *args, **keyArgs)
        File "/home/mfl/lsst/pipe_tasks/python/lsst/pipe/tasks/processCcd.py", line 188, in run
          doUnpersist=False,
        File "/ssd/lsstsw/stack_20170409/Linux64/pipe_base/13.0-3-g7fa07e0+5/python/lsst/pipe/base/timer.py", line 121, in wrapper
          res = func(self, *args, **keyArgs)
        File "/home/mfl/lsst/pipe_tasks/python/lsst/pipe/tasks/characterizeImage.py", line 351, in run
          background = background,
        File "/ssd/lsstsw/stack_20170409/Linux64/pipe_base/13.0-3-g7fa07e0+5/python/lsst/pipe/base/timer.py", line 121, in wrapper
          res = func(self, *args, **keyArgs)
        File "/home/mfl/lsst/pipe_tasks/python/lsst/pipe/tasks/characterizeImage.py", line 413, in characterize
          psfSigma = psf.computeShape().getDeterminantRadius()
      InvalidParameterError: 
        File "src/PsfexPsf.cc", line 216, in virtual std::shared_ptr<lsst::afw::image::Image<double> > lsst::meas::extensions::psfex::PsfexPsf::_doComputeImage(const Point2D&, const lsst::afw::image::Color&, const Point2D&) const
          Only spatial variation (ndim == 2) is supported; saw 0 {0}
      lsst::pex::exceptions::InvalidParameterError: 'Only spatial variation (ndim == 2) is supported; saw 0'
      

      This should fail sufficiently gracefully, so that the rest of the processing can proceed using the nominal/placeholder PSF.

      It should be noted that when things fail, we should know they fail without parsing the logs, i.e. a field status-bit should be set to say this happened, and that subsequent processing was done using an unfitted PSF.

      Also note that trying to improve this by setting config.charImage.measurePsf.psfDeterminer["psfex"].spatialOrder=0 makes for an even less graceful failure, i.e. a segfault, as per DM-10577

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mfisherlevine Merlin Fisher-Levine
              Watchers:
              Jim Bosch, John Swinbank, Merlin Fisher-Levine, Robert Lupton
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:

                  Jenkins

                  No builds found.