Hi All,
I have been trying to use the output of the Python Calculator for the clip value within pvpython. I would like it to be a variable that can be added to the script, so when I change the formula, the new value will be automatically calculated when the script is run. For example, here is a simple pvpython script I have been working on. Notice the clip1.value is hardcoded in. I would like this value to come from the result of the python calculator. This could also be derived form the python annotation as well.
from paraview.simple import *
disk_out_refexo = IOSSReader(registrationName='disk_out_ref.exo', FileName=['/.../disk_out_ref/disk_out_ref.exo'])
renderView1 = GetActiveViewOrCreate('RenderView')
disk_out_refexoDisplay = Show(disk_out_refexo, renderView1, 'UnstructuredGridRepresentation')
renderView1.ResetCamera(False)
renderView1.CameraPosition = [0.0, 50.0, 0.0]
renderView1.CameraViewUp = [0.0, 0.0, 1.0]
SetActiveSource(disk_out_refexo)
pythonCalculator1 = PythonCalculator(registrationName='PythonCalculator1', Input=disk_out_refexo)
pythonCalculator1.Expression = 'mean(Temp)'
pythonCalculator1.ArrayName = 'mean_temp'
pythonCalculator1Display = GetDisplayProperties(pythonCalculator1, view=renderView1)
ColorBy(pythonCalculator1Display, ('POINTS', 'Temp'))
pythonCalculator1Display.RescaleTransferFunctionToDataRange(True, False)
pythonCalculator1Display.SetScalarBarVisibility(renderView1, True)
pythonAnnotation1 = PythonAnnotation(registrationName='PythonAnnotation1', Input=disk_out_refexo)
pythonAnnotation1.ArrayAssociation = 'Point Data'
pythonAnnotation1.Expression = 'mean(Temp)'
pythonAnnotation1Display = Show(pythonAnnotation1, renderView1, 'TextSourceRepresentation')
SetActiveSource(pythonAnnotation1)
clip1 = Clip(registrationName='Clip1', Input=pythonCalculator1)
clip1.ClipType = 'Scalar'
clip1.Scalars = ['POINTS', 'Temp']
**clip1.Value = 425**
clip1.Invert = 0
clip1Display = Show(clip1, renderView1, 'UnstructuredGridRepresentation')
clip1Display.Representation = 'Surface'
Hide(disk_out_refexo)
Hide(pythonCalculator1)