From eeca9f91bc7b8fdd0dbfe8051401342d8621f5e4 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Tue, 22 Nov 2022 18:07:02 +0100 Subject: [PATCH] ZH: bc_* remove true_phase part --- .../bc_beacon_periods.py | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/simulations/airshower_beacon_simulation/bc_beacon_periods.py b/simulations/airshower_beacon_simulation/bc_beacon_periods.py index 3e4f9ec..b97f5ce 100755 --- a/simulations/airshower_beacon_simulation/bc_beacon_periods.py +++ b/simulations/airshower_beacon_simulation/bc_beacon_periods.py @@ -19,46 +19,9 @@ if __name__ == "__main__": fname_dir = path.dirname(fname) antennas_fname = path.join(fname_dir, beacon.antennas_fname) - if not path.isfile(antennas_fname): - print("Antenna file cannot be found, did you try generating a beacon?") - sys.exit(1) - # Read in antennas from file f_beacon, tx, antennas = beacon.read_beacon_hdf5(antennas_fname) - if True and 'beacon_phase_true' in antennas[0].attrs: - true_phases = np.array([a.attrs['beacon_phase_true'] for a in antennas]) - else: - true_phases = np.empty( (len(antennas)) ) - - for i, ant in enumerate(antennas): - measured_phase = ant.attrs['beacon_phase_measured'] - - geom_time = lib.geometry_time(tx, ant, c_light=3e8*1e-9) - geom_phase = geom_time * 2*np.pi*f_beacon - - true_phases[i] = lib.phase_mod(measured_phase) - lib.phase_mod(geom_phase) - - ant.attrs['beacon_phase_true'] = true_phases[i] - - # Plot True Phases - if True: - fig, ax = plt.subplots() - spatial_unit=None - fig.suptitle('f= {:2.0f}MHz'.format(f_beacon*1e3)) - - antenna_locs = list(zip(*[(ant.x, ant.y) for ant in antennas])) - ax.set_xlabel('x' if spatial_unit is None else 'x [{}]'.format(spatial_unit)) - ax.set_ylabel('y' if spatial_unit is None else 'y [{}]'.format(spatial_unit)) - scatter_kwargs = {} - scatter_kwargs['cmap'] = 'Spectral_r' - scatter_kwargs['vmin'] = -np.pi - scatter_kwargs['vmax'] = +np.pi - color_label='$\\varphi$' - - sc = ax.scatter(*antenna_locs, c=true_phases, **scatter_kwargs) - fig.colorbar(sc, ax=ax, label=color_label) - # run over all baselines if True: baselines = list(combinations(antennas,2))