From bc712b5dbbe409fd685a5907454d5e3e5a809f4d Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Mon, 27 Mar 2023 16:48:44 +0200 Subject: [PATCH] ZH: matrix: setup softlink for clockfiles if possible --- .../matrix_base/bin/make_matrix.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/simulations/airshower_beacon_simulation/matrix_base/bin/make_matrix.py b/simulations/airshower_beacon_simulation/matrix_base/bin/make_matrix.py index 5f7d3fc..cff2240 100755 --- a/simulations/airshower_beacon_simulation/matrix_base/bin/make_matrix.py +++ b/simulations/airshower_beacon_simulation/matrix_base/bin/make_matrix.py @@ -17,10 +17,17 @@ for options in product(baselines, clock_devs, noise_sigmas, trace_lengths): # Make directory if path.exists(dirname): - print(f"{dirname} already exists! continuing..") + print(f"{dirname} already exists! continuing anyway..") os.makedirs(dirname, exist_ok=True) + # Soft link clock file if available + if True: + os.makedirs(path.join(dirname, 'data'), exist_ok=True) + + if not path.isfile(path.join(dirname, 'data/clocks.csv')): + os.symlink(f'../../c{clk_dev}_clocks.csv', path.join(dirname, 'data/clocks.csv')) + # Setup config.mk with open(path.join(dirname, 'env.sh'), 'w') as fp: template = f"""