Go to the documentation of this file.
2 from .. PacketUtils
import *
3 from .. timestamp
import *
7 OM_Ephem_Tlm packet (section 7.1)
11 (
'timestamp', CCSDS_timestamp),
15 (
'sunPosJ2000',
'>f8', (3,)),
16 (
'moonPosJ2000',
'>f8', (3,)),
17 (
'sunVelJ2000',
'>f8', (3,)),
18 (
'moonVelJ2000',
'>f8', (3,)),
19 (
'scPosJ2000',
'>f8', (3,)),
20 (
'scVelJ2000',
'>f8', (3,)),
21 (
'PV_Time_GPS',
'>f8'),
22 (
'DCM_ecef2eci',
'>f8', (3,3)),
23 (
'magfieldEci',
'>f8', (3,)),
24 (
'magfieldEcef',
'>f8', (3,)),
26 (
'ephemValid',
'|u1'),
27 (
'Padding2',
'|u1', (6,)),
33 expected = Fields.itemsize
34 if len(data) != expected:
35 print(
'APID {}: expected={}, actual={}'.format(apid,expected,len(data)))
37 tmp = np.frombuffer(data, dtype=Fields, count=1)
46 posr = [np.matmul(rec[
'DCM_ecef2eci'], rec[
'scPosJ2000'])
for rec
in orb_recordlist]
47 velr = [np.matmul(rec[
'DCM_ecef2eci'], rec[
'scVelJ2000'])
for rec
in orb_recordlist]
49 omegae = 7.29211585494e-5
50 for i
in np.arange(len(orb_recordlist)):
51 velr[i][0] += posr[i][1]*omegae
52 velr[i][1] -= posr[i][0]*omegae
58 omf2 = (1.0-f) * (1.0-f)
60 xyz = np.array([p/1000.0
for p
in posr], dtype=np.float64)
61 x, y, z = [xyz[:,i]
for i
in np.arange(3)]
64 lon = np.arctan2(y, x)
67 rad = np.linalg.norm(xyz,axis=1)
68 omf2p = (omf2*rem + rad - rem)/rad
70 temp = np.sqrt(z*z + omf2p*omf2p*pxy)
71 lat = np.arcsin(z/temp)
74 clatg = np.cos(np.arctan(omf2*np.tan(lat)))
75 rl = re*(1.0-f)/np.sqrt(1.0-(2.0-f)*f*clatg*clatg)
80 orbitparams[
'posr'] = posr
81 orbitparams[
'velr'] = velr
82 orbitparams[
'lon'] = np.rad2deg(lon)
83 orbitparams[
'lat'] = np.rad2deg(lat)
84 orbitparams[
'alt'] = alt * 1000.0
def derive_orbitparams(orb_recordlist)
def getDict(structured_array)
def parse_CCSDS_timestamp(timestr)