desihub / desihub/desispec

Barycentric Corrections fail when both TARGTRA and RA are unassigned

Open
#896 1 comment 0 reactions 0 assignees View on GitHub
crash
Dominant language
Python
Stars
42
Forks
26
Avg merge
1d 21h
Merged PRs (30d)
15

Description

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
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'
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in py/desispec/scripts/extract.py, especially barycentric_correction_multiplicative_factor and its call from main_mpi. Reproduce the reported desi_extract_spectra case with headers lacking both TARGTRA and RA, then inspect nearby tests or metadata handling to establish the expected behavior for these old exposures and verify that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.