How can I access a field in Paraview's programmable filter as a numpy array?
I want to:
- Import an existing field as a numpy array
- Create a similar array for output
- Register it as a new field for visualization
I'm familiar with the wiki, but it doesn't address the issue.
Given this example:
elev0 = inputs[0].PointData['Elevation']
elev1 = inputs[1].PointData['Elevation']
output.PointData.append(elev1 - elev0, 'difference')
I'd like to do (assuming elev0 and elev1 are numpy arrays):
diff = elev1 - elev0
diff[ diff > 1.0 ] = 1.0
output.PointData.append(diff, 'difference')
but this doesn't work as those are VTKArray objects.