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

Make using telescope optional

parent 612e184d
......@@ -47,8 +47,11 @@ s = Thread(target=signal_thread)
s.daemon = True
s.start()
dt = Telescope(consoleHost='localhost')
dt.getAzEl(waitForUpdate=True)
use_telescope = False
if use_telescope:
dt = Telescope(consoleHost='localhost')
dt.getAzEl(waitForUpdate=True)
dwl = EarthLocation(lon=Angle("6:23:46.21 degrees"),
lat=Angle("52:48:43.27 degrees"))
......@@ -107,7 +110,11 @@ if len(sys.argv) == 1 or not(os.path.isfile(sys.argv[1])):
else:
datafilename = sys.argv[1]
datafile = open(datafilename, "w")
print("time (UTC),tracker,offset az (deg),offset el (deg),azimuth from north (deg),elevation (deg),signal", file=datafile)
if use_telescope:
print("time (UTC),tracker,offset az (deg),offset el (deg),azimuth from north (deg),elevation (deg),signal", file=datafile)
else:
print("time (UTC),signal", file=datafile)
else:
# Append to existing file
datafile = open(f"{sys.argv[1]}", "a")
......@@ -120,14 +127,19 @@ while True:
now = Time.now()
tracker = dt.tracker.split("/")[-1]
if use_telescope:
tracker = dt.tracker.split("/")[-1]
print(now, tracker, dt.offset_az.to(u.deg).value, dt.offset_el.to(u.deg).value, dt.az.to(u.deg).value, dt.el.to(u.deg).value, signal, flush=True, sep=',', file=datafile)
print(now, tracker, dt.offset_az.to(u.deg).value, dt.offset_el.to(u.deg).value, dt.az.to(u.deg).value, dt.el.to(u.deg).value, signal, flush=True, sep=',', file=datafile)
else:
print(now, signal, flush=True, sep=',', file=datafile)
if signal > maxsignal:
maxsignal = signal
if signal < minsignal:
minsignal = signal
if tracker == "suntracker" and dt.dist_az < 0.01 * u.deg and dt.dist_el < 0.01 * u.deg:
if not use_telescope or (tracker == "suntracker" and dt.dist_az < 0.01 * u.deg and dt.dist_el < 0.01 * u.deg):
plot_to_append_to = scatterplot
else:
plot_to_append_to = calplot
......
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