From f3531402c59e934007412c7c820460075103b097 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Tue, 24 Jan 2023 15:21:47 +0100 Subject: [PATCH] ZH: configurable max_k in ca_period_from_shower --- .../airshower_beacon_simulation/ca_period_from_shower.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/simulations/airshower_beacon_simulation/ca_period_from_shower.py b/simulations/airshower_beacon_simulation/ca_period_from_shower.py index 497dc61..008bda0 100755 --- a/simulations/airshower_beacon_simulation/ca_period_from_shower.py +++ b/simulations/airshower_beacon_simulation/ca_period_from_shower.py @@ -151,6 +151,7 @@ if __name__ == "__main__": from scriptlib import MyArgumentParser parser = MyArgumentParser(default_fig_dir="./figures/periods_from_shower_figures/") + parser.add_argument('--max-k', type=float, default=2, help='Maximum abs(k) allowed to be shifted. (Default: %(default)d)') args = parser.parse_args() fname = "ZH_airshower/mysim.sry" @@ -159,7 +160,8 @@ if __name__ == "__main__": fig_subdir = path.join(fig_dir, 'shifts/') show_plots = args.show_plots - allowed_ks = [ -2, -1, 0, 1, 2] + max_k = int(args.max_k) + allowed_ks = np.arange(-max_k, max_k+1, dtype=int) Xref = 400 N_runs = 3 @@ -465,7 +467,7 @@ if __name__ == "__main__": h5attrs = h5beacon_info[freq_name].attrs h5attrs['best_k'] = old_ks_per_loc[i] - h5attrs['best_k_time'] = old_ks_per_loc[i]*dt/f_beacon + h5attrs['best_k_time'] = old_ks_per_loc[i]/f_beacon if show_plots: plt.show()