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