Implement method to populate meta.statistics attribute for datamodels.#2248
Implement method to populate meta.statistics attribute for datamodels.#2248mairanteodoro wants to merge 11 commits intospacetelescope:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2248 +/- ##
==========================================
+ Coverage 80.58% 80.63% +0.05%
==========================================
Files 155 156 +1
Lines 9341 9368 +27
==========================================
+ Hits 7527 7554 +27
Misses 1814 1814 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for putting this together. Now that romancal/romancal/resample/resample_step.py Lines 180 to 183 in 2aaaad7 |
schlafly
left a comment
There was a problem hiding this comment.
This looks like a good implementation to me; I would not have thought of doing it through finalize_result, but it's nice that that means that all intermediate products get flags too.
I have a suggestion below for only computing the medians and rmses from the good pixels, though I don't expect that to make a meaningful difference in practice.
Let's not populate zodiacal_light for L3 files; it's not in the schema and it doesn't make a lot of sense.
|
It looks like my suggestion fails because err does not exist. It's required, though, so I'm a bit confused; presumably some test code hadn't needed it before and now is failing? |
|
Yes, I'm updating the code and unit tests to account for that. |
Co-authored-by: Brett Graham <brettgraham@gmail.com>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
It only includes pixels that pass three tests: - DQ flag is clean (DO_NOT_USE is not set); - error/uncertainty is positive (model.err > 0); - the data is finite (NaN and Inf are removed). Co-authored-by: Eddie Schlafly <eschlafly@gmail.com>
Resolves RCAL-999
This PR implements a new
romancal.lib.statistics.populate_statistics()helper and wires it intoRomanStep.finalize_result()so that any Roman step that produces anImageModelorMosaicModeloutput will havemeta.statisticspopulated automatically.Regression tests
meta.statisticsattribute being added, which will be fixed once the truth files have been "okified."Tasks
24Q4_B15(use the latest build if not sure)no-changelog-entry-needed)changes/:echo "changed something" > changes/<PR#>.<changetype>.rst(see changelog readme for instructions)changes/<PR#>.breaking.rstnews fragmentdocs/pageokify_regteststo update the truth files