Orbit propagation#

SGP4_TLE#

Propagates NORAD Two-Lines Elements and compute the spacecraft position.

SGP4 stands for Simplified General Perturbation -4 and consists in an orbit propagator. This function allows one to propagate NORAD two lines elements (TLE sets can be found at http://celestrak.com/). More about SGP4 can be found at http://celestrak.com/NORAD/documentation/spacetrk.pdf .

Important

Those who are running the library on Unix or linux system have to convert TLE files from NORAD from DOS to UNIX using the command dos2unix file.tle newfile.tle. Also be aware that some TLE files contains random errors, like elements from another satellite, repeated elements, … there are no specific filters implemented in the SGP4 function.

For those who are familiar with SGP4 code, be aware for one difference between orginal SGP4 code and the one provided here: input start and stop time and time step are not in minutes but in seconds. This was chosen for convenience.

Inputs:
  • runtype (integer) –

    key to select the SGP4_TLE mode:

    1. defines start and stop time to propagate each TLE according to input file

    2. propagates each TLE according to user start and stop time

  • startsfe (double) – start time from date provided in each TLE (s) - can be negative, ignored for runtype = 0

  • stopsfe (double) – stop time from date provided in each TLE (s) - can be negative, ignored for runtype = 0

  • deltasec (double) – step time to propagate TLE (s)

  • InFileByte (byte array) – path and name of the input TLE file to be propagated

  • strlenIn (integer) – length of InFileByte string

  • OutFileByte (byte array) – path and name of the output file

  • strlenOut (integer) – length of OutFileByte string

Outputs:
  • file

    The output file is composed of 6 columns:

    1. date (dd/mm/yyyy)

    2. time (hh:mm:ss)

    3. decimal year

    4. altitude (km)

    5. latitude (deg)

    6. East longitude (deg)

    Note

    The Matlab wrapper handles calculation of runtype strlenIn, OutfileByte, strlenOut. OutfileByte and strlenOut will be set appropriately for a temporary file (onera_desp_lib_sgp4_tle.tmp or onera_desp_lib_sgp4_tle.tmp.####). The wrapper reads the library routine’s output from the temporary file and passes it back as a Matlab structure. The temporary file is deleted, so the Matlab structure is the only result of a successful call to sgp4_tle. In order to avoid a memory overflow for very long TLE runs, it is possible to leave the output in a text file (as in the FORTRAN call): the syntax is then onera_desp_lib_sgp4_tle(InFile,OutFile)

Calling sequence:
From MATLAB#
pos = onera_desp_lib_sgp4_tle(InFileByte) %implies runtype=0
pos = onera_desp_lib_sgp4_tle(startsfe,stopsfe,deltasec,InFileByte) %implies runtype=1
From IDL#
result = call_external(lib_name, 'sgp4_tle', runtype,startsfe,stopsfe,deltasec,InFileByte,strlenIn,OutFileByte,strlenOut, /f_value)
From FORTRAN#
CALL sgp4_tle1(runtype,startsfe,stopsfe,deltasec,InFileByte,strlenIn,OutFileByte,strlenOut)
SGP4_ELE#

Compute orbit coordinates from orbital elements.

SGP4 stands for Simplified General Perturbation -4 and consists in an orbit propagator. This function allows one to produce orbit coordinates from different types of orbital elements. More about SGP4 can be found at: http://celestrak.com/NORAD/documentation/spacetrk.pdf .

For those who are familiar with SGP4 code, be aware for one difference between orginal SGP4 code and the one provided here: input start and stop time and time step are not in minutes but in seconds. This was chosen for convenience.

Inputs:
  • sysaxesOUT (integer) – key for the output coordinate system (see Coordinate systems)

  • year (integer) – year of start date

  • month (integer) – month of start date

  • day (integer) – day of start date

  • hour (integer) – hour of start time

  • minute (integer) – minute of start time

  • seconds (integer) – seconds of start time

  • e1-e6 (double) – orbital elements - see definition according to options array

  • options (array of 5 integer) –

    type of orbital elements:

    • options(1) = 1 : ONERA-type elements:

      • e1 : inclination (deg)

      • e2 : geocentric altitude of perigee (km)

      • e3 : geocentric altitude of apogee (km)

      • e4 : longitude of the ascending node (deg)

      • e5 :

        • options(2) = 1 : argument of perigee (deg)

        • options(2) = 2 : longitude of perigee (deg)

      • e6 :

        • options(3) = 1 : time since perigee passage (s)

        • options(3) = 2 : true anomaly at epoch (deg)

        • options(3) = 3 : argument of latitude at epoch (deg)

        • options(3) = 4 : true longitude at epoch (deg)

        • options(3) = 5 : mean anomaly at epoch (deg)

    • options(1) = 2 : classical type elements:

      • e1 : semimajor axis (Re)

      • e2 : eccentricity

      • e3 : inclination (deg)

      • e4 : longitude of the ascending node (deg)

      • e5 :

        • options(2) = 1 : argument of perigee (deg)

        • options(2) = 2 : longitude of perigee (deg)

      • e6 :

        • options(3) = 1 : time since perigee passage (s)

        • options(3) = 2 : true anomaly at epoch (deg)

        • options(3) = 3 : argument of latitude at epoch (deg)

        • options(3) = 4 : true longitude at epoch (deg)

        • options(3) = 5 : mean anomaly at epoch (deg)

    • options(1) = 3 : RV-type elements:

      • e1 : xGEI (km)

      • e2 : yGEI (km)

      • e3 : zGEI (km)

      • e4 : VxGEI (km/s)

      • e5 : VyGEI (km/s)

      • e6 : VzGEI (km/s)

    • options(1) = 4 : SOLAR type elements:

      • e1 : inclination (deg)

      • e2 : geocentric altitude of perigee (km)

      • e3 : geocentric altitude of apogee (km)

      • e4 : local time of apogee (hours)

      • e5 : local time of maximum inclination (hours)

      • e6 :

        • options(3) = 1 : time since perigee passage (s)

        • options(3) = 2 : true anomaly at epoch (deg)

        • options(3) = 3 : argument of latitude at epoch (deg)

        • options(3) = 4 : true longitude at epoch (deg)

        • options(3) = 5 : mean anomaly at epoch (deg)

    • options(1) = 5 : MEAN type elements:

      • e1 : mean motion (rev/day)

      • e2 : eccentricity

      • e3 : inclination (deg)

      • e4 : longitude of the ascending node (deg)

      • e5 :

        • options(2) = 1 : argument of perigee (deg)

        • options(2) = 2 : longitude of perigee (deg)

      • e6 :

        • options(3) = 1 : time since perigee passage (s)

        • options(3) = 2 : true anomaly at epoch (deg)

        • options(3) = 3 : argument of latitude at epoch (deg)

        • options(3) = 4 : true longitude at epoch (deg)

        • options(3) = 5 : mean anomaly at epoch (deg)

  • startsfe (double) – start time from provided date (s) - can be negative

  • stopsfe (double) – stop time from provided date (s) - can be negative

  • deltasec (double) – propagation step time (s)

Outputs:
  • OUTyear (array of NTIME_MAX integer) – year for each orbital locations

  • OUTdoy (array of NTIME_MAX integer) – day of year for each orbital locations

  • UT (array of NTIME_MAX double) – time of day for each orbital locations (s)

  • X1 (array of NTIME_MAX double) – first coordinate of orbit according to sysaxesOUT

  • X2 (array of NTIME_MAX double) – second coordinate of orbit according to sysaxesOUT

  • X3 (array of NTIME_MAX double) – third coordinate of orbit according to sysaxesOUT

Calling sequence:
From MATLAB#
pos = onera_desp_lib_sgp4_ele([e1,e2,e3,e4,e5,e6],startdate,enddate,deltasec,sysaxesOUT)
From IDL#
result = call_external(lib_name, 'sgp4_ele', sysaxesOUT,year,month,day,hour,minute,sec, e1,e2,e3,e4,e5,e6,options,startsfe,stopsfe,deltasec,OUTyear,OUTdoy,UT,X1,X2,X3, /f_value)
From FORTRAN#
CALL sgp4_ele1(sysaxesOUT,year,month,day,hour,minute,sec, e1,e2,e3,e4,e5,e6,options,startsfe,stopsfe,deltasec,OUTyear,OUTdoy,UT,X1,X2,X3)
RV2COE#

This function finds the classical orbital elements given the Geocentric Equatorial Position and Velocity vectors. It comes from SGP4 distribution.

Inputs:
  • R (array of 3 double) – position in GEI (km)

  • V (array of 3 double) – velocity in GEI (km/s)

Outputs:
  • P (double) – semilatus rectum (km)

  • A (double) – semimajor axis (km)

  • ecc (double) – eccentricity

  • incl (double) – inclination (rad)

  • omega (double) – longitude of ascending node (rad)

  • argp (double) – argument of perigee (rad)

  • nu (double) – true anomaly (rad)

  • M (double) – mean anomaly (rad)

  • argLat (double) – argument of latitude (rad)

  • lamTrue (double) – true longitude (rad)

  • lonPer (double) – longitude of periapsis (rad)

Calling sequence:
From MATLAB#
elements=onera_desp_lib_rv2coe(R,V)
From IDL#
result = call_external(lib_name, 'rv2coe_idl', R,V,P,A,Ecc,Incl,Omega,Argp,Nu,M,ArgLat,LamTrue,LonPer, /f_value)
From FORTRAN#
CALL rv2coe(R,V,P,A,Ecc,Incl,Omega,Argp,Nu,M,ArgLat,LamTrue,LonPer)