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

Append to existing file

parent 29465b1d
...@@ -10,6 +10,7 @@ Tammo Jan Dijkema, 29 June 2020 ...@@ -10,6 +10,7 @@ Tammo Jan Dijkema, 29 June 2020
import time import time
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import sys
import zmq import zmq
import struct import struct
import numpy as np import numpy as np
...@@ -30,9 +31,6 @@ logger.setLevel(level=logging.INFO) ...@@ -30,9 +31,6 @@ logger.setLevel(level=logging.INFO)
signal = 0. signal = 0.
prev_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,signal 23cm", file=datafile)
def signal_thread(): def signal_thread():
global signal global signal
context = zmq.Context() context = zmq.Context()
...@@ -68,8 +66,12 @@ prev_points = None ...@@ -68,8 +66,12 @@ prev_points = None
separation = None separation = None
maxsignal = 0. maxsignal = 0.
scatterplot = ax.scatter([], [], s=3, color='black') file_dates = []
calplot = ax.scatter([], [], s=3, color='lightgrey') file_data = []
file_caldata = []
scatterplot = ax.scatter(file_dates, file_data, s=3, color='black')
calplot = ax.scatter(file_dates, file_caldata, s=3, color='lightgrey')
ax.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M')) ax.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M'))
eclipse_starttime = Time("2021-06-10T11:21") + 2*u.hour eclipse_starttime = Time("2021-06-10T11:21") + 2*u.hour
...@@ -81,6 +83,12 @@ if starttime < eclipse_endtime < starttime + 3*u.hour: ...@@ -81,6 +83,12 @@ if starttime < eclipse_endtime < starttime + 3*u.hour:
ax.axvline(eclipse_endtime.datetime, linestyle='--', linewidth=1, color='lightgrey') ax.axvline(eclipse_endtime.datetime, linestyle='--', linewidth=1, color='lightgrey')
ax.text(eclipse_endtime.datetime,0.1,'Einde: '+eclipse_endtime.isot[11:16],rotation=90, color='black', transform=ax.get_xaxis_transform()) ax.text(eclipse_endtime.datetime,0.1,'Einde: '+eclipse_endtime.isot[11:16],rotation=90, color='black', transform=ax.get_xaxis_transform())
if len(sys.argv) == 1:
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,signal 23cm", file=datafile)
else:
datafile = open(f"{sys.argv[1]}", "a")
while True: while True:
time.sleep(0.2) time.sleep(0.2)
if signal == prev_signal: if signal == prev_signal:
......
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