Skip to content

Commit 36a5df9

Browse files
hifabianalexlib
authored andcommitted
Write output using scientific notation
The velocities were previously hard cut off if too low. This is an unnecessary restrictions for users and leads to misleading confidence in large velocities, as more digits are preserved. Using scientific notation solves this problem. Compared to the previous notation ten more characters are used per line (that is two additional characters per value). However, the benefit of handling a wider range of velocities outweighs this in my opinion. For the test to still pass, the threshold of image comparison needed to be adjusted. This is due to the higher round-off error with the old notation used in the reference image (specifically in 'u').
1 parent 3b162c0 commit 36a5df9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openpiv/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def save(
390390
v: np.ndarray,
391391
flags: Optional[np.ndarray] = None,
392392
mask: Optional[np.ndarray] = None,
393-
fmt: str="%8.4f",
393+
fmt: str="%.4ef",
394394
delimiter: str="\t",
395395
)-> None:
396396
"""Save flow field to an ascii file.

0 commit comments

Comments
 (0)