desihub / desispec

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

preproc OSTEP cut rejecting 20201214 b0 flats #1541

Closed sbailey closed 2 years ago

sbailey commented 2 years ago

The desispec.preproc.preproc OSTEP>5 -> BADREADNOISE cut is rejecting multiple b0 flat exposures on 20201214, which we had previously accepted and used in everest. I haven't gotten far enough in the processing to evaluate how much this is impacting other nights or science exposures in Dec 2020.

This cut was originally motivated by noisy r8A in October 2021; re-evaluate whether it might be rejecting too much earlier data, especially high S/N flats where a 5 ADU step may not matter.

Example:

desi_preproc -o preproc-b0-00067628.fits --cameras b0 -n 20201214 -e 67628
...
INFO:raw.py:250:read_raw: Setting BADREADNOISE bit for fibers of amp A
INFO:raw.py:250:read_raw: Setting BADREADNOISE bit for fibers of amp B
INFO:raw.py:250:read_raw: Setting BADREADNOISE bit for fibers of amp C
INFO:raw.py:250:read_raw: Setting BADREADNOISE bit for fibers of amp D
...

Then from python:

import numpy as np
import fitsio
mask = fitsio.read('preproc-b0-00067628.fits', 'MASK')
np.all(mask>0)  # True (!)

Other impacted flats on 20201214 are 67629, 67634, 67638, 67639, and 67645.

@julienguy

sbailey commented 2 years ago

The OSTEP variations were much larger in all of the B CCDs prior to late January 2021, e.g. from b0 and b1 (diff colors = diff amps):

image image

The change corresponds to 20210128 when the FEE configuration was updated to include 400 prescan reads to minimize the "non-linear dark" effect. Zooming in on a single night of the early data, the different OSTEP bands correspond to zeros, arcs, flats, and science exposures (longer exptimes = larger OSTEP).

It looks like for this time period we'll need to either loosen the OSTEP cut before discarding the amp, or have a larger edge buffer for where we measure the OSTEP.

FWIW I'm in the process of rerunning preproc on every image for Fuji and saving basic stats (but not the big images themselves) to /global/cfs/cdirs/desi/users/sjbailey/dev/fuji/imgstats/imgstats-NIGHT.fits.

sbailey commented 2 years ago

fixed in #1543