-
Notifications
You must be signed in to change notification settings - Fork 26
JP-3887: Add photometric time dependence tables #555
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #555 +/- ##
==========================================
+ Coverage 90.10% 90.14% +0.04%
==========================================
Files 110 110
Lines 5317 5339 +22
==========================================
+ Hits 4791 4813 +22
Misses 526 526 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Regression tests here with spacetelescope/jwst#9736: Tests show one very small change to the background level value for one input file. This appears to be precision related, from minor changes to the way the time dependence is calculated for MIRI imaging photom corrections: the background level fit in skymatch is sensitive to very small changes in the data. There is otherwise no impact to the output data. Downstream jwst tests are failing because the tests attempt to access the old "timecoeff" extension directly in a MIRI imaging photom model, so merging this PR will need to be coordinated with the jwst PR. |
da5b3ed to
daa91ad
Compare
|
Rerunning regression tests after adding MIRI MRS changes: |
fabeeb7 to
1a55e71
Compare
emolter
left a comment
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.
All my questions have been answered but I'd feel more comfortable if this had a second reviewer. I guess that'd be @tapastro in this case
33fff17 to
166844b
Compare
tapastro
left a comment
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, with one suggestion on validation.
| timecoeff = ["timecoeff_linear", "timecoeff_exponential", "timecoeff_powerlaw"] | ||
| for extension in timecoeff: | ||
| message = f"Model.phot_table and Model.{extension} do not match" | ||
| if self.hasattr("phot_table") and self.hasattr(extension): |
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.
This is probably an unlikely case, but I think a model with no phot_table extension would pass validation due to it failing this if statement. If we're going to attempt validation, it probably needs an explicit check for the phot_table before this?
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.
Sure, I can add that. I thought about adding that check and decided to allow an empty photom file, since only the check on the time coeff tables was requested. But you're right that it's definitely not a useful photom file without the phot_table, so we might as well check for it while we're validating.
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.
See 1ab79ec
tapastro
left a comment
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.
👍
|
Thanks for reviewing! This PR will need to be coordinated with merging spacetelescope/jwst#9736. When that one is approved, I will:
|
1ab79ec to
95def10
Compare
Partially resolves JP-3887
Corresponding jwst PR is: spacetelescope/jwst#9736
This PR adds time dependence coefficient tables to all photom models, except MirMrsPhotomModel, which already has time coefficient extensions that need a different form from the others. MirImgPhotomModel also had a time coefficients table, but needs to move to the new format to allow more flexibility.
3 optional tables are added to each model: timecoeff_linear, timecoeff_exponential, and timecoeff_powerlaw. Any, all, or none may be present, and the photom code will compose the correction from the appropriate functional forms.
I also added some validation code for all photom models (except MIRI MRS) to verify that if present, the timecoeff extensions match the phot_table rows.
Tasks
docs/pageno-changelog-entry-needed)changes/:echo "changed something" > changes/<PR#>.<changetype>.rst(see below for change types)jwstregression tests with this branch installed ("git+https://github.com/<fork>/stdatamodels@<branch>")news fragment change types...
changes/<PR#>.feature.rst: new featurechanges/<PR#>.bugfix.rst: fixes an issuechanges/<PR#>.doc.rst: documentation changechanges/<PR#>.removal.rst: deprecation or removal of public APIchanges/<PR#>.misc.rst: infrastructure or miscellaneous change