Skip to content

IDEX l1b cli logic#2859

Merged
lacoak21 merged 3 commits intoIMAP-Science-Operations-Center:devfrom
lacoak21:idex_l1b_only_select_most_recent_l1b
Mar 23, 2026
Merged

IDEX l1b cli logic#2859
lacoak21 merged 3 commits intoIMAP-Science-Operations-Center:devfrom
lacoak21:idex_l1b_only_select_most_recent_l1b

Conversation

@lacoak21
Copy link
Contributor

Change Summary

Overview

Now that IDEX l1b dependencies may have multiple science files pass in from batch starter, we want to make sure that we are only passing in the latest l1a file.

File changes

imap_processing/cli.py

  • only pass in the latest idex l1a file to l1b.

Testing

Add a test to make sure the sorting is working.

@lacoak21 lacoak21 added this to the March 2026 milestone Mar 23, 2026
@lacoak21 lacoak21 requested review from Copilot and tech3371 March 23, 2026 20:42
@lacoak21 lacoak21 self-assigned this Mar 23, 2026
@lacoak21 lacoak21 added this to IMAP Mar 23, 2026
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

Updates the IDEX CLI processing path so that when multiple IDEX science inputs are provided for L1B processing, only the most recent (by time) L1A dataset is passed into idex_l1b, and adds a CLI unit test intended to verify the sorting behavior.

Changes:

  • Update Idex.do_processing() (L1B) to load multiple candidate science CDFs and select the latest by epoch.
  • Add a CLI test that patches idex_l1b and asserts the newest dataset is selected.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
imap_processing/cli.py Load all IDEX L1B candidate science inputs and select the latest dataset by epoch before calling idex_l1b.
imap_processing/tests/test_cli.py Add a unit test to validate that the CLI selects the newest dataset when multiple science files are present.

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

Copy link
Contributor

@tech3371 tech3371 left a comment

Choose a reason for hiding this comment

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

I already forgot why we are using latest. Can you add comment about why that is the case?

@lacoak21 lacoak21 force-pushed the idex_l1b_only_select_most_recent_l1b branch from 3519f26 to 7ea8894 Compare March 23, 2026 21:22

# Convert nominal_bins to int32 for indexing
spin_bins = nominal_bins.astype(np.int32)
spin_bins: npt.NDArray[np.int32] = nominal_bins.astype(np.int32)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@subagonsouth I was dealing with a mypy failure here on this line.

@lacoak21 lacoak21 merged commit b0fd87c into IMAP-Science-Operations-Center:dev Mar 23, 2026
14 checks passed
@lacoak21 lacoak21 deleted the idex_l1b_only_select_most_recent_l1b branch March 23, 2026 22:20
@github-project-automation github-project-automation bot moved this to Done in IMAP Mar 23, 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.

4 participants