Skip to content
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

Barycentric Corrections fail when both TARGTRA and RA are unassigned #896

Open
akremin opened this issue Mar 2, 2020 · 1 comment
Open
Labels

Comments

@akremin
Copy link
Member

akremin commented Mar 2, 2020

Barycentric Correction Fails for some old exposures where the header keys aren't properly labeled. This is a fringe case that hasn't appeared in the most recent month of data.

RUNNING: desi_extract_spectra -w 7520.0,9824.0,0.8 -i /global/cfs/cdirs/desi/spectro/redux/daily/preproc/20200122/00043028\
/preproc-z7-00043028.fits -p /global/cfs/cdirs/desi/spectro/redux/daily/exposures/20200122/00043028/psf-z7-00043028.fits -\
o /global/cfs/cdirs/desi/spectro/redux/daily/exposures/20200122/00043028/frame-z7-00043028.fits --psferr 0.1 --barycentric\
-correction
Traceback (most recent call last):
  File "/global/homes/k/kremin//workspace/most_recent_calib/desispec/bin/desi_proc", line 664, in <module>
    desispec.scripts.extract.main_mpi(extract_args, comm=comm_extract)
  File "/global/homes/k/kremin/workspace/most_recent_calib/desispec/py/desispec/scripts/extract.py", line 337, in main_mpi
    barycentric_correction_factor = barycentric_correction_multiplicative_factor(img.meta)
  File "/global/homes/k/kremin/workspace/most_recent_calib/desispec/py/desispec/scripts/extract.py", line 95, in barycentr\
ic_correction_multiplicative_factor
    raise KeyError("no TARGTRA nor RA in header")
KeyError: 'no TARGTRA nor RA in header'
@sbailey
Copy link
Contributor

sbailey commented Mar 2, 2020

For this exposure, TARGTRA is in the FIBERMAP HDU but not in the primary HDU.

In the raw data on 20200122, TARGTRA is in the SPS HDU (now called SPEC) but not in the per-camera HDUs. More recent data has it in the per-camera HDUs too.

desispec could try using the fibermap header (fibermap.met) if the img.meta header fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants