[vtkusers] vtkExodusIIReader: Extract time step value?

David Thompson david.thompson at kitware.com
Mon Sep 10 08:18:03 EDT 2012


Hi Nico,

> rdr = vtkExodusIIReader()
> ...
> rdr.GetOutputInformation(0)
> 
> yields and error saying that "GetOutputInformation" isn't a member of
> vtkExodusIIReader.
> From <http://www.vtk.org/doc/nightly/html/classvtkExodusIIReader-members.html>
> I see that it should be there though. Might this be a bug in the
> Python interface? This is with VTK 5.8.0.

I believe in VTK 5.8 it was named GetOutputPortInformation().

  http://www.vtk.org/doc/release/5.8/html/a00128.html

	David

> On Sat, Sep 8, 2012 at 6:26 PM, David Thompson
> <david.thompson at kitware.com> wrote:
>> 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