On 7/6/2017 12:38 PM, Cory Quammen wrote:
I would look at using the Python scripting capabilities within
ParaView for this. You can write a Python script and run it with
pvpython - this is especially useful for running an analysis in a
batch fashion. Within your script you use the Probe filter to get the
data value at a particular location and add that value to some
Calculator expression as needed. Here's a quick example:

from paraview.simple import *

data = FindSource('MyDataSource')
probe = ProbeLocation(Input=data, ProbeType='Fixed Radius Point Source')
probe.ProbeType.Center = [1.0, 0.0, 0.0]
probe.UpdatePipeline()
probePoint = paraview.servermanager.Fetch(probe)
value_at_probe = probePoint.GetPointData().GetArray('my array name').GetValue(0)

calculator_expression = #... value_at_probe + other expression
c1 = Calculator(Input=appendedData)
c1.Function = calculator_expression
...


I hope that helps get you started. Let us know if you have other
questions about the scripting.
Thank you very much for your help, that helped a lot! Some notes for anyone else finding this and needing some help: Using the Trace feature is extremely useful for getting the majority of a script written, and then the above code can be inserted. However, two changes had to be made in at least my case:

1. probePoint.GetPointData().GetArray('my array name').GetValue(0) had
   to be changed to probePoint.GetPointData().GetVectors('my vector
   name').GetValue(0) as the data type being probed was a vector.
2. When using value_at_probe in my calculator_expression variable, it
   couldn't just be dropped in. Since my expression was a string like
   calcexp='(gradient_x*2/value_at_probe)^(1/2)', it needed to be
   changed to calcexp='(gradient_x*2/{})^(1/2)'.format(value_at_probe)
   so that the numerical value was passed in as a string, and then
   passed to the calculator filter.

_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview

Reply via email to