Monthly Archive: June 2015

Jun 11

Python and VTK to get Vorticity

After a few days of understanding the VTK pipeline, I’ve finally figured out how to generate a vorticity cube from velocity cutout from the JHU Turbuelence database. ┬áSo here is the code! h5file = h5py.File(“temp.h5”, ‘r’) vtkdata = numpy_support.numpy_to_vtk(h5file[“u00000”][:,:,:,:].ravel(), deep=True, array_type=vtk.VTK_FLOAT) vtkdata.SetNumberOfComponents(3) #We have an x,y,z vector so reform it accordingly vtkdata.SetName(“Velocity”) image = vtk.vtkImageData() …

Continue reading »