<div dir="ltr"><div><div>Hi,</div><div><br></div><div>I have data in time that has time points like {0.02124,0.04248,0.06372,0.08496, etc.}</div><div><br></div><div>I wrote a python script to loop through these time points with time increment of 0.02124 and export as .csv. </div>
<div><br></div><div>----------------------------------------------</div><div><br></div><div>for x in range(1, 4):</div><div><br></div><div><span class="" style="white-space:pre"> </span>currentT = x*deltaT</div><div><span class="" style="white-space:pre"> </span>AnimationScene1 = GetAnimationScene()</div>
<div><span class="" style="white-space:pre"> </span>RenderView1 = GetRenderView()</div><div><span class="" style="white-space:pre"> </span>AnimationScene1.AnimationTime = currentT</div><div><span class="" style="white-space:pre"> </span>RenderView1.ViewTime = currentT</div>
<div><span class="" style="white-space:pre"> </span>RenderView1.CacheKey = currentT</div><div><span class="" style="white-space:pre"> </span>RenderView1.UseCache = 1</div><div><span class="" style="white-space:pre"> </span>RenderView1.UseCache = 0</div>
<div><br></div><div><span class="" style="white-space:pre"> </span></div><div><span class="" style="white-space:pre"> </span>SetActiveSource(data)</div><div><span class="" style="white-space:pre"> </span>writer = CreateWriter("output.csv")</div>
<div><span class="" style="white-space:pre"> </span>writer.FieldAssociation = "Points"</div><div><span class="" style="white-space:pre"> </span>writer.UpdatePipeline()</div><div><span class="" style="white-space:pre"> </span>del writer</div>
<div><br></div><div><span class="" style="white-space:pre"> </span>Render()</div><div><br></div><div>------------------------------------------</div><div><br></div><div>When I played the macro, some time points were not correctly read. (e.g. the 4th time point spreadsheet saved data that belong to the 3rd time point.)</div>
<div><br></div><div>I used "start trace" to see how paraview handles time, and here is what I caught:</div><div><br></div><div>--------------------------------------------------------</div><div>try: paraview.simple</div>
<div>except: from paraview.simple import *</div><div>paraview.simple._DisableFirstRenderCameraReset()</div><div><br></div><div>AnimationScene1 = GetAnimationScene()</div><div>RenderView1 = GetRenderView()</div><div>AnimationScene1.AnimationTime = 0.021239999681711197</div>
<div><br></div><div>RenderView1.ViewTime = 0.021239999681711197</div><div>RenderView1.CacheKey = 0.021239999681711197</div><div>RenderView1.UseCache = 1</div><div><br></div><div>AnimationScene1.AnimationTime = 0.042479999363422394</div>
<div><br></div><div>RenderView1.ViewTime = 0.042479999363422394</div><div>RenderView1.CacheKey = 0.042479999363422394</div><div>RenderView1.UseCache = 1</div><div><br></div><div>AnimationScene1.AnimationTime = 0.06372000277042389</div>
<div><br></div><div>RenderView1.ViewTime = 0.06372000277042389</div><div>RenderView1.CacheKey = 0.06372000277042389</div><div>RenderView1.UseCache = 1</div><div><br></div><div>AnimationScene1.AnimationTime = 0.08495999872684479</div>
<div><br></div><div>RenderView1.ViewTime = 0.08495999872684479</div><div>RenderView1.CacheKey = 0.08495999872684479</div><div>RenderView1.UseCache = 1</div><div><br></div><div>RenderView1.UseCache = 0</div><div><br></div>
<div>Render()</div><div>--------------------------------------------------------</div><div>Then I realized, if I tried to read data at 0.08496, it will read data from the previous time point instead. If I explicitly specify in my script to read data at time 0.08495999872684479, then it will read the correct data.</div>
<div><br></div><div>Anyone has any insights?</div><div>Thanks in advance!!!</div></div><div><br></div>-- <br>Elaine</div>