Unverified Commit a814c8f6 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Updates to eclipse demo

parent ba0d4893
......@@ -31,7 +31,7 @@ signal = 0.
prev_signal = 0.
datafile = open(f"data{int(Time.now().unix)}.txt", "w")
print("Time (UTC),Tracker,Offset az (deg),Offset el(deg),azimuth from north (deg), elevation (deg), signal 70cm", file=datafile)
print("Time (UTC),Tracker,Offset az (deg),Offset el(deg),azimuth from north (deg),elevation (deg),signal 70cm,signal 23cm", file=datafile)
def signal_thread():
global signal
......@@ -56,6 +56,8 @@ dwl = EarthLocation(lon=Angle("6:23:46.21 degrees"),
plt.ion()
fig, ax = plt.subplots()
starttime = Time.now() + 2 * u.hour
#ax.set_ylim((0, None))
ax.set_xlabel("Lokale tijd (CEST)")
ax.set_ylabel("Signaalsterkte (ongekalibreerd)")
......@@ -67,7 +69,6 @@ separation = None
maxsignal = 0.
scatterplot_70cm = ax.scatter([], [], s=3, color='black')
scatterplot_23cm = ax.scatter([], [], s=3, color='blue')
while True:
time.sleep(0.2)
......@@ -83,14 +84,15 @@ while True:
maxsignal = signal
scatter_data = scatterplot_70cm.get_offsets()
scatter_data = np.vstack((scatter_data, [mdates.date2num(now.datetime), signal]))
scatter_data = np.vstack((scatter_data, [mdates.date2num((now + 2*u.hour).datetime), signal]))
scatterplot_70cm.set_offsets(scatter_data)
if prev_points is not None:
prev_points.remove()
prev_points = ax.scatter([now.datetime], [signal], s=50, color='red')
prev_points = ax.scatter([(now+2*u.hour).datetime], [signal], s=50, color='red')
ax.set_ylim((2800, 1.1 * maxsignal))
ax.set_xlim(starttime.datetime, (now+2.5*u.hour).datetime)
# show the plot
plt.show()
......
#!/usr/bin/env python
import zmq
import sys
import time
import numpy as np
from numpy.random import random
port = sys.argv[1]
ctx = zmq.Context()
sender = ctx.socket(zmq.PUSH)
sender.bind("tcp://127.0.0.1:5557")
while True:
time.sleep(0.5)
sender.send(np.array(3000 + random() * 500, dtype="float32"))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment