CssiSpaceWeather throws error

Hi everyone,
During launching this code:

final CssiSpaceWeatherData weatherData = new CssiSpaceWeatherData("SpaceWeather-All-v1.2.txt");
final Atmosphere nrlmsise00 = new NRLMSISE00(weatherData, CelestialBodyFactory.getSun(), body);

i got this error:

unable to parse line 2 064 of file C:\Users\marek\orekit-data\orekit-data-master\SpaceWeather-All-v1.2.txt:
2023 08 05 2591 11 53 63 53 47 41 40 33 33 364  56  94  56  39  29  27  18  18  42 1.5 7 131 165.0   173.6 172.3 160.3 169.1 167.1

Even after deleting predicted part of the spaceweather file, code still doesn’t work.
I would be greatful for help.
Mark

Hi @mahromir,

Could you please share the space weather file so we can try it on our side?

Thanks,
Maxime

Hi Maxime
I copied spaceweather file from Celestrak (last 5 years) and pased to the folder with support files.
Best,
Mark

Hi @mahromir,

The line shown in the error message does not conform to the expected format (see Space Weather Data Documentation) because the information in column 100 ( Flux Qualifier) is missing.

The file SW-Last5Years.txt is updated daily. Perhaps the one you downloaded was corrupted?

Hi pascal.parraud,

I am very thankful for you help.

Unfortunately, this problem appeared again. Even in the file that you linked, in section BEGIN DAILY_PREDICTED column Flux Qulifier is empty. I tried to fill this column with zeros, but then program was not able to parse line in BEGIN MONTHLY_PREDICTED (error: unable to parse line).

I’m guessing that I may have not specified the regex for PREDICTED parts of the weather report. If yes, how to fix it?

PS this is my code (just a bit modified NumericalOrbitDetermiantion tutorial from your gitlab), I added lines necessary for NRLMSISE2000 and CssiSpaceWeather.

final CssiSpaceWeatherData weatherData = new CssiSpaceWeatherData("SpaceWeather-All-v1.2.txt");
final MarshallSolarActivityFutureEstimation msafe =
                new MarshallSolarActivityFutureEstimation(MarshallSolarActivityFutureEstimation.DEFAULT_SUPPORTED_NAMES,
                                                          MarshallSolarActivityFutureEstimation.StrengthLevel.AVERAGE);
final DataProvidersManager manager = DataContext.getDefault().getDataProvidersManager();
manager.feed(msafe.getSupportedNames(), msafe);
final Atmosphere atmosphere = new DTM2000(msafe, CelestialBodyFactory.getSun(), body);
final Atmosphere nrlmsise00 = new NRLMSISE00(weatherData, CelestialBodyFactory.getSun(), body);
final List<ParameterDriver> drivers = setDrag(propagatorBuilder, nrlmsise00, new IsotropicDrag(area, cd));

Thank you for your time,
Marek

It seems that the files SW-Last5Years.txt available on the CelesTrak website may be incomplete and therefore not usable by Orekit. We’ll have to update the documentation accordingly.

I recommend that you instead use the files SpaceWeather-v1.2.txt supplied by Agi, which have always conformed to the expected format.

1 Like

Hi Pascal!
Thank you very much for help. Now everything works properly :smiley:
Best