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

[General] Extracting ParaView Data into Python Arrays

Register Blogs Community New Posts Updated Threads Search

Like Tree14Likes

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   January 19, 2012, 01:01
Question Extracting ParaView Data into Python Arrays
  #1
New Member
 
Jeff Cumpston
Join Date: Oct 2011
Posts: 8
Rep Power: 14
Jeffzda is on a distinguished road
Hi all,

When scripting paraview using python, how do I extract raw tuple data from a 'slice' proxy without first exporting to CSV? I used paraview.servermanager.Fetch() function to retrieve the raw data and it looks like the resulting vtk object contains it but I just can't seem to get the actual DATA! Does anyone know what I can do?

Here's what I've done so far:


>>> from paraview.simple import *
>>> File = OpenFOAMReader('file.OpenFOAM')
>>> SliceFile = Slice(File)
>>> DataSliceFile = paraview.servermanager.Fetch(SliceFile)

getting appended
use composite data append
vtkPOpenFOAMReader : [ ...........]
vtkCutter : [ ...........]
vtkReductionFilter : [ ...........]
vtkClientServerMoveData : [ ...........]

>>> print(DataSliceFile)

...
...

Cell Data:
Debug: Off
Modified Time: 113008
Reference Count: 1
Registered Events: (none)
Number Of Arrays: 11
Array 0 name = R
Array 1 name = T
Array 2 name = U
Array 3 name = alphat
Array 4 name = epsilon
Array 5 name = k
Array 6 name = kappat
Array 7 name = magT
Array 8 name = nut
Array 9 name = p
Array 10 name = p_rgh
Number Of Components: 18
Number Of Tuples: 400
Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )
Interpolate Flags: ( 1 1 1 1 1 0 0 1 )
Pass Through Flags: ( 1 1 1 1 1 1 1 1 )

...
...

Above is only part of the output to the 'print' command but as you can see there are tuples there for the taking! 400 of them. Can anyone help me get to them?

Thanks is advance,

Jeff
Jeffzda is offline   Reply With Quote

 

Tags
openfoam, paraview 3.10, python, vtk


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
[General] Paraview crashes using "Find Data" functionality Turbine ParaView 3 May 6, 2020 22:40
[OpenFOAM] Paraview Find Data cojua8 ParaView 2 March 19, 2018 08:57
[General] “Upload” vtk data from client to server in paraview script Jack001 ParaView 0 March 8, 2018 07:27
[General] Determining number of cores and/or paraview executable via python aerogt3 ParaView 0 December 9, 2014 05:54
studying a valve case mina.basta OpenFOAM 33 August 30, 2013 04:46


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