One way to achieve this is to use a Programmable Source.
- Source > Alphabetical > Programmable Source
- Fill in the Script (RequestInformation) as shown below.
from paraview import util
util.SetOutputWholeExtent(self, [0, 98, 0, 37, 0, 0])
Here, the values to be specified for SetOutputWholeExtent are obtained by counting the number of rows and columns from the csv file in advance.
- Enter the following in Script.
import numpy as np
path = 'data_path/Sample.csv'
a = np.loadtxt(path, delimiter=',', encoding='utf-8_sig').flatten()
output.SetDimensions(99, 38, 1)
output.SetOrigin(0.0, 0.0, 0.0)
output.SetSpacing(1, 1, 1)
output.PointData.append(a, 'height')
Here, path is the absolute path to the location of Sample.csv. And set the number of rows and columns in the csv file in output.SetDimensions.
-
Specify vtkImageData as the Output Data Set Type.
-
Apply
-
Continue to apply Filters > Alphabetical > Warp By Scalar, as shown below.
The state file for the above operations is attached.
programmable_source.pvsm (292.2 KB)