-
Notifications
You must be signed in to change notification settings - Fork 22
Confirm that interpolate_map_flux_to_helio_frame is insensitive to en… #2552
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
…ergy units Update docstring to clarify unit requirements
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.
Pull request overview
This PR makes the interpolate_map_flux_to_helio_frame function unit-agnostic for energy inputs, requiring only that energy units are consistent across inputs. The changes remove the hardcoded requirement for eV units in both the implementation and documentation.
Key Changes:
- Added test to verify function produces identical results with different energy units (eV vs keV)
- Renamed parameters from
esa_energies_ev/helio_energies_evtoesa_energies/helio_energies - Updated docstring to clarify that any energy unit is acceptable as long as inputs are consistent
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
imap_processing/tests/ena_maps/test_corrections.py |
Adds unit insensitivity test comparing eV and keV results |
imap_processing/ena_maps/utils/corrections.py |
Removes eV-specific naming and updates documentation to reflect unit flexibility |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| == map_ds["ena_intensity_sys_err"].shape | ||
| ) | ||
|
|
||
| def test_energy_unit_insensivity(self): |
Copilot
AI
Jan 5, 2026
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.
The test method name contains a spelling error. The word should be "insensitivity" (with an 's'), not "insensivity".
| def test_energy_unit_insensivity(self): | |
| def test_energy_unit_insensitivity(self): |
| # Verify results are the same | ||
| np.testing.assert_array_equal(ev_ds["ena_intensity"], kev_ds["ena_intensity"]) | ||
| np.testing.assert_array_equal( | ||
| ev_ds["ena_intensity_stat_uncert"], kev_ds["ena_intensity_stat_uncert"] | ||
| ) | ||
| np.testing.assert_array_equal( | ||
| ev_ds["ena_intensity_sys_err"], kev_ds["ena_intensity_sys_err"] | ||
| ) |
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.
xr.testing.assert_equal(ev_ds, kev_ds) ?
https://docs.xarray.dev/en/stable/generated/xarray.testing.assert_equal.html
19485e1
into
IMAP-Science-Operations-Center:dev
…ergy units
Update docstring to clarify unit requirements
Change Summary
Overview
interpolate_map_flux_to_helio_framefunction is not sensitive to input energy units as long as they are consistent across input energies.eV.Closes: 2551