NRLMSISE-00 Atmospheric Model is now available in SatelliteToolbox.jl


#1

Hi guys!

The master branch of SatelliteToolbox.jl has now the atmospheric model NRLMSISE-00. I need this because it will be integrated into the numerical orbit propagator that I am coding. However, since I am no expert in this area, the codification was almost “blind”. The values seems accurate (I have to add the tests…), but if anyone can test, I will appreciate!

It has the usual functions of NRLMSISE-00 gtd7 and gtd7d with possibilities to select flags to enable/disable computations, but most of the time people can use the API function nrlmsise00, which takes care about the internal configuration.

The density can be computed as follows:

out = nrlmsise00(DatetoJD(2016, 6, 14, 00, 46, 19), # Julian Day
                 700,                               # Altitude [m]
                 -22*pi/180,                        # Latitude [rad]
                 -45*pi/180,                        # Longitude [rad]
                 83.7,                              # 81 day average F10.7 flux
                 102.5,                             # Daily F10.7 for previous day
                 15;                                # Magnetic index (daily)
                 output_si = false                  # Output in cm^-3 and g/cm^-3
    )
SatelliteToolbox.NRLMSISE00_Output{Float64}
  den_N: Float64 0.0
  den_N2: Float64 1.7911798343113382e19
  den_O: Float64 0.0
  den_aO: Float64 0.0
  den_O2: Float64 4.805198141507027e18
  den_H: Float64 0.0
  den_He: Float64 1.2020106337709783e14
  den_Ar: Float64 2.1425197588115072e17
  den_Total: Float64 0.0011020196415983325
  T_exo: Float64 1027.3184649
  T_alt: Float64 292.3967045943127
  flags: Dict{Symbol,Bool}

Here is how the results compare the the online version of MSIS:

Value SatelliteToolbox.jl Online NRLMSISE-00
Density O 0.0 0.0
Density N2 1.7911798343113382e19 1.792E+19
Density O2 4.805198141507027e18 4.806E+18
Density He 1.2020106337709783e14 1.202E+14
Density Ar 2.1425197588115072e17 2.143E+17
Density H 0.0 0.0
Density N 0.0 0.0
Density Anom. O 0.0 0.0
Total Density 0.0011020196415983325 1.102E-03
Neutral Temperature 292.3967045943127 292.4
Exospheric Temperature 1027.3184649 1027

So, it seems to be working OK for some cases. However, additional tests are required.

Next steps in SatelliteToolbox.jl are:

  • Tag a new version with the modifications…
  • Learn how to use JPLEphemeris package to compute the planets position so that the acceleration can be added into the numerical orbit propagator.
  • Test different integrators from DifferentialEquations.jl to select the most appropriate for the numerical orbit propagation.
  • Starts coding the numerical orbit propagator.

#2

Now we have the tests! I took the default test set and add two different scenarios from the online algorithm.

However, I am having a little problem, not sure if anyone here can help me. The online version of MSIS takes the following data for AP index:

ap(00-03 hours prior used)
ap(03-06 hours prior used)
ap(06-09 hours prior used)
ap(09-12 hours prior used)
ap(12-33 hours prior used)
ap(33-59 hours prior used)

Whereas the NRLMSISE-00 FORTRAN algorithm takes the following:

C             (1) DAILY AP
C             (2) 3 HR AP INDEX FOR CURRENT TIME
C             (3) 3 HR AP INDEX FOR 3 HRS BEFORE CURRENT TIME
C             (4) 3 HR AP INDEX FOR 6 HRS BEFORE CURRENT TIME
C             (5) 3 HR AP INDEX FOR 9 HRS BEFORE CURRENT TIME
C             (6) AVERAGE OF EIGHT 3 HR AP INDICIES FROM 12 TO 33 HRS PRIOR
C                    TO CURRENT TIME
C             (7) AVERAGE OF EIGHT 3 HR AP INDICIES FROM 36 TO 57 HRS PRIOR
C                    TO CURRENT TIME

Maybe this was causing the minor difference I am seeing between the implemented model and the online version. Notice that if I run the online version using only the daily AP, then the tests are equal up to the precision of the online test.


#3

@helgee would you know anything about this?