New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fiber crosstalk #1138
Fiber crosstalk #1138
Conversation
Results improved after fitting the cross-talk parameters for each of the 30 cameras independently. based on |
…on frame with the crosstalk uncorrected
…e the parameters more meaningful
…of coefficients on rebinned spectra
NOTE: original post of this comment had a bookkeeping error caught by @julienguy; I'm updating the numbers and text below. The latest version of this branch is distinctly better than previous versions for their impact on redshift success. Testing on:
the BGS tile 80613 in particular has 22 (0.9%) targets move from bad in Blanc to good in this PR, with none going from good to bad. 80609 was mostly unchanged: 6 from bad to good and 4 from good to bad. 80608 was similar, with 2-3 targets changing state per night but no big win or loss. Results in /global/cfs/cdirs/desi/users/sjbailey/spectro/redux/xtalk3, with 3 summary files:
where "bad" = |deltav| > 1000 km/s and ZWARN=0. So: good win for BGS, neutral for other target classes, i.e. an overall improvement. Thanks. |
Added minor modifications. Saved a new version of the parameter file from a run on all of the recent data. This PR is ready for review and could be merged. |
Thanks; I will re-rerun and evaluate with latest params as a cross check (hopefully without bookkeeping errors this time). Since we're done with the Cascades high priority deep tiles and substantially done with other nights, I'd like to hold off on merging this until Cascades is completely finished, and then fast-track a Denali run using Cascades calibs + extractions plus this and potentially a few other high priority fixes. |
There is a problem with the ivar correction to fibers that neighbor fibers masked as BADFIBER (fibermap.FIBERSTATUS bit 16), resulting poor redshift performance for those neighboring fibers. Examples from exposures/20201215/00067968/cframe-z4-00067968.fits are fibers that neighbor fibers 2036, 2051, 2132, 2156. |
…INGPOSITION|BADPOSITION
The code was computing the crosstalk from all bad fibers instead of considering only the ones with bad positioning and no other issue. |
The latest push definitely improved things, but still has ~1% worse performance on ELG tile 80606 compared to Cascades. The dominant problem is targets that went from ZWARN=0 to ZWARN=4 while retaining the same redshift. This appears to come from a scaling of ivar leading to a scaling of chi2 leading to shrinking deltachi2. Examples below; note the clustering of FIBERs e.g. 1733,1735 neighboring masked fiber 1734.
|
…y consider a systematic uncertainty
Some ZWARN!=0 were due to artificially large variance added to the contaminated spectra. I have chosen to ignore the variance of the contaminating spectrum because accounting for it would add extra complexity and possibly more fragility. I only add to the variance of the contaminated spectrum a term reflecting a systematic error of 10% on the contamination. This is still not perfect because it is considered uncorrelated across wavelength, but we do not have yet the data model for correlated errors. Could you try rerunning your test with this correction? |
With this version, the changes are an improvement for all major target classes (yay!). Using the nightly redshift completeness and purity for visual inspection tiles 80605, 80606, 80607, 80608, 80609, 80610, 80613 on nights 20201214, 20201216, 20201218, 20201221, 20210205, 20201215, 20201217, 20201219, 20210130, 20210208, the % improvement relative to Cascades is:
I think (but haven't verified) that BGS gets the most improvement because they are most likely to be neighboring a bright MWS target, while on ELG/LRG/QSO the primary contamination is from rare standard stars. Now that this is vetted, I changed the Heads up: while testing this I was sidetracked by chasing "lower" efficiency due to desi_process_exposure (as called by desi_proc -> runcmd) exiting with no error messages and return code=0 but without having written its output files (!). The coadds/redshifts picked up whatever was there and ran redshifts missing some exposures, resulting in lower S/N and lower efficiency. I was unable to reproduce the problem in multiple reruns today so I think it was a transient NERSC problem and not a feature of this branch, but we should keep our eye out for this. Merging now (after fixing up the conflicts). |
Code to compute and correct for fiber cross-talk at the spectral level
Fiber cross-talk (or fiber to fiber contamination) is induced by extended Lorentzian PSF tails on the spectrographs CCDs. It is a small effect in most of the wavelength range but becomes large (reaching 1%) in the NIR for wavelength > 9000A. It causes a visible spurious increase at the largest NIR wavelength in the spectra of faint targets which fiber is next to a bright one in the spectrographs.
2D modeling
The PSF tails can be modeled accurately using data from the parse test fiber slit. The following figures show the PSF tails measured with continuum lamp data from SM1 NIR camera (solid curves), along with the model (dashed curves) obtained by adding a Lorentzian tail to the 2D PSF model used for extraction ( in specter ).
A precise measurement shows that the PSF tails are asymmetric and depend on the position of the fiber in the CCD.
On the following figure the specter PSF tails (dashed curve) are also asymmetric,
The 2D PSF tail model fitted on the sparse fiber data is found consistent with the signal measured on the edge fibers for exposures with the continuum lamps on the Mayall dome white spot.
1D correction
Despite having a rather good modeling of the 2D PSF tails, we resorted not to use this approach to correct for the fiber cross-talk.
Some cross-talk is visible on fiber F+2 (next to next fiber). Correcting for this with a 2D PSF would require to extend its size/footprint to more than 2x15 pixels on each dimension which would make the extraction prohibitively slow and would also make the extraction even more sensitive to unmasked cosmic ray pixels.
For this PR we resort to use an empirical 1D correction, meaning at the spectral level, after extraction.
desi_compute_fiber_crosstalk
, measure the crosstalkExample, for all z cameras (z0...z9 combined), for all exposures with sky subtraction from Dec 2020.
Mean cross-talk over all 20 bundles (z cameras):
Cross-talk at 9600+-50 A as a function of fiber number (one value per bundle, z cameras):
Mean cross-talk for the b cameras (much smaller ~0.001;
Mean cross-talk for the r cameras (<0.001);
No variation with fiber number is detected for the blue and red cameras.
desi _fit_fiber_crosstalk
, fit the crosstalk as a function of fiber, delta-fiber, and wavelengthdesi_compute_fiber_crosstalk
with a model that varies from camera to cameraExample for NIR (dots are the measurements and the curves the model)
save the output fit parameters in a yaml file. see https://github.com/desihub/desispec/blob/fiber-crosstalk/py/desispec/data/fiber-crosstalk.yaml
correction function
py/desispec/fibercrosstalk.py
(using same kernel convolution etc ...)desi_process_exposure
with option--xtalk
.desi_proc
and disabled with--no-xtalk
Results presented in another post.