Reputation: 401
What is the best file format to save a large 3D NumPy array to, so I can easily load it into Paraview?
I have a very large 3D NumPy array filled with data points. I am trying to load this large array into Paraview using a few different methods, but I have been unsuccessful. The array has dimensions of (2000, 1500, 200).
So far, I have used gridToVTK
to convert the array into a .vtr
file, but gridToVTK
crashes if the array is much larger than 100MB. I split up the array into smaller more maintainable chunks and saved the chunks as multiple .vtr
files and stiched them together in Paraview, but this method is too slow and tedious.
I have also tried saving the NumPy array as a .raw
file and loading that into Paraview, but I have been unsuccessful using that method.
Does anybody have any suggestions on how I should try and save this array so that I can easily load it into Paraview?
Upvotes: 0
Views: 613
Reputation: 2498
You can use the vtk
module to use a vtkImageImport and then write the resulting imageData with vtkXMLImageDataWriter
Upvotes: 2