﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
867	Bad PSF fits are not diagnosed	rhl@…	eugene	"In the SDSS u band (and maybe PS y?) it is not uncommon for there to be very
few PSF stars.  The spatial variation code in psphot doesn't take this into
account.

In particular, if I ask for linear spatial variation (3 coefficients; 1, x, y)
with only 3 PSF stars the following occurs:
     1/ The linear fit is performed
     2/ The mean and standard deviation are estimated.
     3/ All but one star is clipped out (as the s.d. is 0)
     4/ The Gauss-Jordan fitter fails to notice that the normal equations
     are singular
     5/ psphot attempts to estimate the PSF at some position in the frame,
     and the q1 > 0 assertion in the QGAUSS code fails as the estimated 
     SXX and SYY are naturally crazy

There are two things here (in addition to the singular matrix not being
detected which I have reported separately):
     1/ The code needs to be smarter about such error conditions
     2/ There needs to be some way to test the quality of the fit without
     failing an assertion.  The test code in pmPSTtry.c predicated on
     psTraceGetLevel(""psModules.objects"") >= 4 causes an abort.

This bug might be better moved to psModules as that's where the code is,
but I've already entered this PR and I can't move it."	defect	closed	high		psphot	1.0	major	needinfo		
