CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] NaN color for TecPlot data

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 22, 2014, 10:45
Default NaN color for TecPlot data
  #1
Senior Member
 
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 14
Eloise is on a distinguished road
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
[...]
In order to highlight the region where the variable U is defined, I'd like to use a colorbar for U and a white color for the NaN region.

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)
I've also tried to import manually the TecPlot file through the GUI and set NaN color to white in the colorbar menu, but it does not have any effect on the image.

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
Eloise is offline   Reply With Quote

Old   January 24, 2014, 20:26
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
wyldckat is offline   Reply With Quote

Old   January 27, 2014, 07:19
Default
  #3
Senior Member
 
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 14
Eloise is on a distinguished road
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
Attached Images
File Type: jpg Example.jpg (25.0 KB, 32 views)
Attached Files
File Type: zip B00001.zip (45.1 KB, 7 views)
Eloise is offline   Reply With Quote

Old   February 2, 2014, 11:54
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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:
  • The spreadsheet view demonstrates that the NaN values were read properly.
  • The colour for NaN values was respected.
The missing detail is that I used the "Tecplot Files" option when ParaView asked me which reader to use to load the data.

Best regards,
Bruno
Attached Images
File Type: jpg Screenshot from 2014-02-02 15:50:25.jpg (66.9 KB, 19 views)
wyldckat is offline   Reply With Quote

Old   February 4, 2014, 11:04
Default
  #5
Senior Member
 
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 14
Eloise is on a distinguished road
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
Attached Images
File Type: jpg Win64bits.jpg (56.7 KB, 9 views)
Eloise is offline   Reply With Quote

Old   February 15, 2014, 15:56
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
We can easily find that Microsoft's implementation of atof cannot handle NaN values, which returns simply "0.0".

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
wyldckat is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 14:02.