mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2024-12-22 11:33:32 +01:00
ZH: findks: introduce tqdm + suppress many figures warning
This commit is contained in:
parent
7eaa97d0cb
commit
208bd9a35d
1 changed files with 10 additions and 2 deletions
|
@ -20,6 +20,11 @@ import aa_generate_beacon as beacon
|
||||||
import lib
|
import lib
|
||||||
from lib import rit
|
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):
|
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
|
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:
|
if os.name == 'posix' and "DISPLAY" not in os.environ:
|
||||||
matplotlib.use('Agg')
|
matplotlib.use('Agg')
|
||||||
|
|
||||||
|
plt.rcParams.update({'figure.max_open_warning': 0})
|
||||||
|
|
||||||
atm = AtmoCal()
|
atm = AtmoCal()
|
||||||
|
|
||||||
from scriptlib import MyArgumentParser
|
from scriptlib import MyArgumentParser
|
||||||
|
@ -427,9 +434,10 @@ if __name__ == "__main__":
|
||||||
yy = []
|
yy = []
|
||||||
N_loc = len(maxima_per_loc)
|
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
|
tmp_fig_subdir = None
|
||||||
if i % 10 ==0:
|
if i % 10 ==0:
|
||||||
|
if hasattr(tqdm, '__code__') and tqdm.__code__.co-name == '<lambda>':
|
||||||
print(f"Testing location {i} out of {N_loc}")
|
print(f"Testing location {i} out of {N_loc}")
|
||||||
tmp_fig_subdir = fig_subdir
|
tmp_fig_subdir = fig_subdir
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue