ZH: let view_beaconed_antenna use E_AxB

This commit is contained in:
Eric Teunis de Boone 2022-11-22 13:14:13 +01:00
parent 6bdaf5b574
commit f88799dd95

View file

@ -4,11 +4,11 @@ import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import numpy.fft as ft import numpy.fft as ft
from earsim import Antenna
import aa_generate_beacon as beacon import aa_generate_beacon as beacon
from view_orig_ant0 import plot_antenna_geometry from view_orig_ant0 import plot_antenna_geometry
import lib import lib
from earsim import Antenna
if __name__ == "__main__": if __name__ == "__main__":
import os.path as path import os.path as path
@ -61,13 +61,13 @@ if __name__ == "__main__":
if not True: if not True:
mydict = dict(x=ant.Ex, y=ant.Ex, z=ant.Ez) mydict = dict(x=ant.Ex, y=ant.Ex, z=ant.Ez)
else: else:
mydict = dict(b=ant.beacon) mydict = dict(E=ant.E_AxB, b=ant.beacon)
for j, (direction, trace) in enumerate(mydict.items()): for j, (direction, trace) in enumerate(mydict.items()):
l = axs[0].plot(ant.t, trace, label=f"E{direction} {ant.name}") l = axs[0].plot(ant.t, trace, label=f"E{direction} {ant.name}")
if j == 0 and 't0' in ant.attrs: #if False and j == 0 and 't0' in ant.attrs:
axs[0].axvline(ant.attrs['t0'], color=l[0].get_color(), alpha=0.5) # axs[0].axvline(ant.attrs['t0'], color=l[0].get_color(), alpha=0.5)
colorlist.append(l[0].get_color()) colorlist.append(l[0].get_color())
@ -98,7 +98,8 @@ if __name__ == "__main__":
if plot_geometry: if plot_geometry:
fig2, axs2 = plt.subplots(1) fig2, axs2 = plt.subplots(1)
plot_antenna_geometry(antennas, ax=axs2, plot_max_values=False, color='grey', plot_names=False) plot_antenna_geometry(antennas, ax=axs2, plot_max_values=False, color='grey', plot_names=False)
plot_antenna_geometry([ antennas[i] for i in idx], ax=axs2, colors=colorlist, plot_max_values=False) for j, _ in enumerate(mydict):
plot_antenna_geometry([ antennas[i] for i in idx], ax=axs2, colors=colorlist[j + len(colorlist)//len(mydict)], plot_max_values=False)
axs2.plot(tx.x, tx.y, marker='X', color='k') axs2.plot(tx.x, tx.y, marker='X', color='k')
axs2.set_title("Geometry with selected antennas") axs2.set_title("Geometry with selected antennas")