3165 bug hi l2 problems propegating error and uncertainty in maps#3166
Open
tmplummer wants to merge 3 commits intoIMAP-Science-Operations-Center:devfrom
Conversation
…me causing NaN fluxes to become zeros
… error nans to not propegate into combined product
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses NaN propagation bugs in Hi L2 ENA map uncertainty/error variables, ensuring that NaNs are preserved through interpolation, clamping, and calibration-product/map combination logic.
Changes:
- Preserve NaNs when clamping negative interpolated flux values by switching to
xr.where. - Adjust Hi L2 systematic error computation and calibration-product systematic error aggregation to avoid incorrect non-NaN outputs.
- Add regression tests covering NaN propagation in heliocentric interpolation and NaN handling during map combination.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
imap_processing/ena_maps/utils/corrections.py |
Updates negative-flux clamping to preserve NaNs during heliocentric-frame interpolation. |
imap_processing/hi/hi_l2.py |
Tweaks systematic error computation (warning suppression) and systematic error aggregation across calibration products. |
imap_processing/tests/ena_maps/test_corrections.py |
Adds a test verifying NaN inputs propagate to NaN outputs through interpolation. |
imap_processing/tests/hi/test_hi_l2.py |
Adds a test ensuring NaN statistical uncertainties don’t poison combined-map results. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test the correct function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
Overview
Fix NaN propagation issues in Hi L2 ena_intensity_stat_uncert and ena_intensity_sys_err variables.
Changes
imap_processing/ena_maps/utils/corrections.py
imap_processing/hi/hi_l2.py
imap_processing/tests/ena_maps/test_corrections.py
imap_processing/tests/hi/test_hi_l2.py
Closes: #3165