From a478a2707979381987b137404aabc3b45f064fcb Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Thu, 9 Feb 2023 12:58:45 +0100 Subject: [PATCH] ZH: save mean beacon snr in file --- .../airshower_beacon_simulation/ac_show_signal_to_noise.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/simulations/airshower_beacon_simulation/ac_show_signal_to_noise.py b/simulations/airshower_beacon_simulation/ac_show_signal_to_noise.py index 1c8fad9..d945bb5 100755 --- a/simulations/airshower_beacon_simulation/ac_show_signal_to_noise.py +++ b/simulations/airshower_beacon_simulation/ac_show_signal_to_noise.py @@ -92,6 +92,10 @@ if __name__ == "__main__": N_samples = len(antennas[0].beacon) beacon_snrs = [ lib.signal_to_noise(myfilter(beacon_amp*ant.beacon), myfilter(ant.noise), samplerate=1/dt, signal_band=beacon_pb, noise_band=noise_pb) for i, ant in enumerate(antennas) ] + with open(path.join(fname_dir, 'snr.txt'), 'w') as f: + f.write('mean='+str(np.mean(beacon_snrs))+'\n') + f.write('std='+str(np.std(beacon_snrs))+'\n') + fig, ax = plt.subplots(figsize=figsize) ax.set_title(f"Maximum Beacon/Noise SNR (N_samples:{N_samples:.1e})") ax.set_xlabel("Antenna no.")