Handling of NaNs in Table to points filter

Hi,
I have a series of CSV files containing several columns, including the xyz coordinates. Due to the way I generate them, some of them contain NaN in one of the coordinates, which makes the Table to points filter fail. Since it’s only some points who do this, I’d like to just skip them upon reading/applying the filter. Is there a way to implement this behavior without having to manually clean the files (thousands of them…)?

Please share a example dataset

Here you have an example. The coordinates columns are x, y and z. As you can see, some of them contain the string “nan”, which makes the filter fail.
platelets4.csv (145.3 KB)

I confirm that it fails to read the .csv as expected (with actual NaN instead of the “NaN” string). Please open an issue: https://gitlab.kitware.com/paraview/paraview/-/issues

I will!

In the meantime, do you think there might be a way to use a Programmable filter to “embed” the Table to points and make it skip the NaNs?

Using a ProgrammableSource, you should indeed be able to read the .csv yourself and create a vtkTable with the right data.

You can also filter out the NaNs with a selection operation.

The following is with ParaView 5.11.0. Open the Find Data panel, set the Data Producer to the CSV file reader, pick one of the coordinate columns and set the find criteria to “is NaN”. Click the Invert Selection and you’ll have selected all rows without NaN coordinates. Click the Extract button to extract a table with rows that don’t have the NaN points.

1 Like