mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2024-12-22 03:23:34 +01:00
ZH: cli arguments for clock modification
This commit is contained in:
parent
031e21636d
commit
7b18837d6d
2 changed files with 13 additions and 3 deletions
|
@ -12,7 +12,7 @@ beacon:
|
|||
./ac_show_signal_to_noise.py --no-show-plots --fig-dir=${FIG_DIR}
|
||||
|
||||
clocks:
|
||||
./ab_modify_clocks.py 15
|
||||
./ab_modify_clocks.py 15 --gaussian
|
||||
|
||||
phases:
|
||||
./ba_measure_beacon_phase.py --no-show-plots --fig-dir=${FIG_DIR}
|
||||
|
|
|
@ -19,7 +19,17 @@ if __name__ == "__main__":
|
|||
from os import path
|
||||
import sys
|
||||
|
||||
max_clock_offset = 100 if len(sys.argv) < 2 else float(sys.argv[1]) # ns
|
||||
from argparse import ArgumentParser
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument('max_clock_offset', nargs='?', type=float, default=25, help='(Default: %(default)d)')
|
||||
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.set_defaults(dist_type='gauss')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
max_clock_offset = args.max_clock_offset # ns
|
||||
remake_clock_offsets = True
|
||||
|
||||
seed = 12345
|
||||
|
@ -54,7 +64,7 @@ if __name__ == "__main__":
|
|||
if True:
|
||||
print(f"Modifying clocks upto {max_clock_offset}ns.")
|
||||
clock_offsets = np.zeros( N_antennas )
|
||||
if not True: # uniform
|
||||
if args.dist_type == 'uniform': # uniform
|
||||
print("Uniform distribution")
|
||||
clock_offsets = max_clock_offset * (2*rng.uniform(size=N_antennas) - 1)
|
||||
else: # normal
|
||||
|
|
Loading…
Reference in a new issue