Another interesting anomaly. If I use the shell and run the script once, so I have a pipeline of three objects, I get zeros. If I then run it again immediately so I have a second pipeline of the same three objects, it then outputs correctly.<div>
<br></div><div>Matt<br><div><br><div class="gmail_quote">On Tue, Apr 6, 2010 at 2:20 PM, Matthew Cragun <span dir="ltr"><<a href="mailto:mcragun@totalsim.us">mcragun@totalsim.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Pat,<div>Thanks for the reply. I tried giving an UpdatePipeline() call, but seemed to be the same result.</div><div><br></div><div>Any other thoughts?</div><div><br></div></div><div>Matt<br><div class="gmail_quote">
<div class="im">On Tue, Apr 6, 2010 at 2:07 PM, pat marion <span dir="ltr"><<a href="mailto:pat.marion@kitware.com" target="_blank">pat.marion@kitware.com</a>></span> wrote:<br>
</div><div><div></div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Try calling avgData.UpdatePipeline(). The filters are not actually
executed until there is demand. Usually a call to Render() causes this
demand, but for IntegrateVariables there is nothing to render. Not
sure if Fetch is supposed to automatically called UpdatePipeline or not.<br>
<br>Pat<br><br></div><div class="gmail_quote"><div>On Tue, Apr 6, 2010 at 1:53 PM, Matthew Cragun <span dir="ltr"><<a href="mailto:mcragun@totalsim.us" target="_blank">mcragun@totalsim.us</a>></span> wrote:<br>
</div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div><div></div><div>
<br clear="all">I have a bit of code where I read in a data file, extract a small portion of it and then integrate the variables of the extracted portion. In my python code I then fetch the data from the server with the intent to write it out to a log file. The issue that I have come across is when I run my script in the Python Shell it gives me <0,0,0> for my tuple. Then if I repeat the final four lines interactively in the Python Shell starting with the fetch command I get a proper result of <0.14, 0.5, 0>. Any ideas why I can't fetch the data properly in the script but can right after in interactively?<div>
<br></div><div>The script looks like:</div><div><br></div><div>#**********************************************************8</div><div><div>#Do X-direction</div><div>xscale = 1.0</div><div>yscale = 1.0/(2*ymax)</div><div>
zscale = 1.0/zmax</div>
<div><br></div><div>print "load Fluid"</div><div>fluid = XMLPolyDataReader(FileName=xSlice)</div><div>fluid.PointArrayStatus = ['U', 'p']</div><div>RenderView1 = GetRenderView()</div><div>DataRepresentation1 = Show()</div>
<div><br></div><div>print "extract Block"</div><div>fluidBlock = ExtractCellsByRegion(Input = fluid, IntersectWith = "Box")</div><div>fluidBlock.IntersectWith.Scale = [xscale, yscale, zscale]</div><div>
DataRepresentation2 = Show()</div><div><br></div><div>print "integrate"</div><div>avgData = IntegrateVariables(Input = fluidBlock)</div><div>DataRepresentation3 = Show()</div><div>Render()</div><div><br></div><div>
data = servermanager.Fetch(avgData,0)</div><div>pointData = data.GetPointData()</div><div>avgVar = pointData.GetArray(0).GetTuple3(0)</div><div>print avgVar</div><div>#****************************************************</div>
<div><br></div><div>Thanks,</div>-- <br>Matt Cragun<br> <br>Engineer<br>TotalSim LLC <br>7003 Post Road, <br>Suite 415 <br>Dublin, Ohio 43016<br>O: (614) 255-7426<br>M: (801) 404-6021 <br>E: <a href="mailto:mcragun@totalsim.us" target="_blank">mcragun@totalsim.us</a><br>
</div>
<br></div></div><div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></div></blockquote></div><br>
</blockquote></div></div></div><div><div></div><div class="h5"><br><br clear="all"><br>-- <br>Matt Cragun<br> <br>Engineer<br>TotalSim LLC <br>7003 Post Road, <br>Suite 415 <br>Dublin, Ohio 43016<br>
O: (614) 255-7426<br>M: (801) 404-6021 <br>
E: <a href="mailto:mcragun@totalsim.us" target="_blank">mcragun@totalsim.us</a><br>
</div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Matt Cragun<br> <br>Engineer<br>TotalSim LLC <br>7003 Post Road, <br>Suite 415 <br>Dublin, Ohio 43016<br>O: (614) 255-7426<br>M: (801) 404-6021 <br>
E: <a href="mailto:mcragun@totalsim.us">mcragun@totalsim.us</a><br>
</div></div>