Skip to content
Permalink
Browse files

be more careful about possibly missing model chi-squared values in mo…

…del selection
  • Loading branch information...
dstndstn committed May 13, 2019
1 parent e5468a3 commit a10ecc33247ec615ec1d8401cef2e0787f91a8fc
Showing with 6 additions and 3 deletions.
  1. +6 −3 py/legacypipe/oneblob.py
@@ -1763,19 +1763,22 @@ def _select_model(chisqs, nparams, galaxy_margin, rex):
# bright stars / reference stars: we don't test the simple model.
return 'ptsrc'
# Now choose between point source and simple model (SIMP/REX)
if chisqs.get('ptsrc',0)-nparams['ptsrc'] > chisqs.get(simname,0)-nparams[simname]:
if 'ptsrc' in chisqs and (
chisqs['ptsrc']-nparams['ptsrc'] > chisqs.get(simname,0)-nparams[simname]):
#print('Keeping source; PTSRC is better than SIMPLE')
keepmod = 'ptsrc'
else:
elif simname in chisqs and (
chisqs[simname]-nparams[simname] > chisqs.get('ptsrc',0)-nparams['ptsrc']):
#print('Keeping source; SIMPLE is better than PTSRC')
#print('REX is better fit. Radius', simplemod.shape.re)
oldkeepmod = keepmod
keepmod = simname
# For REX, we also demand a fractionally better fit
if simname == 'rex':
dchisq_psf = chisqs.get('ptsrc',0)
dchisq_rex = chisqs.get('rex',0)
if dchisq_psf > 0 and (dchisq_rex - dchisq_psf) < (0.01 * dchisq_psf):
keepmod = 'ptsrc'
keepmod = oldkeepmod

if not ('exp' in chisqs or 'dev' in chisqs):
return keepmod

0 comments on commit a10ecc3

Please sign in to comment.
You can’t perform that action at this time.