Skip to content

ULTRA l1b: update de event time calculation - #3480

Merged
lacoak21 merged 9 commits into
IMAP-Science-Operations-Center:devfrom
lacoak21:ultra_l1b_event_time_calc_only_use_instrument_spin
Oct 6, 2026
Merged

lacoak21 merged 9 commits into
IMAP-Science-Operations-Center:devfrom
lacoak21:ultra_l1b_event_time_calc_only_use_instrument_spin

Conversation

@lacoak21

Copy link
Copy Markdown
Contributor

Change Summary

closes #2525

Overview

Use only spin phase from the aux packet to calculate event times. The ULTRA team does not want a fall back to the universal spin table. This was discussed at the most recent ULTRA tagup. I investigated past logs and only 1- ~10 events are not covered by the aux table time range.

File changes

  • imap_processing/quality_flags.py
    • add new flag
  • imap_processing/ultra/l1b/de.py
    • make sure spins that are nan are converted to fillval
      -imap_processing/ultra/l1b/extendedspin.py
    • Invalid spins need to be handled very carefully! We dont want to actually use them in extendedspin.py calculations.
    • imap_processing/ultra/l1b/ultra_l1b_extended.py
      • update event time calculation to return nan for data outside of the aux dataset.

@lacoak21
lacoak21 requested review from bryan-harter, tech3371 and tmplummer and a balanced review from Copilot September 21, 2026 20:49
@lacoak21 lacoak21 self-assigned this Sep 21, 2026
@lacoak21 lacoak21 added this to IMAP Sep 21, 2026

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.

Copilot review overview

🟡 Changes recommended

Missing auxiliary coverage can still cause incorrect timestamps or abort downstream processing.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity · 2 Medium severity

Open (3)
What changed in this PR

Updates ULTRA L1B event timing to rely exclusively on auxiliary spin data.

Changes:

  • Flags and fill-values events outside auxiliary coverage.
  • Excludes invalid spins from Extended Spin calculations.
  • Adds the AUXOUTLIER quality flag and tests.
File Description
imap_processing/​ultra/​l1b/​ultra_l1b_extended.py Removes universal-spin fallback and flags missing auxiliary timing.
imap_processing/​ultra/​l1b/​quality_flag_filters.py Includes AUXOUTLIER in outlier filtering.
imap_processing/​ultra/​l1b/​extendedspin.py Excludes fill-valued spins from binning.
imap_processing/​ultra/​l1b/​de.py Applies timing flags and spin fill values.
imap_processing/​ultra/​constants.py Defines the nominal spin period.
imap_processing/​tests/​ultra/​unit/​test_ultra_l1b_extended.py Tests uncovered-event timing behavior.
imap_processing/​quality_flags.py Defines the new auxiliary outlier flag.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread imap_processing/ultra/l1b/extendedspin.py
Comment thread imap_processing/ultra/l1b/ultra_l1b_extended.py
Comment thread imap_processing/ultra/l1b/ultra_l1b_extended.py
@lacoak21
lacoak21 marked this pull request as draft September 21, 2026 21:17
@lacoak21
lacoak21 requested a balanced review from Copilot September 21, 2026 21:26

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.

Copilot review overview

🟡 Changes recommended

Shared spin lookup behavior and invalid-spin quality flags can still produce incorrect downstream processing.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity · 1 Low severity

Open (3)
Resolved since last review (2)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Mark invalid spin numbers as AUXOUTLIER

imap_processing/​ultra/​l1b/​de.py:218

Missing or fill-valued spin numbers are converted to the output sentinel here without setting AUXOUTLIER. When an AUX row has valid timing fields but an invalid spinnumber, get_event_times() leaves quality_outliers clear. Extended Spin excludes the event by its fill-valued spin, but the culling summaries still treat it as valid and bin it by de_event_met. Set AUXOUTLIER for the same invalid-spin mask before writing the spin array.

Comment thread imap_processing/ultra/l1b/ultra_l1b_extended.py
Comment thread imap_processing/ultra/l1c/ultra_l1c_pset_bins.py Outdated
@lacoak21
lacoak21 force-pushed the ultra_l1b_event_time_calc_only_use_instrument_spin branch from 95ae729 to f24a513 Compare September 22, 2026 19:48

@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.

This all looks reasonable to me.

Comment thread imap_processing/ultra/l1b/ultra_l1b_extended.py Outdated
@lacoak21
lacoak21 marked this pull request as ready for review September 24, 2026 15:10
@lacoak21
lacoak21 force-pushed the ultra_l1b_event_time_calc_only_use_instrument_spin branch from f24a513 to c0a8334 Compare October 5, 2026 14:42
@lacoak21

lacoak21 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

This all looks reasonable to me.

@tmplummer do you think you could approve this?

@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.

🚀

@lacoak21
lacoak21 merged commit 37da53a into IMAP-Science-Operations-Center:dev Oct 6, 2026
22 checks passed
@lacoak21
lacoak21 deleted the ultra_l1b_event_time_calc_only_use_instrument_spin branch October 6, 2026 17:19
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.

ULTRA l1b use universal spin table to get event times

3 participants