ZH: save mean beacon snr in file

This commit is contained in:
Eric Teunis de Boone 2023-02-09 12:58:45 +01:00
parent 8fc7d4bc0c
commit a478a27079

View file

@ -92,6 +92,10 @@ if __name__ == "__main__":
N_samples = len(antennas[0].beacon) 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) ] 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) fig, ax = plt.subplots(figsize=figsize)
ax.set_title(f"Maximum Beacon/Noise SNR (N_samples:{N_samples:.1e})") ax.set_title(f"Maximum Beacon/Noise SNR (N_samples:{N_samples:.1e})")
ax.set_xlabel("Antenna no.") ax.set_xlabel("Antenna no.")