From 0c9599973d1d7fabd7664002ec1afd8230993180 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Mon, 13 Feb 2023 14:56:49 +0100 Subject: [PATCH] ZH: cli parameter to suppress external clock saving --- simulations/airshower_beacon_simulation/Makefile | 10 ++++++++-- .../airshower_beacon_simulation/ab_modify_clocks.py | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/simulations/airshower_beacon_simulation/Makefile b/simulations/airshower_beacon_simulation/Makefile index 6ab7b77..cd88258 100644 --- a/simulations/airshower_beacon_simulation/Makefile +++ b/simulations/airshower_beacon_simulation/Makefile @@ -29,13 +29,19 @@ all: beacon clocks phases findks vary-fixes reconstruct beacon: ./aa_generate_beacon.py -N ${TRACE_N} -P ${TRACE_PRE} -n ${NOISE_SIGMA} -a ${BEAC_AMP} -f ${BEAC_F} -l ${PB_LOW} -u ${PB_HIGH} -d ${BEAC_DECAY} --data-dir ${DATA_DIR} --input-fname ${INPUT_DIR} | tee ${FIG_DIR}/aa.log - ./ab_modify_clocks.py 0 --data-dir ${DATA_DIR} | tee ${FIG_DIR}/ab.log + ./ab_modify_clocks.py 0 --no-save-clocks --data-dir ${DATA_DIR} | tee ${FIG_DIR}/ab.log ./ac_show_signal_to_noise.py --no-show-plots --fig-dir=${FIG_DIR} --data-dir ${DATA_DIR} ./view_beaconed_antenna.py 72 -p x -p y -p z -p n -p b --ft --no-show-plots --fig-dir=${FIG_DIR} --data-dir ${DATA_DIR} -clocks: +new-clocks: ./ab_modify_clocks.py ${CLK_DEV} --seed ${SEED} --gaussian --data-dir ${DATA_DIR} +clocks: + ./ab_modify_clocks.py ${CLK_DEV} --read-clocks-file --seed ${SEED} --gaussian --data-dir ${DATA_DIR} + +reset-clocks: + ./ab_modify_clocks.py 0 --data-dir ${DATA_DIR} + phases: ./ba_measure_beacon_phase.py --N-mask ${N_MASK} --no-show-plots --fig-dir=${FIG_DIR} --data-dir ${DATA_DIR} ./bb_measure_clock_phase.py --no-show-plots --fig-dir=${FIG_DIR} --data-dir ${DATA_DIR} diff --git a/simulations/airshower_beacon_simulation/ab_modify_clocks.py b/simulations/airshower_beacon_simulation/ab_modify_clocks.py index eedf05f..b0e5978 100755 --- a/simulations/airshower_beacon_simulation/ab_modify_clocks.py +++ b/simulations/airshower_beacon_simulation/ab_modify_clocks.py @@ -27,6 +27,7 @@ if __name__ == "__main__": parser.add_argument('--uniform', action='store_const', const='uniform', dest='dist_type') parser.add_argument('--gaussian', action='store_const', const='gauss', dest='dist_type') parser.add_argument('-r','--read-clocks-file', action='store_true', dest='read_clocks_file') + parser.add_argument('--no-save-clocks', action='store_false', dest='save_clocks') parser.set_defaults(dist_type='gauss') parser.add_argument('--data-dir', type=str, default="./data", help='Path to Data Directory. (Default: %(default)s)') @@ -115,6 +116,7 @@ if __name__ == "__main__": h5ant['E_AxB'][0, :] += clk_offset # save to simple csv - np.savetxt(clocks_fname, clock_offsets) + if args.save_clocks: + np.savetxt(clocks_fname, clock_offsets) print("Antenna clocks modified in " + str(antennas_fname))