# 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:
• Labels:

#### 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::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::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

#### Activity

Hide
John Swinbank added a comment -

Setting team to AP since they are handling single frame PSF estimation. Simon Krughoff, are you happy with that?

Show
John Swinbank added a comment - Setting team to AP since they are handling single frame PSF estimation. Simon Krughoff , are you happy with that?
Hide
Jim Bosch added a comment -

I'm not sure the error message is exactly the same, but the fact that we do not attempt to continue without a PSF is still a problem. Fixing it would probably be part of a much larger effort to make our processing more fault-tolerant (but with degraded scientific quality), and that is not going to be scheduled super soon.

Show
Jim Bosch added a comment - I'm not sure the error message is exactly the same, but the fact that we do not attempt to continue without a PSF is still a problem. Fixing it would probably be part of a much larger effort to make our processing more fault-tolerant (but with degraded scientific quality), and that is not going to be scheduled super soon.

#### People

Assignee:
Unassigned
Reporter:
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.