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

sgp4init() satellite number limitation exceeded #995

Open
ErikBsly opened this issue Aug 15, 2024 · 3 comments
Open

sgp4init() satellite number limitation exceeded #995

ErikBsly opened this issue Aug 15, 2024 · 3 comments

Comments

@ErikBsly
Copy link

Hey folks,
the most recent Starlink satellites ( https://celestrak.org/NORAD/elements/supplemental/sup-gp.php?FILE=starlink&FORMAT=csv ) seem to carry unusual high NORAD catalog numbers like 799501299 which causes sgp4init() to raise the following error:

ValueError: satellite number cannot exceed 339999, whose Alpha 5 encoding is 'Z9999'

Whether or not this value was intended by the file creators, a solution might be necessary in the near future anyways.

@brandon-rhodes
Copy link
Member

Well — drat. Skyfield uses the official SGP4 implementation for generating satellite positions, as distributed here:

https://celestrak.org/publications/AIAA/2006-6753/

And that routine only allows 6 characters of satellite catalog number:

typedef struct elsetrec
{
  char      satnum[6];
...

Do you know what any other satellite tools are doing with entries like this new one you have run across? That is indeed a very large satellite number, and I would guess that other implementations are running into trouble too. I wonder if I should just truncate all but the lowest 6 digits, so that you can at least proceed to generate positions for the satellite?

@Bernmeister
Copy link

I cannot recall if I saw this issue/situation mentioned here on skyfield or python-sgp4 (or perhaps pyephem),however I ended up performing a sleight of hand. In short, for the XML data I download from Celestrak, if the value for the field NORAD_CAT_ID > 339999, I pass a value of 0 instead (0 is not used so I felt safe for this step) to get the data to initialise.

Something like this:

from sgp4 import alpha5, exporter, omm
from sgp4.api import Satrec

satellite_record = Satrec()
xml_fields_from_omm = get_data_from_celestrak_in_xml_format( .... )

# Satellite record does not hold the name.
name = xml_fields_from_omm[ "OBJECT_NAME" ]

number = xml_fields_from_omm[ "NORAD_CAT_ID" ]
if float( xml_fields_from_omm[ "NORAD_CAT_ID" ] ) > float( "339999" ):
    xml_fields_from_omm[ "NORAD_CAT_ID" ] = '0'
    omm.initialize( self.satellite_record, xml_fields_from_omm ) # The satellite record now has a satnum = 0.
    xml_fields_from_omm[ "NORAD_CAT_ID" ] = self.number

else:
    omm.initialize( self.satellite_record, xml_fields_from_omm )

Hopefully there is no differencewhether the data format is xml or csv.

@EndlessDex
Copy link

There is no error here (yet). That nine digit number is a temporary designation until it gets an official satcat id.

The supplemental data on celestrak is provided by space-track by starlink. Starlink reports satellite position by the format specified here: https://www.space-track.org/documents/SFS_Handbook_For_Operators_V1.7.pdf

In today's datadump there were files listed like this:
image

Which is defined by this spec (from SFS Handbook):
image

It looks like celestrak did an autoimport and barfed a bit on the data. SATCAT ID will continue to be assigned sequentially until 99999. THEN we will have a problem. (The problem OMM was designed to fix see https://celestrak.org/NORAD/documentation/gp-data-formats.php)

Hopefully Valledo gets us a nice update before then otherwise it will be the wild west haha.

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

No branches or pull requests

4 participants