From 7cfccd0011cfae3494feb27fee533e57fe5435f7 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Thu, 15 Dec 2022 15:08:55 +0100 Subject: [PATCH] ZH: hardcoded some clock offsets --- .../ab_modify_clocks.py | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/simulations/airshower_beacon_simulation/ab_modify_clocks.py b/simulations/airshower_beacon_simulation/ab_modify_clocks.py index 557a638..b13467c 100755 --- a/simulations/airshower_beacon_simulation/ab_modify_clocks.py +++ b/simulations/airshower_beacon_simulation/ab_modify_clocks.py @@ -41,8 +41,6 @@ if __name__ == "__main__": print("Antenna file cannot be found, did you try generating a beacon?") sys.exit(1) - print(f"Modifying clocks upto {max_clock_offset}ns.") - # read in antennas with h5py.File(antennas_fname, 'a') as fp: if 'antennas' not in fp.keys(): @@ -53,10 +51,27 @@ if __name__ == "__main__": N_antennas = len(group.keys()) - if True: # uniform - clock_offsets = max_clock_offset * (2*rng.uniform(size=N_antennas) - 1) - else: # normal - clock_offsets = max_clock_offset * rng.normal(0, 1, size=N_antennas) + if not True: + print(f"Modifying clocks upto {max_clock_offset}ns.") + clock_offsets = np.zeros( N_antennas ) + if not True: # uniform + print("Uniform distribution") + clock_offsets = max_clock_offset * (2*rng.uniform(size=N_antennas) - 1) + else: # normal + print("Gaussian distribution") + clock_offsets = max_clock_offset * rng.normal(0, 1, size=N_antennas) + else: # Hardcoded offsets + print("Hardcoded offsets") + + f_beacon = 51.53e-3 # GHz + + clock_offsets = np.zeros( N_antennas ) + if False: + clock_offsets[59] = np.pi/2 / (2*np.pi*f_beacon) + elif True: + clock_offsets += 1/8 * 1/f_beacon + print(clock_offsets) + # modify time values of each antenna for i, name in enumerate(group.keys()):