Skip to content

Commit

Permalink
fix npix caclulation
Browse files Browse the repository at this point in the history
  • Loading branch information
segasai committed Nov 16, 2024
1 parent e934e9d commit 5041e32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions py/rvspecfit/desi/desi_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,18 +310,18 @@ def proc_onespec(
outdict[name2] = fit_res['param'][name1] * unit
outdict[name2 + '_ERR'] = fit_res['param_err'][name1] * unit

npixes = {}
npixels = {}
for i, curd in enumerate(specdata):
if curd.name not in chisqs:
chisqs[curd.name] = 0
chisqs_c[curd.name] = 0
chisqs[curd.name] += fit_res['chisq_array'][i]
chisqs[curd.name] += fit_res['npix_array'][i]
chisqs_c[curd.name] += chisq_cont_array[i]
npixels[curd.name] += fit_res['npix_array'][i]

outdict['CHISQ_TOT'] = sum(chisqs.values())
outdict['CHISQ_C_TOT'] = sum(chisqs_c.values())
outdict['NPIX_TOT'] = sum(npixes.values())
outdict['NPIX_TOT'] = sum(npixels.values())

for s in chisqs.keys():
outdict['CHISQ_%s' % s.replace('desi_', '').upper()] = chisqs[s]
Expand Down

0 comments on commit 5041e32

Please sign in to comment.