Skip to content

Add per-waveform baseline and RMS statistics to IDEX L1b - #3588

Merged
lacoak21 merged 4 commits into
IMAP-Science-Operations-Center:devfrom
aldo9253:baseline_rms
Nov 9, 2026
Merged

lacoak21 merged 4 commits into
IMAP-Science-Operations-Center:devfrom
aldo9253:baseline_rms

Conversation

@aldo9253

@aldo9253 aldo9253 commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Change Summary

Overview

Add baseline and RMS noise statistics for all six waveforms using the first 3 µs, and use them in L2A processing.

File changes

  • idex_utils.py, idex_l1b.py: calculate and store per-event statistics.
  • idex_l2a.py: use these statistics for SNR and fit initialization, with fallback for older L1B files.
  • L1B CDF metadata and IDEX tests: define and verify the new fields.

Testing

130 IDEX tests passed; Local CDF processing passed.

@aldo9253
aldo9253 marked this pull request as ready for review November 2, 2026 19:38
@lacoak21
lacoak21 requested review from lacoak21 and a balanced review from Copilot November 4, 2026 16:00

Copilot AI 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.

🟢 Approval recommended

No active review issues remain for the waveform-statistics changes and their reuse in L2A processing.

No open issues 🎉

What changed in this PR

Adds per-event baseline and RMS noise statistics for all six IDEX waveforms to L1B products, then reuses them in L2A processing.

Changes:

  • Calculates statistics from finite samples in each waveform’s first 3 µs and stores them with CDF metadata.
  • Uses stored statistics for L2A signal-to-noise ratios and fit initialization, with fallback calculations for older L1B products.
  • Adds tests for window selection, missing samples, statistics reuse, and CDF round-trip preservation.
File Description
imap_processing/​tests/​idex/​test_idex_utils.py Tests baseline and RMS calculations and edge cases.
imap_processing/​tests/​idex/​test_idex_l2a.py Tests statistics reuse, legacy fallback, and fit initialization.
imap_processing/​tests/​idex/​test_idex_l1b.py Verifies all channels’ statistics, units, and CDF round trips.
imap_processing/​idex/​idex_utils.py Adds the shared baseline and RMS calculation helper.
imap_processing/​idex/​idex_l2a.py Consumes stored statistics or calculates missing legacy fields.
imap_processing/​idex/​idex_l1b.py Adds twelve per-event waveform statistics to L1B products.
imap_processing/​cdf/​config/​imap_idex_l1b_variable_attrs.yaml Defines metadata for the new baseline and RMS fields.

Review effort: Balanced

@lacoak21 lacoak21 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! Good refactor! Nothing major just some small requests.

Comment thread imap_processing/idex/idex_l2a.py Resolved
Comment thread imap_processing/idex/idex_l2a.py Resolved
Comment thread imap_processing/idex/idex_utils.py Resolved
time = np.asarray(time, dtype=float)
finite_time = np.isfinite(time)
start = np.min(
np.where(finite_time, time, np.inf), axis=-1, keepdims=True, initial=np.inf

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.

Can you add some comments in here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added

Comment thread imap_processing/idex/idex_utils.py Resolved
@aldo9253

aldo9253 commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

I believe all comments have been addressed.

@lacoak21

lacoak21 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Excellent thanks!

@lacoak21
lacoak21 merged commit 9947beb into IMAP-Science-Operations-Center:dev Nov 9, 2026
22 checks passed
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.

3 participants