[vtkusers] vtkExodusIIReader: Extract time step value?

David Thompson david.thompson at kitware.com
Sat Sep 8 12:26:10 EDT 2012


Hi Nico,

> after having read a particular (integer) time step from an Exodus file
> with the vtkExodusIIReader,
> http://www.vtk.org/doc/nightly/html/classvtkExodusIIReader.html, how
> do I extract the actual (float/double) time value that's associated
> with it?


Filters that generate temporal data should set the vtkStreamingDemandDrivenPipeline::TIME_STEPS() key on their corresponding output's vtkInformation object. Access to any vtkAlgorithm's output information is available via the GetOutputInformation() method.

Using the exodus reader on can.ex2 as an example, here's a vtkpython script to get time step information:

from vtk import *
rdr = vtkExodusIIReader()
rdr.SetFileName('/path/to/ParaViewData/Data/can.ex2')
rdr.Update()
rdr.GetOutputInformation(0).Get(vtkStreamingDemandDrivenPipeline.TIME_STEPS())

This returns a vector of doubles. You can use the integer time step as an index into the vector.

	David


More information about the vtkusers mailing list