|
[Sponsors] |
January 22, 2014, 10:45 |
NaN color for TecPlot data
|
#1 |
Senior Member
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 14 |
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" VARIABLES = "x", "y", "U" ZONE T="Frame 0", I=74, J=55 1.271574e+02 -8.534172e+00 NaN [...] 1.263715e+02 -1.875147e+01 9.161986e-01 [...] 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 |
|
January 24, 2014, 20:26 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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 |
|
January 27, 2014, 07:19 |
|
#3 |
Senior Member
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 14 |
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 |
|
February 2, 2014, 11:54 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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 |
|
February 4, 2014, 11:04 |
|
#5 |
Senior Member
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 14 |
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 |
|
February 15, 2014, 15:56 |
|
#6 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM] Paraview doesn't seem to be picking up data generated by icofoam | MikeHersee | ParaView | 2 | January 6, 2015 09:27 |
cyclicACMI gives Courant number nan | Drew1 | OpenFOAM Running, Solving & CFD | 3 | August 16, 2014 12:47 |
Problem running in parralel | Val | OpenFOAM Running, Solving & CFD | 1 | June 12, 2014 03:47 |
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem | Attesz | OpenFOAM Meshing & Mesh Conversion | 12 | May 2, 2013 11:52 |
How to update polyPatchbs localPoints | liu | OpenFOAM Running, Solving & CFD | 6 | December 30, 2005 18:27 |