ParaView/Data formats
Introduction
This tutorial shows different data formats that ParaView can read. This is no where an exhaustive list, but should help a user get started.
CSV (Comma Separated Variable) files
CSV files can be read by ParaView, and are a good quick and dirty format. This data can be converted into points or structured grids. This data is just a number of rows, each row representing a point in space. The columns should include X, Y, Z and any other data. An example follows. Cut and paste this block of data into a file named test.csv.
- x coord, y coord, z coord, scalar
- 0, 0, 0, 0
- 1, 0, 0, 1
- 0, 1, 0, 2
- 1, 1, 0, 3
- -0.5, -0.5, 1, 4
- 0.5, -0.5, 1, 5
- -0.5, 0.5, 1, 6
- 0.5, 0.5, 1, 7
Read a CSV file into Paraview
Start ParaView, and read in this data. Note that the default settings should be used:
- Detect Numeric Columns ON
- Use String Delmmiter ON
- Have Headers ON
- Field Delimiter Characters should be a comma - ','
The data should show up as a table.
Next, we need to tell ParaView what this data means. There are two ways to do this - as a structured grid or as points.
Displaying data as points
- Run the filter Filters/ Alphabetical/ Table To Points.
- Tell ParaView what columns are the X, Y and Z coordinate. Be sure to not skip this step. Apply.
- ParaView probably didn't open up a 3d window (this is a bug).
- Split screen Horizontal (Icon, top right).
- 3D View
- Turn visibility on for the Table to Points filter (click on the eyeball in the Pipeline Browser)
- If desired, color by your variable.
Displaying data as structured grid
- You may want to delete the Table to Points filter listed above.
- Run the filter Filters/ Alphabetical/ Table To Structured Grid.
- Tell ParaView what extent, or array sizes, your data is in. For instance, the data above has 8 points, forming a leaning cube. Points arrays are in X == size 2, Y == size 2, and Z == size 2. In this example we will use C indexing for the arrays, thus they go from 0 to 1 (2 entries).
- Whole extent is as follows:
- 0 1
- 0 1
- 0 1
- Tell ParaView what columns are the X, Y and Z coordinate. Be sure to not skip this step. Apply.
- ParaView probably didn't open up a 3d window (this is a bug).
- Split screen Horizontal (Icon, top right).
- 3D View
- Turn visibility on for the Table to Points filter (click on the eyeball in the Pipeline Browser)
- If desired, change representation to solid, and color by your variable.
VTK(Visualization ToolKit) files
VTK file format, along with all of it's relatives, are a preferred format for ParaView. These file formats are fairly complex, but are also very powerful. This file format can be found here: standard VTK file formats. Example files are available upon request.
Acknowledgements
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy’s National Nuclear Security Administration under contract DE-AC04-94AL85000.