Converting NAN to a number

When I am creating a plot over line filter, across a hollow (such as disk_out_ref.exo), I am correctly getting nans for variables on the line. This is failing with subsequent filters. Is there a way to convert these nans to something else (such as 0, or a big negative number)?

I think the solution is to play with the python calculator with this formula:

np.nan_to_num(VEL, nan=-1)

where VEL is the array to filter. Default value for nan is 0.

The calculator has a Replace invalid results options but it does not seems to replace nan. Maybe it should be another option ? @utkarsh.ayachit @mwestphal

1 Like

Thanks Nicolas. that was the part I was looking for. I wrote it all up in a tips and tricks, here: How to find the maximum value on a line

1 Like

Agreed (with regards to the Calculator and NaNs). https://gitlab.kitware.com/paraview/paraview/-/issues/20550

Furthermore, Descriptive Statistics should handle NaNs as … um … NaNs. https://gitlab.kitware.com/paraview/paraview/-/issues/20551