Skip to content

Change MAX_FINE_TIME to a constant value and fix time conversion#3113

Merged
tmplummer merged 1 commit into
IMAP-Science-Operations-Center:devfrom
alastairtree:fix/mag-time-off-by-one-#2464
Jul 10, 2026
Merged

Change MAX_FINE_TIME to a constant value and fix time conversion#3113
tmplummer merged 1 commit into
IMAP-Science-Operations-Center:devfrom
alastairtree:fix/mag-time-off-by-one-#2464

Conversation

@alastairtree

Copy link
Copy Markdown
Collaborator

Fixes #2464 - go there for in depth discussion

@alastairtree

Copy link
Copy Markdown
Collaborator Author

pre-commit.ci autofix

Comment thread imap_processing/mag/l1a/mag_l1a_data.py Outdated
Comment thread imap_processing/mag/constants.py
@maxineofficial

Copy link
Copy Markdown
Contributor

@alastairtree I'm happy to merge once the tests are failing and you're ready. It looks like the L1B validation uses the code you updated to calculate the expected L1A timestamps from the input files... if that's annoying for you to update, let me know and I can fix the tests.

…Center#2464)

Fine clock ticks run 0..65535 then roll over, so each tick is
1/65536th of a second, not 1/65535th. Changing MAX_FINE_TIME to 65536
fixes the existing coarse/fine <-> seconds conversions without further
changes, and to_j2000ns now goes through to_seconds() so it also
benefits from the corrected sclk-aware met_to_ttj2000ns conversion.

Also update MAG L1b validation timestamps for fine-time fix. Regenerated the expected 't' column in T009-T012 mago/magi CSVs by
rerunning the exact test setup with the corrected TimeTuple
conversion, so the expected times reflect the ~15us/tick fine-time
correction rather than the old off-by-one values. No other columns
changed.
@alastairtree alastairtree force-pushed the fix/mag-time-off-by-one-#2464 branch from 4480c14 to dd63b4e Compare July 10, 2026 08:59
@alastairtree

Copy link
Copy Markdown
Collaborator Author

I have addressed all the comments, fixed the test data and and rebased this so should be ready to merge I hope @maxinelasp

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

Great. Thanks @alastairtree!

@tmplummer tmplummer merged commit 2d7ee43 into IMAP-Science-Operations-Center:dev Jul 10, 2026
14 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.

BUG - possible bug in MAG time conversion

3 participants