From 6151199650c15c6f233ea8cdc1fc8c0066e7dbf6 Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Wed, 1 Feb 2023 14:12:12 +0100 Subject: [PATCH] ZH: let modify_clock use filtered_traces --- .../airshower_beacon_simulation/ab_modify_clocks.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/simulations/airshower_beacon_simulation/ab_modify_clocks.py b/simulations/airshower_beacon_simulation/ab_modify_clocks.py index 51c7e78..0c33300 100755 --- a/simulations/airshower_beacon_simulation/ab_modify_clocks.py +++ b/simulations/airshower_beacon_simulation/ab_modify_clocks.py @@ -84,11 +84,13 @@ if __name__ == "__main__": # modify time values of each antenna + trace_key = 'filtered_traces' for i, name in enumerate(group.keys()): h5ant = group[name] clk_offset = clock_offsets[i] - if 'traces' not in h5ant.keys(): + + if trace_key not in h5ant.keys(): print(f"Antenna file corrupted? no 'traces' in {name}") sys.exit(1) @@ -96,14 +98,14 @@ if __name__ == "__main__": if 'clock_offset' in h5ant_attrs: tmp_offset = h5ant_attrs['clock_offset'] if remake_clock_offsets: - h5ant['traces'][0, :] -= tmp_offset + h5ant[trace_key][0, :] -= tmp_offset h5ant['E_AxB'][0, :] -= tmp_offset else: clock_offsets[i] = tmp_offset continue h5ant_attrs['clock_offset'] = clk_offset - h5ant['traces'][0, :] += clk_offset + h5ant[trace_key][0, :] += clk_offset h5ant['E_AxB'][0, :] += clk_offset # save to simple csv