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?
The script looks like: #**********************************************************8 #Do X-direction xscale = 1.0 yscale = 1.0/(2*ymax) zscale = 1.0/zmax print "load Fluid" fluid = XMLPolyDataReader(FileName=xSlice) fluid.PointArrayStatus = ['U', 'p'] RenderView1 = GetRenderView() DataRepresentation1 = Show() print "extract Block" fluidBlock = ExtractCellsByRegion(Input = fluid, IntersectWith = "Box") fluidBlock.IntersectWith.Scale = [xscale, yscale, zscale] DataRepresentation2 = Show() print "integrate" avgData = IntegrateVariables(Input = fluidBlock) DataRepresentation3 = Show() Render() data = servermanager.Fetch(avgData,0) pointData = data.GetPointData() avgVar = pointData.GetArray(0).GetTuple3(0) print avgVar #**************************************************** Thanks, -- Matt Cragun Engineer TotalSim LLC 7003 Post Road, Suite 415 Dublin, Ohio 43016 O: (614) 255-7426 M: (801) 404-6021 E: mcra...@totalsim.us
_______________________________________________ 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