test_predictor: Add plotting [WIP]

merge-requests/55/head
Fabian P. Schmidt 2019-11-06 17:46:38 +01:00
parent 1597131b4f
commit a8c19a4b15
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,30 @@
import numpy as np
import matplotlib.pyplot as plt
from pprint import PrettyPrinter
pp = PrettyPrinter(indent=4)
def plot_pass(pass_data):
pp.pprint(pass_data)
return
def x():
plt.figure()
ax = plt.subplot(111, projection='polar')
ax.set_theta_direction(-1)
ax.set_theta_zero_location('N')
plt.plot(np.radians(pass_data['azims']), pass_data['elevs'], '-')
for i, event in enumerate(pass_data['event']):
if event:
if event.info == 'LOS':
style = 'ro'
elif event.info == 'AOS':
style = 'go'
else:
style = 'bo'
plt.plot(np.radians(pass_data['azims'][i]), pass_data['elevs'][i], style)
ax.set_yticks(range(0, 90, 20))
ax.set_yticklabels(map(str, range(90, 0, -20)))
ax.set_rmax(90)
plt.show()

View File

@ -7,6 +7,8 @@ from utils import satellites_from_transmitters, \
from auto_scheduler.pass_predictor import create_observer, \
find_passes
from auto_scheduler.plotting import plot_pass
tmin = datetime(2019,11,5,12,7,10)
tmax = datetime(2019,11,5,13,7,10)
@ -77,3 +79,8 @@ def test_predictor():
# print_scheduledpass_summary(passes, ground_station['id'])
assert(len(passes) == 119)
assert(passes[0] == passes_0)
plot_pass(passes[0])
if __name__ == "__main__":
test_predictor()