mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2024-11-13 18:13:31 +01:00
ZH: let modify_clock use filtered_traces
This commit is contained in:
parent
5fca4a8bda
commit
6151199650
1 changed files with 5 additions and 3 deletions
|
@ -84,11 +84,13 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
|
|
||||||
# modify time values of each antenna
|
# modify time values of each antenna
|
||||||
|
trace_key = 'filtered_traces'
|
||||||
for i, name in enumerate(group.keys()):
|
for i, name in enumerate(group.keys()):
|
||||||
h5ant = group[name]
|
h5ant = group[name]
|
||||||
clk_offset = clock_offsets[i]
|
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}")
|
print(f"Antenna file corrupted? no 'traces' in {name}")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
@ -96,14 +98,14 @@ if __name__ == "__main__":
|
||||||
if 'clock_offset' in h5ant_attrs:
|
if 'clock_offset' in h5ant_attrs:
|
||||||
tmp_offset = h5ant_attrs['clock_offset']
|
tmp_offset = h5ant_attrs['clock_offset']
|
||||||
if remake_clock_offsets:
|
if remake_clock_offsets:
|
||||||
h5ant['traces'][0, :] -= tmp_offset
|
h5ant[trace_key][0, :] -= tmp_offset
|
||||||
h5ant['E_AxB'][0, :] -= tmp_offset
|
h5ant['E_AxB'][0, :] -= tmp_offset
|
||||||
else:
|
else:
|
||||||
clock_offsets[i] = tmp_offset
|
clock_offsets[i] = tmp_offset
|
||||||
continue
|
continue
|
||||||
|
|
||||||
h5ant_attrs['clock_offset'] = clk_offset
|
h5ant_attrs['clock_offset'] = clk_offset
|
||||||
h5ant['traces'][0, :] += clk_offset
|
h5ant[trace_key][0, :] += clk_offset
|
||||||
h5ant['E_AxB'][0, :] += clk_offset
|
h5ant['E_AxB'][0, :] += clk_offset
|
||||||
|
|
||||||
# save to simple csv
|
# save to simple csv
|
||||||
|
|
Loading…
Reference in a new issue