ZH: let modify_clock use filtered_traces

This commit is contained in:
Eric Teunis de Boone 2023-02-01 14:12:12 +01:00
parent 5fca4a8bda
commit 6151199650

View file

@ -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