mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2024-12-22 03:23:34 +01:00
WIP
This commit is contained in:
parent
fd636247b9
commit
003245fbd0
2 changed files with 28 additions and 2 deletions
|
@ -18,7 +18,6 @@ import aa_generate_beacon as beacon
|
||||||
import lib
|
import lib
|
||||||
from lib import rit
|
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):
|
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)
|
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$]")
|
axs.set_ylabel("Amplitude [$\\mu V/m$]")
|
||||||
if True:
|
if True:
|
||||||
text_loc = (0.02, 0.95)
|
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 ]
|
a_max = [ np.amax(ant.E_AxB) for ant in ev.antennas ]
|
||||||
power_sort_idx = np.argsort(a_max)
|
power_sort_idx = np.argsort(a_max)
|
||||||
|
|
|
@ -22,6 +22,32 @@ atm = AtmoCal()
|
||||||
|
|
||||||
from matplotlib import cm
|
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):
|
def set_pol_and_bp(e,low=0.03,high=0.08):
|
||||||
for ant in e.antennas:
|
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)]
|
E = [np.dot(e.uAxB,[ex,ey,ez]) for ex,ey,ez in zip(ant.Ex,ant.Ey,ant.Ez)]
|
||||||
|
|
Loading…
Reference in a new issue