Skip to content
Snippets Groups Projects
Commit 87552bf2 authored by Cyril Danilevski's avatar Cyril Danilevski :scooter:
Browse files

Cast numpy.float64 to float and round it

parent a5bb41ac
No related branches found
No related tags found
No related merge requests found
......@@ -58,10 +58,10 @@ def get_acq_rate(fast_paths: Tuple[str, str, int],
with h5py.File(slow_data_file, "r") as fin:
if slow_data_path in fin:
# The acquisition rate value is stored in a 1D array of type
# float. Use the 3rd value, arbitrarily chosen. It's okay to
# loose precision here because the usage is about defining the
# rate for meta-data.
return round(fin[slow_data_path][3], 1)
# float. Use the 3rd value, arbitrarily chosen.
# It is desired to loose precision here because the usage is
# about bucketing the rate for managing meta-data.
return round(float(fin[slow_data_path][3]), 1)
# Compute acquisition rate from fast data
fast_data_file, karabo_id, module = fast_paths
......
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