ZH: E_AxB used for phases

This commit is contained in:
Eric Teunis de Boone 2022-11-22 10:22:23 +01:00
parent b91971368d
commit 006a0903ab

View file

@ -62,6 +62,20 @@ if __name__ == "__main__":
for i, name in enumerate(group.keys()):
ant_group = group[name]
# use E_AxB only instead of polarisations
if True:
if 'E_AxB' not in ant_group.keys():
print(f"Antenna does not have 'E_AxB' in {name}")
sys.exit(1)
traces = ant_group['E_AxB']
t_trace = traces[0]
test_traces = [ traces[1] ]
orients = ['E_AxB']
# use separate polarisations
else:
if 'traces' not in ant_group.keys():
print(f"Antenna file corrupted? no 'traces' in {name}")
sys.exit(1)
@ -69,7 +83,7 @@ if __name__ == "__main__":
traces = ant_group['traces']
t_trace = traces[0]
if not True:
if True:
# only take the Beacon trace
test_traces = [traces[4]]
orients = ['B']
@ -77,6 +91,8 @@ if __name__ == "__main__":
test_traces = traces[1:]
orients = ['Ex', 'Ey', 'Ez', 'B']
# Do Fourier Transforms
# to find phases and amplitudes
if True:
freqs, phases, amps = lib.find_beacon_in_traces(
test_traces, t_trace,
@ -93,8 +109,10 @@ if __name__ == "__main__":
amps = [ 3e-7 ]
# choose highest amp
#idx = np.argmax(amps, axis=1)
idx = 0
if False and len(phases) > 1:
#idx = np.argmax(amplitudes, axis=-1)
raise NotImplementedError
frequency = freqs[idx]
phase = phases[idx]