lo l1b goodtimes and bgrates write out bad cdfs#3218
Merged
tmplummer merged 1 commit intoMay 18, 2026
Conversation
Contributor
There was a problem hiding this comment.
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
epochandesa_stepto the combined L1B dataset and explicitly mark them as coordinates. - Adjust
esa_stepcoordinate 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 thatepochis a real dimension on the goodtimes dataset (e.g.,"epoch" in l1b_goodtimes_ds.dims) in addition to checking for anepochcoordinate.
# 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.
tech3371
approved these changes
May 18, 2026
laspsandoval
approved these changes
May 18, 2026
Contributor
laspsandoval
left a comment
There was a problem hiding this comment.
Looks good. Thanks Tim.
96e799f
into
IMAP-Science-Operations-Center:dev
18 checks passed
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 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