From f88799dd95ee6cc69dc8ac599dcf64bf6dadc1e0 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Tue, 22 Nov 2022 13:14:13 +0100 Subject: [PATCH] ZH: let view_beaconed_antenna use E_AxB --- .../view_beaconed_antenna.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/simulations/airshower_beacon_simulation/view_beaconed_antenna.py b/simulations/airshower_beacon_simulation/view_beaconed_antenna.py index 6bcee9d..d5c37ea 100755 --- a/simulations/airshower_beacon_simulation/view_beaconed_antenna.py +++ b/simulations/airshower_beacon_simulation/view_beaconed_antenna.py @@ -4,11 +4,11 @@ import numpy as np import matplotlib.pyplot as plt import numpy.fft as ft -from earsim import Antenna - import aa_generate_beacon as beacon from view_orig_ant0 import plot_antenna_geometry import lib +from earsim import Antenna + if __name__ == "__main__": import os.path as path @@ -61,13 +61,13 @@ if __name__ == "__main__": if not True: mydict = dict(x=ant.Ex, y=ant.Ex, z=ant.Ez) else: - mydict = dict(b=ant.beacon) + mydict = dict(E=ant.E_AxB, b=ant.beacon) for j, (direction, trace) in enumerate(mydict.items()): l = axs[0].plot(ant.t, trace, label=f"E{direction} {ant.name}") - if j == 0 and 't0' in ant.attrs: - axs[0].axvline(ant.attrs['t0'], color=l[0].get_color(), alpha=0.5) + #if False and j == 0 and 't0' in ant.attrs: + # axs[0].axvline(ant.attrs['t0'], color=l[0].get_color(), alpha=0.5) colorlist.append(l[0].get_color()) @@ -98,7 +98,8 @@ if __name__ == "__main__": if plot_geometry: fig2, axs2 = plt.subplots(1) 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.set_title("Geometry with selected antennas")