Skip to content

Adding MAG L1C day boundary tests#3318

Closed
maxineofficial wants to merge 1 commit into
IMAP-Science-Operations-Center:devfrom
maxineofficial:mag_l1c_unit_tests
Closed

Adding MAG L1C day boundary tests#3318
maxineofficial wants to merge 1 commit into
IMAP-Science-Operations-Center:devfrom
maxineofficial:mag_l1c_unit_tests

Conversation

@maxineofficial

Copy link
Copy Markdown
Contributor

This change adds unit tests for the most basic form of MAG L1C boundaries - ie, a single L1B file from the previous day is used to fill gaps at the beginning of a current L1B file.

sapols added a commit to sapols/imap_processing that referenced this pull request Jul 6, 2026
…AP-Science-Operations-Center#2925)

When the processing day opens with a gap, generate the missing normal-mode
timestamps on the previous day's grid - inheriting its ending cadence and
phase from an optional previous-day norm L1B dataset - so the L1C timeline
stays regular across the day boundary. With no (usable) previous-day file,
behavior is unchanged and single-day processing still succeeds.

- mag_l1c()/process_mag_l1c() gain an optional previous_day_dataset. The
  inherited grid anchors on the last sample within the previous 24-hour day
  and snaps its cadence against the known MAG rates via _is_expected_rate.
  With no normal-mode data at all, the whole window continues that grid.
- Mag CLI splits L1C dependencies by start date with
  get_valid_inputs_for_start_date; the previous day's norm L1B (delivered
  via a date_range entry in imap_mag_dependencies.yaml) routes to
  previous_day_dataset. Mode/sensor validation lives in mag_l1c.
- generate_missing_timestamps no longer routes integer nanosecond gap
  bounds through float64 (np.rint), which shifted generated timestamps by
  up to 64 ns at TTJ2000 scales.
- Un-xfail the day-boundary tests from IMAP-Science-Operations-Center#3318; their phase offset moves to a
  multiple of 128 ns because the float64 epoch columns cannot represent
  other offsets exactly at 2025-era epochs. Shared test helper
  _ttj2000_day_bounds is replaced by the production _expected_day_ns.
@alastairtree

alastairtree commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Think this can now be closed in favour of #3323 now?

@sapols sapols closed this Jul 15, 2026
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