desihub / specter

A toolkit for simulating multi-object spectrographs
Other
8 stars 7 forks source link

fix NaN flux coming from masked input pixels #76

Closed sbailey closed 4 years ago

sbailey commented 4 years ago

This PR fixes desihub/desispec#906 by catching flux=NaN and resetting to flux=ivar=0.0 instead. The NaNs can occur when the input pixels are entirely masked for a particular spectrum/wavelength.

Tested with

srun -n 20 -c 2 desi_proc --mpi --traceshift --scattered-light --nofluxcalib \
  --cameras z4 -n 20200306 -e 53630

and confirming that the output frame doesn't have NaN; example in /global/cfs/cdirs/desi/users/sjbailey/spectro/redux/testnan/exposures/20200306/00053630.

akremin commented 4 years ago

Tested using the batch/queue system and without --scattered-light. The code ran to completion:

desi_proc --batch --nofluxcalib --cameras z4 -n 20200306 -e 53630

Merging this PR