desihub / desispec

DESI spectral pipeline
BSD 3-Clause "New" or "Revised" License
35 stars 24 forks source link

write_spectra adding fibermap comments is broken #2171

Closed sbailey closed 6 months ago

sbailey commented 7 months ago

desispec.io.write_spectra attempts to add comment fields to the output fibermap using desispec.io.fibermap.fibermap_comments. However, the structure of fibermap_comments has changed which silently broke adding comments (or perhaps it was never right in the first place, I haven't dug into the history).

I think the new structure is

fibermap_comments[survey][colname] = comment

whereas write_spectra throught it was just fibermap_comments[colname] = comment.

Currently only survey='main' exists, and unfortunately the spectra don't propagate SURVEY (yet, see #2170), but it would be reasonable to default to 'main' if write_spectra gets a Spectra object without SURVEY specified.

weaverba137 commented 6 months ago

Note, desispec.io.fibermap.fibermap_columns is not actually intended to be used 'out of the box', but only after desispec.io.fibermap._set_fibermap_columns() is run. That fills in the other surveys. I don't know if there's a better way of doing that.

weaverba137 commented 6 months ago

Confirming that this will be closed by #2176.

weaverba137 commented 6 months ago

This didn't get automatically closed by #2176, closing.