[Paraview] visualising a numpy array

Juha Jäykkä juha.jaykka at gmail.com
Tue Apr 26 08:49:09 EDT 2016


Dear list,

What's the current best practice to visualise a (3D) numpy array with 
paraview? In particular, I'm wondering if 

vtkdata = numpy_support.numpy_to_vtk(num_array=NumPy_data.ravel(), deep=True, 
array_type=vtk.VTK_FLOAT)

can somehow be directly visualised? In parallel.

I'm aware of ProgrammableSource() and how to do it using that, but only from a 
file! What I'd very much like to do is avoid the file (if I cannot avoid the 
file, I'll just do xdmf and hdf5.)

Just in case it matters, the numpy array is actually not really a numpy array, 
but petsc4py.PETSc._DMDA_Vec_array which of course can be "cast" as 
numpy.ndarray.

Best regards,
Juha



More information about the ParaView mailing list