[Paraview] python calculator: compute max value into a variable

Peter A. Gustafson peter.gustafson at wmich.edu
Fri Mar 11 11:47:08 EST 2011


Hi,

I'm a newish user struggling with python and paraview... specifically,
I'd like to plot normalized scalar results and the print the
normalization factor as the title of the scalar bar.

I've found as a method of normalization from which a contour can be
plotted.

PyCalc1 = PythonCalculator()
PyCalc1.Expression = 'scalardata/max(scalardata)'
PyCalc1.ArrayName = 'normalized_scalar'

However, I'm stuck on how to capture the actual value of the max into a
variable for use as a label.

Somthing like:
maxval = max('scalardata')

where maxval now can be used for other purposes (ie further
normalization and labeling).  I'm new to python... therefore none of the
syntax and structure has become is intuitive.

Thanks,
-- 
Peter A. Gustafson
Western Michigan University


More information about the ParaView mailing list