diff --git a/airshower_beacon_simulation/ca_period_from_shower.py b/airshower_beacon_simulation/ca_period_from_shower.py index 32185d3..0a8a7dc 100755 --- a/airshower_beacon_simulation/ca_period_from_shower.py +++ b/airshower_beacon_simulation/ca_period_from_shower.py @@ -20,6 +20,11 @@ import aa_generate_beacon as beacon import lib from lib import rit +try: + from tqdm import tqdm +except: + tqdm = lambda x: x + def find_best_period_shifts_summing_at_location(test_loc, antennas, allowed_ks, period=1, dt=None, period_shift_first_trace=0, plot_iteration_with_shifted_trace=None, fig_dir=None, fig_distinguish=None,snr_str=None, shower_plane_loc=None): """ Find the best sample_shift for each antenna by summing the antenna traces @@ -175,6 +180,8 @@ if __name__ == "__main__": if os.name == 'posix' and "DISPLAY" not in os.environ: matplotlib.use('Agg') + plt.rcParams.update({'figure.max_open_warning': 0}) + atm = AtmoCal() from scriptlib import MyArgumentParser @@ -427,10 +434,11 @@ if __name__ == "__main__": yy = [] N_loc = len(maxima_per_loc) - for i, (x_, y_) in enumerate(product(x,y)): + for i, (x_, y_) in tqdm(enumerate(product(x,y)), total=N_loc, ): tmp_fig_subdir = None if i % 10 ==0: - print(f"Testing location {i} out of {N_loc}") + if hasattr(tqdm, '__code__') and tqdm.__code__.co-name == '': + print(f"Testing location {i} out of {N_loc}") tmp_fig_subdir = fig_subdir test_loc = (x_+xoff)* ev.uAxB + (y_+yoff)*ev.uAxAxB + dXref *ev.uA