*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 1df321e5 authored by Schabbauer, Johannes's avatar Schabbauer, Johannes
Browse files

ADwin: Changed rounding in get_ain_traces (probably fixed some edge case, don't know anymore)

parent ad23264a
No related branches found
No related tags found
No related merge requests found
...@@ -133,7 +133,7 @@ def get_ain_traces(h5file, raw_data_name="ADwinAnalogIn_DATA", convert_data=True ...@@ -133,7 +133,7 @@ def get_ain_traces(h5file, raw_data_name="ADwinAnalogIn_DATA", convert_data=True
clock_rate = CLOCK_T12 / properties.get(f, device_name, "connection_table_properties")["PROCESSDELAY"] clock_rate = CLOCK_T12 / properties.get(f, device_name, "connection_table_properties")["PROCESSDELAY"]
acquisition_times = f[f"devices/{device_name}/ANALOG_IN/TIMES"] acquisition_times = f[f"devices/{device_name}/ANALOG_IN/TIMES"]
acquisitions_per_channel = np.floor((acquisition_times["stop_time"] - acquisition_times["start_time"]).astype(np.float64) * acquisition_times["storage_rate"] // clock_rate) acquisitions_per_channel = np.ceil((acquisition_times["stop_time"] - acquisition_times["start_time"]).astype(np.float64) * acquisition_times["storage_rate"] / clock_rate)
split_indices = np.cumsum(acquisitions_per_channel).astype(int)[:-1] split_indices = np.cumsum(acquisitions_per_channel).astype(int)[:-1]
...@@ -147,6 +147,7 @@ def get_ain_traces(h5file, raw_data_name="ADwinAnalogIn_DATA", convert_data=True ...@@ -147,6 +147,7 @@ def get_ain_traces(h5file, raw_data_name="ADwinAnalogIn_DATA", convert_data=True
print(f"Dataset with name '{label}' already exists, skipping channel.") print(f"Dataset with name '{label}' already exists, skipping channel.")
continue continue
times = np.arange(acquisition_times["start_time"][i],acquisition_times["stop_time"][i],int(clock_rate//acquisition_times["storage_rate"][i])) / clock_rate times = np.arange(acquisition_times["start_time"][i],acquisition_times["stop_time"][i],int(clock_rate//acquisition_times["storage_rate"][i])) / clock_rate
# print(times.size,acquisition.size)
data = np.rec.fromarrays([times, acquisition], dtype=dtype) data = np.rec.fromarrays([times, acquisition], dtype=dtype)
group.create_dataset(label, compression = config.compression, data = data) group.create_dataset(label, compression = config.compression, data = data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment