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

propagate MJD to spectra fibermap #944

Merged
merged 3 commits into from Apr 3, 2020
Merged

propagate MJD to spectra fibermap #944

merged 3 commits into from Apr 3, 2020

Conversation

sbailey
Copy link
Contributor

@sbailey sbailey commented Apr 3, 2020

This PR fixes #852 by propagating the MJD-OBS header keyword to a MJD column in the output fibermap of spectra files (similar to propagating NIGHT, EXPID, and TILEID).

Tested with:

cd /global/cfs/cdirs/desi/spectro/redux/minisv2/tiles/70002/20200304
desi_group_spectra --inframes cframe-?0-*.fits --outfile $SCRATCH/spectra.fits

and verifying that the output file has an MJD column filled into the FIBERMAP table.

@sbailey sbailey requested a review from akremin April 3, 2020 19:14
@sbailey sbailey added this to In progress in Data Release 20.4 via automation Apr 3, 2020
@@ -181,9 +181,11 @@ def read(cls, filename):
nspec = len(fibermap)
night = np.tile(header['NIGHT'], nspec).astype('i4')
expid = np.tile(header['EXPID'], nspec).astype('i4')
mjd = np.tile(header['MJD-OBS'], nspec).astype('f8')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MJD-OBS is a pretty fundamental keyword that should be in every exposure, but are we confident enough of this card's existence that we want the code to fail if it isn't there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I updated code to support "MJD-OBS" (current data), "MJD" (older sims), and not crash if both are missing (still propagates an MJD=-1 column to keep the data model consistent).

@akremin akremin merged commit 734fd68 into master Apr 3, 2020
Data Release 20.4 automation moved this from In progress to Done Apr 3, 2020
@akremin akremin deleted the spectra-timestamp branch April 3, 2020 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

propagate DATE-OBS and/or MJD to output spectra
2 participants