Trouble loading in data from CSV file using TableToStructuredGrid filter

Error_log_20200607.txt (31.1 KB)

I am attempting to load in data from a CSV file into Paraview and view it using a TableToStructuredGrid filter but am having some problems. The data in my CSV file has the following header row (separated by commas): X, Y, Z, Distance, B_X, B_Y, B_Z, B_Magnitude. It contains cartesian points (X,Y,Z) and the components of the magnetic field vector at each point (B_X, B_Y, B_Z), along with the total magnetic field magnitude (B_Magnitude). The CSV file contains 2,413,800 rows of data represents 149 units in the radial direction, 90 units in the Theta direction, and 180 units in the Phi direction (14990180 = 2,413,800).

I am able to successfully open the CSV file in ParaView and see the data in Spreadsheet view. When I initially open the CSV file, I choose the option for “CSV Reader”. There is also an option for “GDAL Vector Reader” but if I choose that option, then I get an error message immediately upon opening the file. After selecting “CSV Reader” and clicking “Apply” in the Properties panel, I then add in a “TableToStructuredGrid” filter. In the Properties panel for this filter, I select 0 and 1 as the lower/upper bounds for each of the 3 Extents in the Whole Extent section, and I then select the X Column, Y Column ,and Z Column, as X, Y, and Z, respectively. When I then click on Apply for the filter, I get an Error message, which I have included as an attachment here. One of the main error messages that keeps recurring states that the input table must have exactly 8 rows, whereas my table has 2,413,800 rows. I am not sure why the input table is only allowed to have 8 rows.

Note also that my original dataset is stored in a .FITS file and I converted and saved it into a CSV format because that is the method I am familiar with for leading files into ParaView. Ultimately, I would like for ParaView to be able to recognize B_X, B_Y, and B_Z and the components of the magnetic field vector and be able to show streamlines in Render View.

Can someone please help me understand what I am doing wrong here. I have read through the ParaView Tutorial and Guide, but don’t see much information to assist with loading in data. If there are any helpful resources I should look at, please let me know. Thanks very much

Are you able to use TableToPoints instead ?

The Extents do not mean what you think they mean. The Extents are the valid index range in the i, j, k indices of the 3D array. So, when you put in [0, 1] for each of these, you are telling ParaView that in each dimension you have 2 values (indices 0 and 1). Hence, the TableToStructuredGrid filter expects 2 \times 2 \times 2 = 8 rows.

Instead, for each index put 0 and the number of items minus 1. So, in your case the Extents should be 0, 148, 0, 89, 0, 179.

Thanks for the information on this! I updated the Extent information as you suggested and am able to see the image as I was expecting without any error message showing up. Appreciate your help.

Hey I have the same problem which you solved can you help me? I would really appreciate it.

I have a CSV file I used Filter Table to Points now trying to use Table to Structure (so that I can render Mass as a Volume) I received an error.

The input table must have exactly one rows currently it has 68920 rows.

Did you set the Extents in the Table to Structured Grid filter?

You mean the Whole Extent no I didn’t its all 0.

Whatever values I am writing its the same error