ZH: cli optional clock seed

This commit is contained in:
Eric Teunis de Boone 2023-02-02 18:09:10 +01:00
parent 47916e2e88
commit 6d3a983cad
2 changed files with 4 additions and 2 deletions

View file

@ -21,6 +21,7 @@ REF_ANTS ?=
DATA_DIR ?= ./data DATA_DIR ?= ./data
INPUT_DIR ?= ./ZH_airshower/ INPUT_DIR ?= ./ZH_airshower/
SEED ?= 12345
all: beacon clocks phases findks vary-fixes reconstruct all: beacon clocks phases findks vary-fixes reconstruct
@ -31,7 +32,7 @@ beacon:
./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} ./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: clocks:
./ab_modify_clocks.py ${CLK_DEV} --gaussian --data-dir ${DATA_DIR} ./ab_modify_clocks.py ${CLK_DEV} --seed ${SEED} --gaussian --data-dir ${DATA_DIR}
phases: phases:
./ba_measure_beacon_phase.py --no-show-plots --fig-dir=${FIG_DIR} --data-dir ${DATA_DIR} ./ba_measure_beacon_phase.py --no-show-plots --fig-dir=${FIG_DIR} --data-dir ${DATA_DIR}

View file

@ -23,6 +23,7 @@ if __name__ == "__main__":
parser = ArgumentParser() parser = ArgumentParser()
parser.add_argument('max_clock_offset', nargs='?', type=float, default=25, help='(Default: %(default)d)') parser.add_argument('max_clock_offset', nargs='?', type=float, default=25, help='(Default: %(default)d)')
parser.add_argument('-s', '--seed', type=int, nargs='?', default=None, help='Fix seed if supplied.')
parser.add_argument('--uniform', action='store_const', const='uniform', dest='dist_type') 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('--gaussian', action='store_const', const='gauss', dest='dist_type')
parser.set_defaults(dist_type='gauss') parser.set_defaults(dist_type='gauss')
@ -34,7 +35,7 @@ if __name__ == "__main__":
max_clock_offset = args.max_clock_offset # ns max_clock_offset = args.max_clock_offset # ns
remake_clock_offsets = True remake_clock_offsets = True
seed = 12345 seed = args.seed
rng = np.random.default_rng(seed) rng = np.random.default_rng(seed)
#### ####