m-thesis-introduction/simulations/airshower_beacon_simulation/matrix_base/bin/make_matrix.py

33 lines
792 B
Python
Raw Normal View History

#!/usr/bin/env python3
import os
import os.path as path
from itertools import product
baselines = [ '', 72 ]
noise_sigmas = [ 0, '1e4' ]
clock_devs = [0, 20]
trace_lengths = [ 4096 ]#, 16384 ]
for options in product(baselines, clock_devs, noise_sigmas, trace_lengths):
baseline, clk_dev, noise, trace = options
dirname = f"matrix_c{clk_dev}_b{baseline}_N{trace}_noise{noise}"
print(dirname)
# Make directory
if path.exists(dirname):
print(f"{dirname} already exists! continuing..")
os.makedirs(dirname, exist_ok=True)
# Setup config.mk
with open(path.join(dirname, 'env.sh'), 'w') as fp:
template = f"""
export CLK_DEV={clk_dev}
export REF_ANTS={baseline}
export NOISE_SIGMA={noise}
export TRACE_N={trace}
"""
fp.write(template)