edu.wisc.ssec.mcidasv.data.adde.sgp4
Class SGP4utils

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.data.adde.sgp4.SGP4utils

public class SGP4utils
extends Object

19 June 2009

Author:
Shawn E. Gano, shawn@gano.name

Nested Class Summary
static class SGP4utils.MDHMS
           
 
Field Summary
static char OPSMODE_AFSPC
           
static char OPSMODE_IMPROVED
           
static double pi
           
 
Constructor Summary
SGP4utils()
           
 
Method Summary
static double angle(double[] vec1, double[] vec2)
           
static double asinh(double xval)
           
static void cross(double[] vec1, double[] vec2, double[] outvec)
           
static SGP4utils.MDHMS days2mdhms(int year, double days)
           
static double dot(double[] x, double[] y)
           
static double[] invjday(double jd)
          ----------------------------------------------------------------------------- procedure invjday this procedure finds the year, month, day, hour, minute and second given the julian date. tu can be ut1, tdt, tdb, etc.
static double jday(int year, int mon, int day, int hr, int minute, double sec)
          ----------------------------------------------------------------------------- procedure jday this procedure finds the julian date given the year, month, day, and time.
static double mag(double[] x)
           
static double[] newtonnu(double ecc, double nu)
          ----------------------------------------------------------------------------- function newtonnu this function solves keplers equation when the true anomaly is known.
protected static double readFloatFromString(String inStr)
          Read float data from a string
private static boolean readLine1(String line1, SGP4SatData satrec)
           
private static boolean readLine2(String line2, SGP4SatData satrec)
           
static boolean readTLEandIniSGP4(String satName, String line1, String line2, char opsmode, SGP4unit.Gravconsttype whichconst, SGP4SatData satrec)
          Reads the data from the TLE and initializes the SGP4 propogator variables and stores them in the SGP4unit.Gravconsttype object DOES NOT PERFORM ANY INTERNAL CHECK BEYOND BASICS OF THE TLE DATA use other methods to do that if desired.
static double[] rv2coe(double[] r, double[] v, double mu)
          ----------------------------------------------------------------------------- function rv2coe this function finds the classical orbital elements given the geocentric equatorial position and velocity vectors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pi

public static double pi

OPSMODE_AFSPC

public static char OPSMODE_AFSPC

OPSMODE_IMPROVED

public static char OPSMODE_IMPROVED
Constructor Detail

SGP4utils

public SGP4utils()
Method Detail

readTLEandIniSGP4

public static boolean readTLEandIniSGP4(String satName,
                                        String line1,
                                        String line2,
                                        char opsmode,
                                        SGP4unit.Gravconsttype whichconst,
                                        SGP4SatData satrec)
Reads the data from the TLE and initializes the SGP4 propogator variables and stores them in the SGP4unit.Gravconsttype object DOES NOT PERFORM ANY INTERNAL CHECK BEYOND BASICS OF THE TLE DATA use other methods to do that if desired.

Parameters:
satName -
line1 - TLE line 1
line2 - TLE line 2
opsmode -
whichconst - which constants to use in propogation
satrec - object to store the SGP4 data
Returns:
if the sgp4 propogator was initialized properly

readLine1

private static boolean readLine1(String line1,
                                 SGP4SatData satrec)
                          throws Exception
Throws:
Exception

readLine2

private static boolean readLine2(String line2,
                                 SGP4SatData satrec)
                          throws Exception
Throws:
Exception

readFloatFromString

protected static double readFloatFromString(String inStr)
                                     throws Exception
Read float data from a string

Parameters:
inStr -
Returns:
Throws:
Exception

jday

public static double jday(int year,
                          int mon,
                          int day,
                          int hr,
                          int minute,
                          double sec)
----------------------------------------------------------------------------- procedure jday this procedure finds the julian date given the year, month, day, and time. the julian date is defined by each elapsed day since noon, jan 1, 4713 bc. algorithm : calculate the answer in one step for efficiency author : david vallado 719-573-2600 1 mar 2001 inputs description range / units year - year 1900 .. 2100 mon - month 1 .. 12 day - day 1 .. 28,29,30,31 hr - universal time hour 0 .. 23 min - universal time min 0 .. 59 sec - universal time sec 0.0 .. 59.999 outputs : jd - julian date days from 4713 bc locals : none. coupling : none. references : vallado 2007, 189, alg 14, ex 3-14 ---------------------------------------------------------------------------

