Creating a Python Calculator Filter

Use the techniques discussed in the Python Calculator section to generate a new data array for a Sphere source.

  • Add a Sphere source and increase its Theta and Phi resolutions to 32.
  • Add a Python Calculator and set its Expression to generate a new scalar data array that wraps from -ϖ to +ϖ around the Z axis of the sphere. The Python expression for this value passes the X and Y elements of each data point to the arctangent function:
  • Use the new data array to map the color ramp to the sphere. Note that there will be a visible seam where the min and max values are adjacent.
ParaView displaying a sphere colored using a new data array from a Python Calculator filter
ParaView displaying a sphere colored using a new data array from a Python Calculator filter
 
©  |   Cornell University    |   Center for Advanced Computing    |   Copyright Statement    |   Inclusivity Statement