Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Satellites: Allow Satellite Number to be zero #3186

Merged
merged 1 commit into from
Apr 18, 2023

Conversation

normanr
Copy link
Contributor

@normanr normanr commented Apr 15, 2023

Description

6a7afb8 added stripping of leading zeros, but a temporary/manually created Orbital Element may have a Satellite Number of zero, and that should be allowed.

I considered replacing the regular expression with QString::toInt() and QString::number(), but that's a larger change and doesn't allow non-numeric values. Adding the "not at a word boundary" assertion at the end is much simpler.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update

How Has This Been Tested?

I've added a unit test to test that 00000 and 0 both parse and return 0.

Test Configuration:

  • Operating system: Debian Linux
  • Graphics Card: Intel(R) UHD Graphics 620

Checklist:

  • My code follows the code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (header file)
  • I have updated the respective chapter in the Stellarium User Guide
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@gzotti
Copy link
Member

gzotti commented Apr 15, 2023

The NORAD number in my understanding is not for the user to play. I can neither approve nor disapprove this. Is Zero allowed with other programs that process TLE?

@normanr
Copy link
Contributor Author

normanr commented Apr 16, 2023

The NORAD number in my understanding is not for the user to play. I can neither approve nor disapprove this. Is Zero allowed with other programs that process TLE?

I got TLE data from flightclub.io for the (currently) future Starship Orbital Flight Test, so there's no official NORAD number yet. I hand edited the data to give it a non-zero number, but I think it would be nice if Stellarium handled it without the work-around.

Comments in https://celestrak.com/columns/v04n03/ seems to indicate that leading spaces and zeros should be treated the same, but then gives an example of non-leading zeros being replaced with spaces. Stellarium's parsing worked fine before 6a7afb8. I suspect that replacing all spaces with zeros would also be a valid way to parse the field.

In the long term NORAD is switching to Orbit Mean-Elements Message which is XML based, and will probably have less ambiguous representation of data.

Copy link
Member

@alex-w alex-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use case is very specific, but the fix is acceptable

@alex-w alex-w added this to the 23.2 milestone Apr 16, 2023
@alex-w alex-w merged commit 6eea7f4 into Stellarium:master Apr 18, 2023
@alex-w alex-w added the state: published The fix has been published for testing in weekly binary package label Apr 19, 2023
@github-actions
Copy link

Hello @normanr!

Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@normanr normanr deleted the sat-zero branch April 22, 2023 03:17
@alex-w alex-w removed the state: published The fix has been published for testing in weekly binary package label Jul 2, 2023
@github-actions
Copy link

github-actions bot commented Jul 2, 2023

Hello @normanr!

Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants