-
Notifications
You must be signed in to change notification settings - Fork 28
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
Rcal 406 science array quantities #616
Rcal 406 science array quantities #616
Conversation
…o ArrayQuanitites
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Good
romancal/flatfield/flat_field.py
Outdated
ru.electron ** 2 / u.s ** 2, dtype=science.data.value.dtype) | ||
|
||
err_sqrt = np.sqrt(science.var_poisson.value + science.var_rnoise.value + science.var_flat) | ||
science.err = u.Quantity(err_sqrt, ru.electron / u.s, dtype=err_sqrt.dtype) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we don't need to touch most of this section, since flat_data is unitless so things like science.data /= flat_data should do the right thing? What am I missing? One would only need to touch the except: AttributeError stanza, which was deleted here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted
'weights': np.squeeze(weights), | ||
'crmag': crmag | ||
'crmag': u.Quantity(crmag, ru.electron, dtype=pedestal.dtype), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we added these units back at the opt_info stage instead of here, we wouldn't need to repeat adding these units in create_image_model?
out_model.groupdq = out_data.groupdq[0] | ||
# Roman 2D | ||
out_model.pixeldq = out_data.pixeldq | ||
out_model.err = out_data.err[0] | ||
out_model.err = u.Quantity(out_data.err[0], ru.DN, dtype=out_data.err.dtype) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Staring at this; does it make more sense to add these units onto out_data in process(...) following the do_correction call? Harping on my usual imagination that our ideal model should be: units everywhere, except around the calls to stcal, where there's a step beforehand removing units and afterward adding them back?
Resolves RCAL-406
This PR changes science products ndarrays to quantities.
Checklist
CHANGES.rst
under the corresponding subsection