pymgp.satorb.orb2vec#

pymgp.satorb.orb2vec(orb, GM=398600441800000.0)[source]#

Convert Keplerian elements into intertial state vector.

This function converts an array with 6-element Kepler elements into an inertial state vector(s), with cartesian position and velocity [X, Y, Z, Xdot, Ydot, Zdot].

Parameters:
orbarray_like with shape (…,6)

Array with the 6 Keplerian elements [ Semi-major axis (meters), Eccentricity (unity), Inclination (radians), Right ascension of the ascending node (radians), Argument of the pericenter (radians), True anomaly (radians) ]. Units are meters or radians.

GMfloat, optional

Value of GM. Default for GM [meter**3/sec**2] is the IERS 1996 standard value for the Earth (GM=3986004418e5)

Returns:
svecndarray with shape (…,6) similar to orb

Array with 6-element inertial state vector svec with Cartesian position and velocity [X, Y, Z, Xdot, Ydot, Zdot] in an ECI frame. Units are meter and meter/sec

Examples

>>> orb2vec([7121382.201, 0.0043176, 0.43579, 1.60777, 1.39025, 0.59879])
array([-5.76770178e+06, -3.09738201e+06,  2.73719544e+06,  3.00142402e+03,
       -6.76210591e+03, -1.28025603e+03])
>>> #             a          ecc      inc      raan      argp     nu 
>>> orb = [ [7121382.201, 0.0043176, 0.43579, 1.60777, 1.39025, 0.59879],
...         [7190931.091, 0.0001808, 1.72419, 4.62567, 0.73905, 5.54642],
...         [7122973.745, 0.0017477, 0.43626, 5.34368, 1.56062, 1.25323] ]
>>> orb2vec(orb)
array([[-5.76770178e+06, -3.09738201e+06,  2.73719544e+06,
         3.00142402e+03, -6.76210591e+03, -1.28025603e+03],
       [-6.25224361e+05, -7.16271398e+06,  1.62339739e+04,
        -1.13189511e+03,  1.16387852e+02,  7.35874365e+03],
       [-2.30122094e+06,  6.66691737e+06,  9.68353530e+05,
        -6.61075555e+03, -1.83389705e+03, -2.99265574e+03]])
>>> orb2vec(orb).shape
(3, 6)
>>> orb2vec([orb, orb]).shape
(2, 3, 6)