Access data at different timesteps through Programmable Filter

Hello Community!

This is my first ever post so please be lenient with me :slight_smile:

I am a relatively new user of ParaView and I’ve been recently looking into Programmable Filters

I would like to see how I can access data at different timesteps. I have already had a look at the different posts in the forum, including this one, however I don’t seem to get how to achieve it apparently because I am quite new.

I have tried to build a simple example which I can share which hopefully will help you understand what I am looking for.

I have recreated this example (state file attached)
simpleExample.pvsm (358.6 KB)

https://www.kitware.com/defining-time-varying-sources-with-paraviews-programmable-source/

  1. In short, this uses a programmable source that generates a sphere. It also generates a list of timesteps from 0 to 99.
  2. The radius of the sphere is then specified as a function of the timestep which means that the sphere becomes larger or smaller, depending on the timestep.

As an extra step I am saving a new variable to host the actual radius at every timestep
output.PointData.append(radius,"Radius")

Now, to explain my goal, I would like to include a programmable Filter that within the same timestep can access and,lets say, print all the different Radius values in all different timesteps.

My code looks like the following

outInfo = self.GetOutputInformation(0)
timesteps = outInfo.Get(vtk.vtkStreamingDemandDrivenPipeline.TIME_STEPS())

for t in timesteps:
    outInfo.Set(vtk.vtkStreamingDemandDrivenPipeline.UPDATE_TIME_STEP(),t)
    check_time = outInfo.Get(vtk.vtkStreamingDemandDrivenPipeline.UPDATE_TIME_STEP())
    print(check_time)
    print(inputs[0].PointData["Radius"][0])

Apparently the code doesn’t work and its always printing the radius that is part of the selected (in the GUI) timestep.

I was hoping that the
outInfo.Set(vtk.vtkStreamingDemandDrivenPipeline.UPDATE_TIME_STEP(),t)

will update the timestep meaning that anything I ask for after that, will correspond to the new updated timestep. However apparently it doesn’t work.

Any hints?

Thanks a lot in advance :slight_smile:

-Ioannis

Hi @jeytsav

This is not a trivial things to do I’m afraid. You need basically to browse all timesteps and recover all values in this filter.

To do that, you need to use the CONTINUE_EXECUTING information key.

I do not have a programmable filter example of this on hand sadly.