Commit f60488c8 authored by Valentin Buck's avatar Valentin Buck

Made displacement optional

parent f77c4073
Pipeline #8314 passed with stage
in 50 minutes and 38 seconds
......@@ -104,8 +104,8 @@ class PythonWinADCPReader(VTKPythonAlgorithmBase):
@smproperty.intvector(name="Displace Points", default_values=1)
@smdomain.xml('<BooleanDomain name="bool"/>')
def SetPositionDirection(self, direction):
self._looks_down = direction == 1
def SetDisplacementMode(self, displace):
self._displace_points = displace == 1
self.Modified()
def _get_timesteps(self):
......@@ -172,8 +172,9 @@ class PythonWinADCPReader(VTKPythonAlgorithmBase):
y = np.repeat(y_pos,self._bins)
z = np.zeros(self._bins)
for i in range(self._bins):
x[i] += self._displacement_vectors[i][0]
y[i] += self._displacement_vectors[i][1]
if(self._displace_points):
x[i] += self._displacement_vectors[i][0]
y[i] += self._displacement_vectors[i][1]
z[i] = self._pos_depth + ((z_zero + (i * z_offset)) * (-1.0 if self._looks_down else 1.0))
coordinates = algs.make_vector(x,y,z)
......@@ -215,7 +216,7 @@ class PythonWinADCPReader(VTKPythonAlgorithmBase):
displacement[i] = [offset[0], offset[1],0]
self._displacement_vectors[i] = (prev[0] + offset[0], prev[1] + offset[1])
print(repr(self._displacement_vectors))
#print(repr(self._displacement_vectors))
output.SetPoints(points)
output.PointData.append(magnitudes, "Magnitude (mm/s)")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment