Compare commits

...

2 Commits

Author SHA1 Message Date
Michael Krayer d256d4ec2c output rel_shift if assertion false 2021-06-03 12:48:43 +02:00
Michael Krayer 83bfca08f9 changed collapse threshold 2021-06-03 12:47:42 +02:00
1 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ class Field3d:
self.data = numpy.array(data)
self.origin = tuple([float(x) for x in origin])
self.spacing = tuple([float(x) for x in spacing])
self.eps_collapse = 1e-12
self.eps_collapse = 1e-7
self._dim = None
return
@ -371,7 +371,7 @@ class Field3d:
assert isinstance(rel_shift,(tuple,list,numpy.ndarray)) and len(rel_shift)==3,\
"'shift' must be tuple/list with length 3."
assert all([rel_shift[ii]>=-1.0 and rel_shift[ii]<=1.0 for ii in range(3)]),\
"'shift' must be in (-1.0,1.0)."
"'shift' must be in (-1.0,1.0). {}".format(rel_shift)
data = self.data.copy()
origin = list(self.origin)
sl = 3*[slice(None)]