desihub / fastspecfit

Fast spectral synthesis and emission-line fitting of DESI spectra.
https://fastspecfit.readthedocs.org
BSD 3-Clause "New" or "Revised" License
13 stars 2 forks source link

updating the data model #188

Open moustakas opened 3 days ago

moustakas commented 3 days ago

The current data model consists of two FITS extensions: METADATA and FASTSPEC, which can be reviewed here: https://fastspecfit.readthedocs.io/en/latest/fastspec.html.

The number of columns in the FASTSPEC HDU is approaching ~1000 columns, however, which has become too unwieldy, and also doesn't allow for expansion of the data model.

Consequently, I propose expansion to three extensions, METADATA, FASTSPEC, and SPECPHOT, as summarized in the following document: https://docs.google.com/spreadsheets/d/1DnCPhu-62b8JgC7ZjY422sh9I006lJ4a1gt8Inwij_M/edit?gid=0#gid=0

Feedback is more than welcome.

moustakas commented 3 days ago

Note that a nice snippet of code to convert from TSNR2 to EFFTIME was provided by @araichoor on-list

def get_snr2time(tracer):
    ensemble_dir = os.path.join(os.getenv("DESIMODEL"), "data", "tsnr")
    fn = os.path.join(ensemble_dir, "tsnr-ensemble-{}.fits".format(tracer.lower()))
    return fits.getheader(fn, 0)["SNR2TIME"]

for tracer in ["BGS", "LRG", "ELG", "QSO", "LYA"]:
    print("{}\t{}".format(tracer, get_snr2time(tracer)))

=>

BGS    0.1400000003119347
LRG    12.15060572324326
ELG    8.60000036161418
QSO    33.6094737399845
LYA    11.80090901380597