[Paraview] Writing Images at certian time Steps using pvpython

Burlen Loring bloring at lbl.gov
Wed Aug 21 12:27:03 EDT 2013


time is not always the same as time-step. Here's an example of how you 
could query the reader for time values and then use them

... nSteps = 0
steps = reader.TimestepValues
try:
nSteps = len(steps)
except:
nSteps = 1
steps = [steps] ...

anim = GetAnimationScene()
anim.PlayMode = 'Snap To TimeSteps'
anim.AnimationTime = steps[step]
view = GetRenderView()
view.ViewTime = steps[step] ... Render()



On 08/21/2013 03:04 AM, Hedieh Ebrahimi wrote:
> Hello,
>
> My Data is of type h5 that I open using PFlotran HDF5 reader in 
> ParaView  which are result of PFlotran simulation.
>
> What I am trying to do is to write an image at a certain time step and 
> then finally write a batch job that writes an image for each time step 
> of the simulation result.
>
> If I try to interactively go to a certain time step and then save an 
> image, everything works fine.
>
> The problem is I have 40 time steps and I want to do the same 
> procedure often. So I saved my state file as a python script and then 
> set these few lines at the end of script just before Render().
>
> RenderView1.ViewTime = 0.0
> RenderView1.CacheKey = 0.0
> RenderView1.UseCache = 0
> AnimationScene1 = GetAnimationScene()
> AnimationScene1.AnimationTime = 0.0
> WriteImage('myImage.jpg')
>
> Render()
>
>
> My timeSeries start at 0 and the python script works just fine for 0.
>
> If I change the following lines to 10000 (my final time step) or any 
> other time step, then pvpython crashes, that is the following change 
> to the script makes the pvpython crash:
>
> RenderView1.ViewTime = 10000.0
> RenderView1.CacheKey = 10000.0
> RenderView1.UseCache = 0
> AnimationScene1 = GetAnimationScene()
> AnimationScene1.AnimationTime = 10000.0
> WriteImage('myImage.jpg')
>
> Render()
>
> I used the trace to see what values I need to change to save an screen 
> shot for any time step and I ended up with ViewTime and AnimationTime.
>
> I have attached my script with this email. I would be grateful if you 
> could please tell me if I need to change more in my script or add any 
> additional lines to be able to get an screenshot of any timestep 
> rather than 0.
>
> Thanks in Advance.
>
> Hedie
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130821/2ce3ffc1/attachment.htm>


More information about the ParaView mailing list