Skip to content

Read the full mean motion field from TLE line 2 - #428

Merged
csete merged 1 commit into
csete:masterfrom
hneogy:fix-mean-motion-field-width
Oct 8, 2026
Merged

csete merged 1 commit into
csete:masterfrom
hneogy:fix-mean-motion-field-width

Conversation

@hneogy

@hneogy hneogy commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #426.

The mean motion field is eleven characters wide, but Convert_Satellite_Data() copied ten, so the last decimal was dropped. This copies eleven and moves the terminator to match. buff is fifteen bytes, so there's room.

test-001 now fails if it doesn't read 16.05824518 from its own TLE. With the fix it builds and passes. Its positions move a little against the expected values: up to about 3 m at 1440 minutes, some closer and some further, all still under 10 m.

The 604 CelesTrak sets from the issue all read back exactly now. I built test-001 on its own against GLib, not the whole app.

Convert_Satellite_Data() copied ten characters of the mean motion,
which occupies columns 53-63 of line 2 and is eleven characters
wide, so the eighth decimal never reached SGP4.

Copy eleven characters and terminate the buffer at index eleven;
buff is fifteen bytes, so there is room. test-001 now fails if the
mean motion of its element set is not read as printed.

Fixes csete#426
@csete

csete commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Thanks!

@csete
csete merged commit dd2edc0 into csete:master Oct 8, 2026
1 check 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.

Convert_Satellite_Data reads the mean motion as ten characters of an eleven-character field

2 participants