[vtkusers] vtkExodusIIReader: Extract time step value?

Nico Schlömer nico.schloemer at gmail.com
Mon Sep 10 11:44:34 EDT 2012


I wasn't quite sure if this is the same thing since I then get

================ *snip* ================
rdr.GetOutputPortInformation(0).Get(vtkStreamingDemandDrivenPipeline.TIME_STEPS())
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-10-dae571687634> in <module>()
----> 1 rdr.GetOutputPortInformation(0).Get(vtkStreamingDemandDrivenPipeline.TIME_STEPS())

TypeError: arguments do not match any overloaded methods
================ *snap* ================

--Nico



On Mon, Sep 10, 2012 at 2:18 PM, David Thompson
<david.thompson at kitware.com> wrote:
> 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