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

Allow table column units to be defined in data model schemas #2869

Open
hbushouse opened this issue Nov 15, 2018 · 0 comments
Open

Allow table column units to be defined in data model schemas #2869

hbushouse opened this issue Nov 15, 2018 · 0 comments

Comments

@hbushouse
Copy link
Collaborator

hbushouse commented Nov 15, 2018

Steven Beard from the MIRI IDT tried setting units for table columns in a reference file schema via the TUNITn keywords and found that all reserved FITS keywords (like TUNITn) get ignored and stripped out of a data model when it's serialized to a FITS file (by design). The current method of setting table column units is to set the table.columns[name].unit attribute in an instance of the data model itself, rather than defining it in the schema. It would be nice if column units could be defined in the schema, along with other column attributes like name and datatype, e.g.

- name: wavelength
  datatype: float32
  unit: um

Steven seems to have devised a way to do this in the MIRI version of the jwst code:

With your guidance, I have solved the problem in a way which works with all the existing
MIRI data models. The schema now defines the default unit for each table column. If a
user provides a table with no units defined, those defaults are adopted. If a user
provides table units explicitly, those units are used but the user receives a warning if
there is a mismatch. I think this solution works for the MIRI calibration data products,
where each data product is described in an accompanying document, and the units
described in the document must match the ones defined in the schema. There is no 
requirement to convert units, since each CDP only passes its verification test when
the units match.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants