desihub / desispec

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

desi_ztile with pre-existing spectra files #2382

Open sbailey opened 1 month ago

sbailey commented 1 month ago

As a followup to the coaddition fixes in PR #2377, we want to run a post-Kibo prod that will start with symlinks to Kibo spectra files and run coadds and everything downstream of that.

However, ztile calls desispec.scripts.group_spectra.main (desi_group_spectra) to write both the spectra and the coadd files in a single call, since normally this is more efficient to avoid re-reading the spectra files with a separate call to desi_coadd_spectra. But the side effect here is that desi_ztile overwrites the spectra link with a re-gathers spectra file, wasting both time and disk space.

Add hooks in ztile to recognize the case where spectra.fits.gz exists but coadd.fits does not, and only call desi_coadd_spectra in that case instead of desi_group_spectra.