This commit is contained in:
Eric Teunis de Boone 2023-05-01 18:19:03 +02:00
parent fd636247b9
commit 003245fbd0
2 changed files with 28 additions and 2 deletions

View File

@ -18,7 +18,6 @@ import aa_generate_beacon as beacon
import lib
from lib import rit
def save_overlapping_traces_figure(test_location, ev, N_plot = 30, wx=200, title_extra=None, fname_distinguish='', fig_dir=None, **fig_kwargs):
P, t_, a_, a_sum, t_sum = rit.pow_and_time(test_location, ev, dt=1)
@ -28,7 +27,8 @@ def save_overlapping_traces_figure(test_location, ev, N_plot = 30, wx=200, title
axs.set_ylabel("Amplitude [$\\mu V/m$]")
if True:
text_loc = (0.02, 0.95)
axs.text(*text_loc, '[' + ', '.join(['{:.1g}'.format(x) for x in test_location]) + ']', ha='left', transform=axs.transAxes)
shower_plane_location = rit.location_to_shower_plane(test_location, ev=ev)
axs.text(*text_loc, '[' + ', '.join(['{:.1g}'.format(x) for x in shower_plane_location]) + ']', ha='left', transform=axs.transAxes)
a_max = [ np.amax(ant.E_AxB) for ant in ev.antennas ]
power_sort_idx = np.argsort(a_max)

View File

@ -22,6 +22,32 @@ atm = AtmoCal()
from matplotlib import cm
def location_to_shower_plane(loc, u=None, ev=None):
if ev is not None:
uAxB = ev.uAxB
uAxAxB = ev.uAxAxB
uA = ev.uA
else:
uAxB, uAxAxB, uA = u
return np.dot(loc, uAxB), np.dot(loc, uAxAxB), np.dot(loc, uA)
def shower_plane_to_location( x, dXref=0, u=None, ev=None):
if len(x) == 2:
x, y = x
else:
x, y, dXref = x
if ev is not None:
uAxB = ev.uAxB
uAxAxB = ev.uAxAxB
uA = ev.uA
else:
uAxB, uAxAxB, uA = u
return x * uAxB + y * uAxAxB + dXref * uA
def set_pol_and_bp(e,low=0.03,high=0.08):
for ant in e.antennas:
E = [np.dot(e.uAxB,[ex,ey,ez]) for ex,ey,ez in zip(ant.Ex,ant.Ey,ant.Ez)]