I am trying to create a simple .vtk
file to visualize it with VisIt
.
It will be a 2D pseudocolor plot.
I start with a rectilinar 2D grid and I programatically write to a .vtk file the x-coordinates values (1 per line), then the y-coordinates values (1 per line).
Then the z-coordinate is then written because it has to be written, but the plot will be 2D (a 2D heatmap).
I then reach the point of confusion. The scalars values.
I have a 2D Python-numpy array of double precision values. The first dimension represents the x-axis, the 2nd dimension represents the y-axis.
I.e. arr[i, j]
represents the value which shall appear at location x[i]
and y[j]
.
How do I list (1 per line) vertically downwards this 2D array of values?
x-axis varies the fastest and y-axis varies slower?
I couldn't find this in any .vtk tutorial online, or I haven't searched well enough.
I can elaborate on any of the above points if something is not clear.
Thank you!