Skip to content

Conversation

@MartinHerren
Copy link
Contributor

There are some corner cases that were not well handled with satellite names starting with '1', '1 ', '2', '2 ' in tle files that don't have the leading '0 ' on the 0-line. This PR fixes it and adds unit tests covering problematic existing TLEs.

Unfortunately when working with TLEs from multiple sources (SpaceTrack, Celestrac, McCants, Satnogs, self-crafted) they are not always identically formatted, with or without 0-line, with or without leading 0 on the 0-line and even with or without 0-padding on shorter-than-5-digits sat numbers. Those are now all fixed and covered in unit test.

This fix uses the same 'strategy'' to get the satellite name as done in cbassa/strf#63 which is now successfully used by a number of persons working on heterogeneous TLE data sets.

The added test set covering all identified problematic cases:

2023-193D
1 58556U 23193D   25003.79555039  .00279397  31144-4  86159-3 0  9996
2 58556  97.2472  26.1173 0004235 271.4738  88.6051 15.91743157 60937
0 CPOD FLT2 (TYVAK-0033)
1 52780U 22057BB  23036.86744141  .00018086  00000-0  87869-3 0  9991
2 52780  97.5313 154.3283 0011660  53.1934 307.0368 15.18441019 16465
1998-067WV
1 60955U 98067WV  24295.33823779  .06453473  12009-4  26290-2 0  9998
2 60955  51.6166  43.0490 0010894 336.3668  23.6849 16.22453324  8315
2 PATHFINDER
1 45727U 20037E   24323.73967089  .00003818  00000+0  31595-3 0  9995
2 45727  97.7798 139.6782 0011624 329.2427  30.8113 14.99451155239085
0 SHINSEI (MS-F2)
1  5485U 71080A   24324.43728894  .00000099  00000-0  13784-3 0  9992
2  5485  32.0564  70.0187 0639723 198.9447 158.6281 12.74214074476065
OSCAR 7 (AO-7)
1 07530U 74089B   24323.87818483 -.00000039  00000+0  47934-4 0  9997
2 07530 101.9893 320.0351 0012269 147.9195 274.9996 12.53682684288423
1 52743U 22057M   23037.04954473  .00011781  00000-0  61944-3 0  9993
2 52743  97.5265 153.6940 0008594  82.9904  31.3082 15.15793680 38769

This fixes #7

PS: I'm new to Rust so i'd happily update / improve this PR as required.

There are some corner cases that were not well handled with satellite
names starting with '1', '1 ', '2', '2 ' in tle files that don't have
the leading '0 ' on the 0-line. This PR fixes it and adds a number of
unit tests covering problematic existing tles.

Signed-off-by: Martin Herren (HB9FXX) <[email protected]>
Signed-off-by: Martin Herren (HB9FXX) <[email protected]>
@ssmichael1
Copy link
Owner

looks good to me. Thank you again for the fix.

@ssmichael1 ssmichael1 merged commit 713e010 into ssmichael1:main Jan 23, 2025
@MartinHerren MartinHerren deleted the tle_fixes branch February 3, 2025 12:49
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.

TLE::from_lines() panics with TLE title line starting with 1 or 2

2 participants