Skip to content

lo l1b goodtimes and bgrates write out bad cdfs#3218

Merged
tmplummer merged 1 commit into
IMAP-Science-Operations-Center:devfrom
tmplummer:3217-bug---lo-l1b-goodtimes-bgrates-write-bad-cdfs
May 18, 2026
Merged

lo l1b goodtimes and bgrates write out bad cdfs#3218
tmplummer merged 1 commit into
IMAP-Science-Operations-Center:devfrom
tmplummer:3217-bug---lo-l1b-goodtimes-bgrates-write-bad-cdfs

Conversation

@tmplummer
Copy link
Copy Markdown
Contributor

Change Summary

Overview

Fix bug from latest Lo bugfix that caused coordinates to not be in the dataset. I introduced this bug by miscalling assign_coords.
Added check that coordinates are in output datasets.

Closes: #3217

Copy link
Copy Markdown
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

Fixes a regression in IMAP-Lo L1B background-rates/goodtimes generation where epoch/esa_step were not being written as coordinates (leading to malformed CDFs and downstream xarray isel(epoch=...) failures in L1C processing).

Changes:

  • Correctly add epoch and esa_step to the combined L1B dataset and explicitly mark them as coordinates.
  • Adjust esa_step coordinate values to match the expected 1-based ESA step numbering (1..N).
  • Add test assertions to ensure required coordinates exist in the L1B bgrates/goodtimes outputs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
imap_processing/lo/l1b/lo_l1b.py Fixes coordinate assignment for epoch/esa_step in the L1B bgrates+goodtimes dataset prior to splitting/writing.
imap_processing/tests/lo/test_lo_l1b.py Adds regression checks ensuring produced datasets include expected coordinates.
Comments suppressed due to low confidence (1)

imap_processing/tests/lo/test_lo_l1b.py:2226

  • For a more direct guard against the downstream isel(epoch=...) failure, consider asserting that epoch is a real dimension on the goodtimes dataset (e.g., "epoch" in l1b_goodtimes_ds.dims) in addition to checking for an epoch coordinate.
    # Check that goodtimes dataset is cdf-able by writing to file
    _ = write_cdf(l1b_goodtimes_ds)
    assert "epoch" in l1b_goodtimes_ds.coords

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread imap_processing/tests/lo/test_lo_l1b.py
Copy link
Copy Markdown
Contributor

@laspsandoval laspsandoval left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks Tim.

@tmplummer tmplummer merged commit 96e799f into IMAP-Science-Operations-Center:dev May 18, 2026
18 checks passed
@tmplummer tmplummer deleted the 3217-bug---lo-l1b-goodtimes-bgrates-write-bad-cdfs branch May 18, 2026 21:14
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.

BUG - Lo L1B goodtimes bgrates write bad cdfs

4 participants