In [73]:
import ephem
from datetime import timedelta, datetime
%matplotlib inline
import matplotlib.pyplot as plt

In [57]:
line1 = "FOXSI Equatorial"
line2 = "1 99999U 98067A   20153.00000000 -.13353261  00000-0 -55954-0 0 00003"
line3 = "2 99999 005.1544 359.0232 0044770 001.4952 359.8331 15.21843946000019"
foxsi = ephem.readtle(line1, line2, line3)
foxsi.compute('2016/3/23')
print('%s %s' % (foxsi.sublong, foxsi.sublat))


179:05:10.6 1389660529:33:00.8

In [58]:
type(foxsi)


Out[58]:
ephem.EarthSatellite

In [59]:
line2[17:18]


Out[59]:
' '

In [60]:
line2[20:32]


Out[60]:
'153.00000000'

In [61]:
line2[33:42]


Out[61]:
'-.1335326'

In [62]:
foxsi.sublat


Out[62]:
nan

In [63]:
foxsi.elevation


Out[63]:
-6378160.0

In [83]:
launch_time = datetime(2020, 1, 1)
times = [launch_time + timedelta(days=d) for d in range(1,600)]
elevation = []
for d in times:
    foxsi.compute(d)
    elevation.append(foxsi.elevation)

In [84]:
plt.figure()
plt.plot(times, elevation)


Out[84]:
[<matplotlib.lines.Line2D at 0x106e117d0>]

In [78]:
np.average(elevation)


Out[78]:
1.548323054485551e+17

In [ ]: