CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > ParaView

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 Display Modes
Old   October 2, 2013, 12:42
Default Exporting time series to CSV
  #1
New Member
 
Peter Maday
Join Date: Aug 2011
Posts: 14
Rep Power: 5
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, 12:53
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,251
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Peter,

Sorry, I don't have time this weekend to try this myself, but have a look at this post for ideas: Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 post #6

Best regards,
Bruno
wyldckat is online now   Reply With Quote

Old   October 7, 2013, 05:05
Default Solution using programmable filter
  #3
New Member
 
Peter Maday
Join Date: Aug 2011
Posts: 14
Rep Power: 5
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
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic Mesh is faster than MRF???? sharonyue OpenFOAM Running, Solving & CFD 14 August 26, 2013 07:47
number of iterations per time step chouki FLUENT 1 August 13, 2013 00:11
AMI speed performance danny123 OpenFOAM 19 October 24, 2012 07:44
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 9 January 3, 2012 09:06
Full pipe 3D using icoFoam cyberbrain OpenFOAM 4 March 16, 2011 10:20


All times are GMT -4. The time now is 19:15.