Skip to content

Lo: replace EsaCalibration class with an xarray Dataset - #3385

Merged
jaredclaypoole merged 2 commits into
IMAP-Science-Operations-Center:devfrom
jaredclaypoole:issue3366
Aug 13, 2026
Merged

Lo: replace EsaCalibration class with an xarray Dataset#3385
jaredclaypoole merged 2 commits into
IMAP-Science-Operations-Center:devfrom
jaredclaypoole:issue3366

Conversation

@jaredclaypoole

Copy link
Copy Markdown
Contributor

Closes #3366

Change Summary

Overview

Lo: replace EsaCalibration class with an xarray Dataset

  • EsaCalibration was used only in lo_l2 processing

File changes

  • imap_processing/lo/l2/lo_l2.py

    • Function _esa_calibration
      • Changed return type: EsaCalibration -> xr.Dataset
      • Construct a dataset with energy dim rather than EsaCalibration namedtuple fields
    • Function _calculate_rates_and_intensities
      • Takes and uses an xr.Dataset rather than EsaCalibration object
    • Function _build_map_dataset
      • Takes and uses an xr.Dataset rather than EsaCalibration object
  • imap_processing/lo/constants.py

    • Removed the now-unused EsaCalibration class

Testing

No change to tests. This code change is exercised by various test functions that call lo_l2 in imap_processing/tests/lo/test_lo_l2.py.

* EsaCalibration was used only in lo_l2 processing
Comment thread imap_processing/lo/l2/lo_l2.py Outdated
Comment thread imap_processing/lo/l2/lo_l2.py Outdated

@tmplummer tmplummer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. I appreciate the effort to centralize on using xarray objects. I approve but will let Vineet be the gatekeeper by not actually hitting approve.

@vineetbansal vineetbansal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @jaredclaypoole, @tmplummer - looks much cleaner now. I see why we'd want to stick to this pattern in the future.

@jaredclaypoole
jaredclaypoole merged commit 5df1485 into IMAP-Science-Operations-Center:dev Aug 13, 2026
14 checks passed
@jaredclaypoole
jaredclaypoole deleted the issue3366 branch August 13, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use xarray

3 participants