Reading a .vtk file with python
I've been given a legacy format vtk file (I think its an unstructured grid) and I'd like to read it in with python and output a .npy file instead, since I know how to deal with that. The file is a dump from ATHENA and so has density, velocity, magnetic field along with the coordinates. I'm very much a procedural programmer, so all these objects are confusing... Ben Jackel Here is the solution that I came up with, the trick was turning on ReadAllVectorsOn(). import numpy from vtk import vtkStructuredPointsReader from vtk.util import numpy_support as VN reader = vtkStructuredPointsReader()