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

Add separate color for 'not on source'

parent b580a4e6
......@@ -2,7 +2,7 @@
"""
Receive numbers from gnuradio (over UDP) at about 2 per second, plot them
against distance to to Sun or Cas A
against time. Special color if not pointing to sun
Tammo Jan Dijkema, 29 June 2020
"""
......@@ -68,7 +68,8 @@ prev_points = None
separation = None
maxsignal = 0.
scatterplot_70cm = ax.scatter([], [], s=3, color='black')
scatterplot = ax.scatter([], [], s=3, color='black')
calplot = ax.scatter([], [], s=3, color='lightgrey')
ax.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M'))
eclipse_starttime = Time("2021-06-10T11:21") + 2*u.hour
......@@ -93,16 +94,22 @@ while True:
if signal > maxsignal:
maxsignal = signal
scatter_data = scatterplot_70cm.get_offsets()
if dt.tracker == "console/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
print("Cal")
scatter_data = plot_to_append_to.get_offsets()
scatter_data = np.vstack((scatter_data, [mdates.date2num((now + 2*u.hour).datetime), signal]))
scatterplot_70cm.set_offsets(scatter_data)
plot_to_append_to.set_offsets(scatter_data)
if prev_points is not None:
prev_points.remove()
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)
ax.set_ylim((0.5 * maxsignal, 1.1 * maxsignal))
ax.set_xlim(starttime.datetime, (now+2.5*u.hour).datetime) # HIERO
# show the plot
plt.show()
......
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