NaN color for TecPlot data
Hello,
I import some 2D data from a TecPlot format into ParaView through a Python script. The TecPlot data file has the following structure: Code:
TITLE = "B00001" I'm using the following command to define my LookUpTable. The colorbar is properly created, but the instruction regarding NaN seems to be ignored. It looks like ParaView automatically converts the NaN to 0.0 because the NaN region get the color assigned to 0.0 (gray) instead of a white color. Code:
a1_Ux_PVLookupTable = GetLookupTableForArray( "U", 1, RGBPoints=[UMin, 0.23, 0.299, 0.754, 0.0, 0.865, 0.865, 0.865, UMax, 0.706, 0.016, 0.15], NanColor=[1.0, 1.0, 1.0], ColorSpace='Diverging', ScalarRangeInitialized=1.0) Does someone know more about handling of NaN values during TecPlot import in ParaView 4.1.0-RC1 and can help me? Many thanks, Eloïse |
Greetings Eloïse,
Without an example file to test this myself, I can only guess that the TecPlot reader in ParaView is actually the one to blame here ;) Did you confirm in the Spreadsheet view in ParaView, if the values were correctly loaded? Best regards, Bruno |
2 Attachment(s)
Hello Bruno,
Yes, let's blame the loader :) I uploaded a TecPlot file where you can see that the original data contain NaN. The spreadsheet view confirms that the NaN values are converted to 0.0 at import. It annoys me because it is then difficult to identify the boundary of the region which actually contains the data, as I also have a region close to 0.0 in my data. Having NaNs would make it easy to define the color of the NaNs to white and create the contrast to highlight the region containing data. Another way to do is maybe to filter all the 0.0 values in Paraview and set another color for them. But I didn't manage to do so. Any help or suggestions are welcome! Thanks, Eloïse |
1 Attachment(s)
Hi Eloïse,
Mmm... strange. Perhaps this was already fixed in ParaView 4.1.0, since RC1 was released? I've used the 4.1.0 version for Linux 64 bit and attached is the image that tells almost all of the details:
Best regards, Bruno |
1 Attachment(s)
Hello Bruno,
I'm post-processing those data on a Windows 64bits machine. I've downloaded Paraview 4.1 for Windows 64bits and the NaN values are still converted to zeros here. I'm also using the TecPlot file option when loading the data. Thanks for trying, Eloïse |
Hi Eloïse,
I went into the VTK source code and found out that the limitation is in atof, a function that converts a number in text format to a double value: https://github.com/Kitware/VTK/blob/...eader.cxx#L824 Unfortunately, if we Google: Code:
microsoft atof nan Therefore, the only solution (aside from using a Linux Distribution :)) is to use a text editor to search and replace all NaN values for something... I've done some tests and 1e40 is enough to get all ex-NaN values to be interpreted as "inf" (infinite)... problem is that I can't do anything worth while with it :( Now I'm understanding a lot better why some people say Windows isn't very science friendly... :( Best regards, Bruno |
All times are GMT -4. The time now is 06:46. |