desihub / desispec

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

Fit for residual background per amplifier as part of sky subtraction #1518

Open julienguy opened 2 years ago

julienguy commented 2 years ago

At the end of the sky subtraction fit, we could consider fitting for a residual spectral background per CCD amplifier, either a constant term or a linear function of wavelength and a polynomial function of fiber (or CCD X coordinate). This should allow us to correct some of the issues related to fluctuating CCD bias.

julienguy commented 2 years ago

Here is an example from a recent night where we have large bias instability in b4. https://nightwatch.desi.lbl.gov/20211215/00114120/preproc-b4-00114120-4x.html (click prev next on the web page to see the time variation). The sky subtracted frames present large steps +- 10 elec/A (!) in the spectra caused by the discontinuity at the boundary between amplifiers.

plot_frame -i $DESI_SPECTRO_REDUX/daily/exposures/20211215/00114225/sframe-b4-00114225.fits  --sky-fibers --rebin 100

Figure_1

julienguy commented 2 years ago

This step is interpreted as Balmer breaks (positive or negative!) by redrock and results in pile-ups of incorrect redshift at z~0.25 for sky fibers (see https://data.desi.lbl.gov/desi/spectro/redux/daily/nightqa/20211215/skyzfiber-20211215.png ). The effect is however quite small for science fibers.

julienguy commented 2 years ago

In PR #1551 , I consider subtracting this background at the preprocessing level (before extraction and sky subtraction).