desihub / desispec

DESI spectral pipeline
BSD 3-Clause "New" or "Revised" License
35 stars 24 forks source link

preproc interpolate overscan if active region entirely masked #2178

Closed sbailey closed 6 months ago

sbailey commented 6 months ago

This PR fixes desihub/desisurveyops#164, when combined with a $DESI_SPECTRO_CALIB/ccd/ccd-region-mask.csv entry (NIGHT,EXPID,CAMERA,XMIN,XMAX,YMIN,YMAX,COMMENT) to mask 4 rows impacted bit a large cosmic tail on night 20231208 exp 208688 camera b6:

20231208,208688,b6,2048,4096,3928,3932,'tail from cosmic impacts overscan OSTEP; see https://github.com/desihub/desisurveyops/issues/164'

The code change is to interpolate the overscan region for rows that are entirely masked in the active region; previously the cosmic tail leaking into the overscan region resulted in an OSTEP trigger and masking the entire amp.

Original daily mask (left), new mask from this PR (right):

image

Data file in /pscratch/sd/s/sjbailey/desi/dev/ostep_mask/preproc-b6-00208688.fits, to be compared with /global/cfs/cdirs/desi/spectro/redux/daily/preproc/20231208/00208688/preproc-b6-00208688.fits.gz .

Full disclosure: there are also some small differences in the image itself, which I attribute to a change in the bias or dark models since the time daily was run, but I haven't really checked. This code change is isolated enough that I'm pretty sure the non-mask image difference is due to how I ran desi_preproc, not the code update itself.

@schlafly if this looks good to you, I'll merge, update $DESI_SPECTRO_CALIB, and rerun that tile in daily for new QA.

schlafly commented 6 months ago

Looks good to me. I hadn't appreciated that you already had this badrows concept in there; that's convenient!