In [ ]:
%pylab inline
pylab.rcParams['figure.figsize'] = (8.0, 7.0)
pylab.rcParams['font.size'] = 14
In [ ]:
#elements = """ISS (ZARYA)
#1 25544U 98067A 13330.58127943 .00000814 00000-0 21834-4 0 1064
#2 25544 51.6484 23.7537 0001246 74.1647 18.7420 15.50540527859894
#"""
In [ ]:
#from skyfield.api import earth
#topos = earth.topos('75 W', '35 N')
#sat = earth.satellite(elements.splitlines())
In [ ]:
from matplotlib.dates import HourLocator, DateFormatter
from datetime import datetime
#from datetime import datetime
#d = datetime(2014, 1, 1, 21, 30)
#p = topos(d).observe(sat)
#alt, az, distance = p.altaz()
#print('Altitude: {}'.format(alt))
#print('Azimuth: {}'.format(az))
#print('Distance: {}'.format(distance.km))
In [ ]:
from skyfield.api import JulianDate, earth, utc
tle = """
GOCE
1 34602U 09013A 13314.96046236 .14220718 20669-5 50412-4 0 930
2 34602 096.5717 344.5256 0009826 296.2811 064.0942 16.58673376272979
"""
sat = earth.satellite(tle)
print(sat.epoch.utc_jpl())
In [ ]:
#jd.range()
jd = JulianDate(tai=arange(sat.epoch.tai - 1.0, sat.epoch.tai + 3.0, 0.001))
x = jd.toordinal()
#print sat.gcrs(jd).distance()
y = sat.gcrs(jd).distance().km - earth.radius.km
In [ ]:
plot(x, y)
reentry = JulianDate(utc=(2013, 11, 11, 0, 16))
for j, label in [(sat.epoch, 'Epoch of TLE data'),
(reentry, 'Actual moment of re-entry')]:
px = j.toordinal()
py = sat.gcrs(j).distance().km - earth.radius.km
plot(px, py, 'ro')
text(px, py + 10, label)
xaxis = axes().xaxis
xaxis.grid(True)
xaxis.set_major_locator(HourLocator([0]))
xaxis.set_minor_locator(HourLocator([0, 12]))
xaxis.set_major_formatter(DateFormatter('\n%a %d'))
xaxis.set_minor_formatter(DateFormatter('%Hh'))
yaxis = axes().yaxis
yaxis.grid(True)
In [ ]:
class MyDate(object):
def __init__(self, n):
self.n = n
def toordinal(self):
return self.n
x = [MyDate(100), MyDate(101), MyDate(102)]
y = [1.0, 2.0, 3.0]
plot(x, y)
plot(x[1], y[1], 'ro')
text(x[1], y[1], ' Midpoint')
In [ ]: