mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2024-11-13 01:53:31 +01:00
ZH: allow to modify tracelengths in beacon_phases
This commit is contained in:
parent
dd00aebe3b
commit
22ccf7e3e3
1 changed files with 15 additions and 5 deletions
|
@ -99,6 +99,14 @@ if __name__ == "__main__":
|
||||||
test_traces = traces[1:]
|
test_traces = traces[1:]
|
||||||
orients = ['Ex', 'Ey', 'Ez', 'B']
|
orients = ['Ex', 'Ey', 'Ez', 'B']
|
||||||
|
|
||||||
|
# modify the length of the traces
|
||||||
|
if False:
|
||||||
|
t_trace = t_trace[:len(t_trace)//2]
|
||||||
|
half_traces = []
|
||||||
|
for trace in test_traces:
|
||||||
|
half_traces.append( trace[:len(trace)//2])
|
||||||
|
test_traces = half_traces
|
||||||
|
|
||||||
# Do Fourier Transforms
|
# Do Fourier Transforms
|
||||||
# to find phases and amplitudes
|
# to find phases and amplitudes
|
||||||
if True:
|
if True:
|
||||||
|
@ -132,11 +140,13 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
if show_plots and (i == 60 or i == 72):
|
if show_plots and (i == 60 or i == 72):
|
||||||
fig, ax = plt.subplots()
|
fig, ax = plt.subplots()
|
||||||
trace_amp = max(traces[-1]) - min(traces[-1])
|
ax.set_xlabel("t [ns]")
|
||||||
|
ax.set_ylabel("Amplitude")
|
||||||
|
|
||||||
myt = np.linspace(min(traces[0]), max(traces[0]), 10*len(traces[0]))
|
myt = np.linspace(min(t_trace), max(t_trace), 10*len(t_trace))
|
||||||
ax.plot(t_trace, traces[-1], marker='.', label='trace')
|
for i, trace in enumerate(test_traces):
|
||||||
ax.plot(myt, lib.sine_beacon(frequency, myt, amplitude=amplitude, phase=phase), ls='dashed', label='simulated')
|
ax.plot(t_trace, test_traces[i], marker='.', label='trace '+orients[i])
|
||||||
|
ax.plot(myt, lib.sine_beacon(frequency, myt, amplitude=amplitude, phase=phase), ls='dashed', label='simulated beacon')
|
||||||
ax.set_title(f"Beacon at antenna {h5ant.attrs['name']}\nF:{frequency:.2e}, P:{phase:.4f}, A:{amplitude:.1e}")
|
ax.set_title(f"Beacon at antenna {h5ant.attrs['name']}\nF:{frequency:.2e}, P:{phase:.4f}, A:{amplitude:.1e}")
|
||||||
ax.legend()
|
ax.legend()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue