We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80f5d58 commit 25938e8Copy full SHA for 25938e8
pypulseq/__init__.py
@@ -14,9 +14,13 @@ def round_half_up(n, decimals=0):
14
15
16
# =========
17
-# NP.FLOAT EPSILON
+# EPSILON (Precision of floating point numbers)
18
19
-eps = np.finfo(np.float64).eps
+
20
+# Instead of np.finfo(np.float64).eps, which was used before, we now try to estimate our precision based on the largest
21
+# expected value for times, amplitudes etc (we choose 1E6) and consider another factor 10 for compounding of rounding errors.
22
+# We then round the value to the closest power of 10.
23
+eps = 10 ** np.floor(np.log10(np.spacing(1e6) * 10)) # this is 1e-9 for np.float64
24
25
26
# PACKAGE-LEVEL IMPORTS
0 commit comments