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

Fix minimum for ylim

parent 2bc1cde2
......@@ -38,7 +38,7 @@ def signal_thread():
global signal
context = zmq.Context()
receiver = context.socket(zmq.PULL)
receiver.connect("tcp://127.0.0.1:5557")
receiver.connect("tcp://mercurius.dt.camras.nl:5557")
while True:
buff = receiver.recv()
signal = np.frombuffer(buff, dtype="float32")[-1]
......@@ -65,13 +65,14 @@ ax.set_title('Live radiowaarneming gedeeltelijke zonsverduistering')
prev_points = None
separation = None
maxsignal = 0.
file_data_times = []
file_data = []
file_cal_times = []
file_caldata = []
starttime = Time.now() + 2 * u.hour
maxsignal = 0.
minsignal = 1.0e8
if len(sys.argv) > 1 and os.path.isfile(sys.argv[1]):
df = pd.read_csv(sys.argv[1], parse_dates=[0])
......@@ -83,6 +84,8 @@ if len(sys.argv) > 1 and os.path.isfile(sys.argv[1]):
file_cal_times = (Time(df[~is_data]["time (UTC)"]) + 2*u.hour).datetime
file_caldata = df[~is_data]["signal"]
starttime = Time(df["time (UTC)"][0]) + 2 * u.hour
maxsignal = df["signal"].max()
minsignal = df["signal"].min()
scatterplot = ax.scatter(file_data_times, file_data, s=3, color='black')
calplot = ax.scatter(file_cal_times, file_caldata, s=3, color='lightgrey')
......@@ -137,7 +140,7 @@ while True:
prev_points.remove()
prev_points = ax.scatter([(now+2*u.hour).datetime], [signal], s=50, color='red')
ax.set_ylim((0.5 * maxsignal, 1.1 * maxsignal))
ax.set_ylim((0.5 * minsignal, 1.1 * maxsignal))
ax.set_xlim(starttime.datetime, (now+2.5*u.hour).datetime) # HIERO
# show the plot
......
Supports Markdown
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