Parameters:
year -
mon -
day -
hr -
minute -
sec -
Returns:

days2mdhms

public static SGP4utils.MDHMS days2mdhms(int year,
                                         double days)

invjday

public static double[] invjday(double jd)
----------------------------------------------------------------------------- procedure invjday this procedure finds the year, month, day, hour, minute and second given the julian date. tu can be ut1, tdt, tdb, etc. algorithm : set up starting values find leap year - use 1900 because 2000 is a leap year find the elapsed days through the year in a loop call routine to find each individual value author : david vallado 719-573-2600 1 mar 2001 inputs description range / units jd - julian date days from 4713 bc outputs : year - year 1900 .. 2100 mon - month 1 .. 12 day - day 1 .. 28,29,30,31 hr - hour 0 .. 23 min - minute 0 .. 59 sec - second 0.0 .. 59.999 locals : days - day of year plus fractional portion of a day days tu - julian centuries from 0 h jan 0, 1900 temp - temporary double values leapyrs - number of leap years from 1900 coupling : days2mdhms - finds month, day, hour, minute and second given days and year references : vallado 2007, 208, alg 22, ex 3-13 ---------------------------------------------------------------------------

Parameters:
jd -
Returns:
[year,mon,day,hr,minute,sec]

rv2coe

public static double[] rv2coe(double[] r,
                              double[] v,
                              double mu)
----------------------------------------------------------------------------- function rv2coe this function finds the classical orbital elements given the geocentric equatorial position and velocity vectors. author : david vallado 719-573-2600 21 jun 2002 revisions vallado - fix special cases 5 sep 2002 vallado - delete extra check in inclination code 16 oct 2002 vallado - add constant file use 29 jun 2003 vallado - add mu 2 apr 2007 inputs description range / units r - ijk position vector km v - ijk velocity vector km / s mu - gravitational parameter km3 / s2 outputs : p - semilatus rectum km a - semimajor axis km ecc - eccentricity incl - inclination 0.0 to pi rad omega - longitude of ascending node 0.0 to 2pi rad argp - argument of perigee 0.0 to 2pi rad nu - true anomaly 0.0 to 2pi rad m - mean anomaly 0.0 to 2pi rad arglat - argument of latitude (ci) 0.0 to 2pi rad truelon - true longitude (ce) 0.0 to 2pi rad lonper - longitude of periapsis (ee) 0.0 to 2pi rad locals : hbar - angular momentum h vector km2 / s ebar - eccentricity e vector nbar - line of nodes n vector c1 - v**2 - u/r rdotv - r dot v hk - hk unit vector sme - specfic mechanical energy km2 / s2 i - index e - eccentric, parabolic, hyperbolic anomaly rad temp - temporary variable typeorbit - type of orbit ee, ei, ce, ci coupling : mag - magnitude of a vector cross - cross product of two vectors angle - find the angle between two vectors newtonnu - find the mean anomaly references : vallado 2007, 126, alg 9, ex 2-5 ---------------------------------------------------------------------------

Parameters:
r -
v -
mu -
Returns:
[p, a, ecc, incl, omega, argp, nu, m, arglat, truelon, lonper]

newtonnu

public static double[] newtonnu(double ecc,
                                double nu)
----------------------------------------------------------------------------- function newtonnu this function solves keplers equation when the true anomaly is known. the mean and eccentric, parabolic, or hyperbolic anomaly is also found. the parabolic limit at 168 is arbitrary. the hyperbolic anomaly is also limited. the hyperbolic sine is used because it's not double valued. author : david vallado 719-573-2600 27 may 2002 revisions vallado - fix small 24 sep 2002 inputs description range / units ecc - eccentricity 0.0 to nu - true anomaly -2pi to 2pi rad outputs : e0 - eccentric anomaly 0.0 to 2pi rad 153.02 m - mean anomaly 0.0 to 2pi rad 151.7425 locals : e1 - eccentric anomaly, next value rad sine - sine of e cose - cosine of e ktr - index coupling : asinh - arc hyperbolic sine references : vallado 2007, 85, alg 5 ---------------------------------------------------------------------------

Parameters:
ecc -
nu -
Returns:
[e0, m]

asinh

public static double asinh(double xval)

mag

public static double mag(double[] x)

cross

public static void cross(double[] vec1,
                         double[] vec2,
                         double[] outvec)

dot

public static double dot(double[] x,
                         double[] y)

angle

public static double angle(double[] vec1,
                           double[] vec2)