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

Use Numpy arrays in data products instead of quantities #1374

Open
stscijgbot-rstdms opened this issue Aug 21, 2024 · 2 comments
Open

Use Numpy arrays in data products instead of quantities #1374

stscijgbot-rstdms opened this issue Aug 21, 2024 · 2 comments

Comments

@stscijgbot-rstdms
Copy link
Collaborator

Issue RCAL-897 was created on JIRA by Nadia Dencheva:

Currently data arrays (excluding dq) are astropy quantities, i.e. they combine arrays with astropy units

Proposal:

  • all data should be kept as arrays
  • Create a separate section about units where units will be kept as strings
  • Add properties to the respective datamodels to allow users to access the data as quantities.

Pros of using astropy quantities

  • The units live with the data
  • User and data analysis tools friendly

Cons of using astropy quantities

  • Schemas are more complex and tied to a Python implementation
  • Quantities do not compress
  • Keeping files simpler is beneficial for an archival format
  • Changes to astropy units may break backwards compatibility, requiring more resources for future maintenance

Timing: If accepted this change should be completed soon after Build 15 delivery on Sep 15.

Decision: This change should be agreed on by INS and SCSB

@schlafly
Copy link
Collaborator

As a note, we use quantities in a few different places:

  • for different data extensions, e.g., WfiScienceRaw.data must be a DN
  • for reference files, e.g., dark.data must be in DN
  • for things like the photometry reference file, photom['phot_table']['pixelareasr'] must be in steradians (i.e., scalars).
    I think the proposal is to remove all of these.

I'm not sure I've understood yet what the separate section about units means.

It might be nice if this were in the schema around here
https://github.com/spacetelescope/rad/blob/main/src/rad/resources/schemas/photometry-1.0.0.yaml#L9-L25
but instead we just had unit: "MJy.sr**-1" parallel with the description instead of the current scheme. I don't know if any of that information propagates to roman_datamodels, though, or how we would want to expose it there.

@braingram
Copy link
Collaborator

xref: spacetelescope/rad#438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants