[Paraview] Writing Images at certian time Steps using pvpython

Hedieh Ebrahimi hedieh.ebrahimi at amphos21.com
Thu Aug 22 05:16:35 EDT 2013


Hi Burlen,

Thanks for your reply. Actually when I mentioned final time step at  10000
to get the image; by 10000 I actually was referring to the the time. ( The
time step related to this time (10000) is time step 40)

I see what time is relating to what time step by using the
"AnnotateTimeFilter" and seeing the times interactively.

Considering that I know the correct time, still pvpython crashes when I try
to get the image at a different time by changing the following to
time=10000 or any other time that exist in my simulation result.

RenderView1.ViewTime = 10000.0
RenderView1.CacheKey = 10000.0
RenderView1.UseCache = 0
AnimationScene1 = GetAnimationScene()
AnimationScene1.AnimationTime = 10000.0
WriteImage('myImage.jpg')

Render()

Any ideas on what I could be doing wrong and how to get the image at a
different time using pvpython ?

I´d appreciate any help
Thanks


On 21 August 2013 18:27, Burlen Loring <bloring at lbl.gov> wrote:

>  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/20130822/cec902ba/attachment.htm>


More information about the ParaView mailing list