<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">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<br>
<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<pre style="font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin-top: 0px; margin-bottom: 0px; color: rgb(51, 51, 51); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><div class="line" id="LC377" style="padding-left: 10px;"><span class="n" style="color: rgb(51, 51, 51);">...
nSteps</span> <span class="o" style="font-weight: bold;">=</span> <span class="mi" style="color: rgb(0, 153, 153);">0</span></div><div class="line" id="LC378" style="padding-left: 10px;"><span class="n" style="color: rgb(51, 51, 51);">steps</span> <span class="o" style="font-weight: bold;">=</span> <span class="n" style="color: rgb(51, 51, 51);">reader</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: rgb(51, 51, 51);">TimestepValues</span></div><div class="line" id="LC379" style="padding-left: 10px;"><span class="k" style="font-weight: bold;">try</span><span class="p">:</span></div><div class="line" id="LC380" style="padding-left: 10px;"> <span class="n" style="color: rgb(51, 51, 51);">nSteps</span> <span class="o" style="font-weight: bold;">=</span> <span class="nb" style="color: rgb(0, 134, 179);">len</span><span class="p">(</span><span class="n" style="color: rgb(51, 51, 51);">steps</span><span class="p">)</span></div><div class="lin
e" id="LC381" style="padding-left: 10px;"><span class="k" style="font-weight: bold;">except</span><span class="p">:</span></div><div class="line" id="LC382" style="padding-left: 10px;"> <span class="n" style="color: rgb(51, 51, 51);">nSteps</span> <span class="o" style="font-weight: bold;">=</span> <span class="mi" style="color: rgb(0, 153, 153);">1</span></div><div class="line" id="LC383" style="padding-left: 10px;"> <span class="n" style="color: rgb(51, 51, 51);">steps</span> <span class="o" style="font-weight: bold;">=</span> <span class="p">[</span><span class="n" style="color: rgb(51, 51, 51);">steps</span><span class="p">]
...
</span></div></pre>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<pre style="font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin-top: 0px; margin-bottom: 0px; color: rgb(51, 51, 51); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><div class="line" id="LC454" style="padding-left: 10px;"><span class="n" style="color: rgb(51, 51, 51);">anim</span> <span class="o" style="font-weight: bold;">=</span> <span class="n" style="color: rgb(51, 51, 51);">GetAnimationScene</span><span class="p">()</span></div><div class="line" id="LC455" style="padding-left: 10px;"><span class="n" style="color: rgb(51, 51, 51);">anim</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: rgb(51, 51, 51);">PlayMode</span> <span class="o" style="font-weight: bold;">=</span> <span cl
ass="s" style="color: rgb(221, 17, 68);">'Snap To TimeSteps'</span></div><div class="line" id="LC456" style="padding-left: 10px;"><span class="n" style="color: rgb(51, 51, 51);">anim</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: rgb(51, 51, 51);">AnimationTime</span> <span class="o" style="font-weight: bold;">=</span> <span class="n" style="color: rgb(51, 51, 51);">steps</span><span class="p">[</span><span class="n" style="color: rgb(51, 51, 51);">step</span><span class="p">]</span></div><div class="line" id="LC457" style="padding-left: 10px;">
</div><div class="line" id="LC458" style="padding-left: 10px;"><span class="n" style="color: rgb(51, 51, 51);">view</span> <span class="o" style="font-weight: bold;">=</span> <span class="n" style="color: rgb(51, 51, 51);">GetRenderView</span><span class="p">()</span></div><div class="line" id="LC459" style="padding-left: 10px;"><span class="n" style="color: rgb(51, 51, 51);">view</span><span class="o" style="font-weight: bold;">.</span><span class="n" style="color: rgb(51, 51, 51);">ViewTime</span> <span class="o" style="font-weight: bold;">=</span> <span class="n" style="color: rgb(51, 51, 51);">steps</span><span class="p">[</span><span class="n" style="color: rgb(51, 51, 51);">step</span><span class="p">]
...
Render()
</span></div></pre>
<br>
<br>
On 08/21/2013 03:04 AM, Hedieh Ebrahimi wrote:<br>
</div>
<blockquote
cite="mid:CA+ze5C5GB6-HQn45YPLiqUGZR3fEZixETVvAMUCrZimVK4MFJQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Hello, <br>
<br>
</div>
My Data is of type h5 that I open using PFlotran HDF5 reader in
ParaView which are result of PFlotran simulation.<br>
<div>
<div><br>
</div>
<div>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.<br>
<br>
</div>
If I try to interactively go to a certain time step and then
save an image, everything works fine.<br>
<br>
</div>
<div>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().<br>
<br>
RenderView1.ViewTime = 0.0<br>
RenderView1.CacheKey = 0.0<br>
RenderView1.UseCache = 0<br>
AnimationScene1 = GetAnimationScene()<br>
AnimationScene1.AnimationTime = 0.0<br>
WriteImage('myImage.jpg')<br>
<br>
Render()<br>
<br>
<br>
</div>
<div>My timeSeries start at 0 and the python script works just
fine for 0.<br>
<br>
</div>
<div>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:<br>
<br>
RenderView1.ViewTime = 10000.0<br>
RenderView1.CacheKey = 10000.0<br>
RenderView1.UseCache = 0<br>
AnimationScene1 = GetAnimationScene()<br>
AnimationScene1.AnimationTime = 10000.0<br>
WriteImage('myImage.jpg')<br>
<br>
Render()<br>
<br>
</div>
<div>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.<br>
<br>
</div>
<div>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.<br>
<br>
</div>
<div>Thanks in Advance.<br>
<br>
</div>
<div>Hedie</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the ParaView Wiki at: <a class="moz-txt-link-freetext" href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a></pre>
</blockquote>
<br>
</body>
</html>