[Paraview] Fetching Data via Script and Interactively
Matthew Cragun
mcragun at totalsim.us
Tue Apr 6 14:20:57 EDT 2010
Pat,
Thanks for the reply. I tried giving an UpdatePipeline() call, but seemed
to be the same result.
Any other thoughts?
Matt
On Tue, Apr 6, 2010 at 2:07 PM, pat marion <pat.marion at kitware.com> wrote:
> 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.
>
> Pat
>
> On Tue, Apr 6, 2010 at 1:53 PM, Matthew Cragun <mcragun at totalsim.us>wrote:
>
>>
>> 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: mcragun at 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
>>
>>
>
--
Matt Cragun
Engineer
TotalSim LLC
7003 Post Road,
Suite 415
Dublin, Ohio 43016
O: (614) 255-7426
M: (801) 404-6021
E: mcragun at totalsim.us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100406/79c33957/attachment-0001.htm>
More information about the ParaView
mailing list