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

[General] Exporting time series to CSV

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By mpeti

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 2, 2013, 13:42
Default Exporting time series to CSV
  #1
New Member
 
Peter Maday
Join Date: Aug 2011
Posts: 14
Rep Power: 14
mpeti is on a distinguished road
Dear All,

I am trying to create a script to export a flow rate time series to a CSV file. I create a time series of flow rate values by using the PlotSelectionOverTime filter on an IntegrateVariables output. When I use the "Save Data" in the GUI to create a CSV file with the results it works fine. I would like to automate the process thereby I recorded a script using the "Trace" GUI feature.

The problem is that the export of the CSV file does not show up in the trace script (using Paraview 4.0.1)!

The main problem I face when trying to do the export manually (using the CreateWriter function) is that I need an input that contains the time series values and I don't really know how to access it... It would be nice if the temporal samples related to the PlotSelectionOverTime filter could be exported directly.

In general is there a way to access the array values of a filter specific to a temporal instance? As a last resort it should be possible to step through the frames manually and create separate files for each instance.

Thanks a lot!
mpeti is offline   Reply With Quote

Old   October 6, 2013, 13:53
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
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 Peter,

Sorry, I don't have time this weekend to try this myself, but have a look at this post for ideas: http://www.cfd-online.com/Forums/ope...tml#post446333 post #6

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   October 7, 2013, 06:05
Default Solution using programmable filter
  #3
New Member
 
Peter Maday
Join Date: Aug 2011
Posts: 14
Rep Power: 14
mpeti is on a distinguished road
Thanks for the reply!



The solution I have found for my problem was to use a programmable filter to create a vtkTable out out the vtkMultiBlockDataset that is the output of the plotSelectionOverTime filter (with the appropriate selection of the block and column indices):

progFilter=ProgrammableFilter()
progFilter.OutputDataSetType='vtkTable'
progFilter.PythonPath = ''
progFilter.RequestInformationScript = ''
#progFilter.RequestUpdateExtentScript= ''
progFilter.Script = "\
dataTable=self.GetInput().GetBlock(0).GetColumn(0) \n\
output=self.GetTableOutput()\n\
output.AddColumn(dataTable)\n\
"


I believe it is worth mentioning that it is possible to put the debugger breakpoints (pdb.set_trace()) in the progFilter.Script string and this way to figure out what exactly the input of the filter is like.
wyldckat likes this.
mpeti is offline   Reply With Quote

Reply

Tags
csv files, scripting, temporal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 05:13
How to export time series of variables for one point? mary mor OpenFOAM Post-Processing 8 July 19, 2017 11:54
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 11 February 16, 2017 14:40
simpleFoam error - "Floating point exception" mbcx4jc2 OpenFOAM Running, Solving & CFD 12 August 4, 2015 03:20
dynamic Mesh is faster than MRF???? sharonyue OpenFOAM Running, Solving & CFD 14 August 26, 2013 08:47


All times are GMT -4. The time now is 23:13.