use single precision for outputs; update readers #329
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes several changes for Redrock I/O:
redrock.results.read_zscanfor reading rrdetails filesnozfit=Trueto return just the chi2 vs. z (zscan) results, not including the zfit tablesredrock.results.read_zfitto read+stack the Nth best fit zfit tablesread_zscanandread_zfitupper=Trueto force columns to UPPERCASE like most DESI filesselect_targetidsto accept a single integer in addition to list/arrays of integersThe output precision change was motivated by deishub/desispec#2456 suggesting to use smaller redshift steps in zscan, in which case the rrdetails files were getting rather large. With this update, smaller steps in the galaxy scan results in files with the same size as before.
I did not change the precision of the outputs in the redrock*.fits table. I think we should do that too, but since those are used more and propagate into the final redshift tables for a production, I wanted to get a second opinion before making that update.
Example outputs in /pscratch/sd/s/sjbailey/desi/redrock/io, with originals in the loa subdirectory:
fitsdiff confirms that redrock-2-1263-thru20240212-float32.fits and loa/redrock-2-1263-thru20240212.fits are still identical except for headers (though I suggest we downgrade the precision of some of the redrock columns).
rrdetails-2-1263-thru20240212-float32.h5 is 2x smaller than the original loa file.
a gotcha for consideration: currently redrock uses zchi2=9e+99 for the chi2 of a complete failed fit, which gets converted into inf for float32. That could be a pain, and we should consider using a smaller placeholder value for float32 chi2 of fit failures (e.g. 3e33).
results