Skip to content

Conversation

@subagonsouth
Copy link
Contributor

…ergy units

Update docstring to clarify unit requirements

Change Summary

Overview

  • Adds a test that confirms that the interpolate_map_flux_to_helio_frame function is not sensitive to input energy units as long as they are consistent across input energies.
  • Updates variable names and documentation to remove requirement that energies are in units of eV.

Closes: 2551

…ergy units

Update docstring to clarify unit requirements
Copy link
Contributor

Copilot AI left a 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_ev to esa_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):
Copy link

Copilot AI Jan 5, 2026

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".

Suggested change
def test_energy_unit_insensivity(self):
def test_energy_unit_insensitivity(self):

Copilot uses AI. Check for mistakes.
Comment on lines 1176 to 1183
# 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"]
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@subagonsouth subagonsouth merged commit 19485e1 into IMAP-Science-Operations-Center:dev Jan 6, 2026
14 checks passed
@github-project-automation github-project-automation bot moved this to Done in IMAP Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants