Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
calibration
pycalibration
Commits
87552bf2
Commit
87552bf2
authored
4 years ago
by
Cyril Danilevski
Browse files
Options
Downloads
Patches
Plain Diff
Cast numpy.float64 to float and round it
parent
a5bb41ac
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cal_tools/cal_tools/agipdlib.py
+4
-4
4 additions, 4 deletions
cal_tools/cal_tools/agipdlib.py
with
4 additions
and
4 deletions
cal_tools/cal_tools/agipdlib.py
+
4
−
4
View file @
87552bf2
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment