Python Code Example : Time-Varying data

Apply varying box operator to different timestep

This script applies to a time-varing dataset. I want to extract a slab of isosurface (box operator plus isosurface operator) structure as time evolves, this is to show the growing pattern of the isosurface:

# omiting open database, add pseudocolor and isosurface, etc.

AddOperator("Box", 0)
BoxAtts = BoxAttributes()
BoxAtts.amount = BoxAtts.Some  # Some, All
BoxAtts.minx = -4
BoxAtts.maxx = 4
BoxAtts.miny = 0
BoxAtts.maxy = 1.5
BoxAtts.minz = -4
BoxAtts.maxz = 4
SetOperatorOptions(BoxAtts, 1)

seg_y =     [0,  0.245,  0.325,  0.46,  0.75,  1.1,   1.5]
seg_state = [0,  55,     64,     75,    100,   140,   200]


for i in range(1, len(seg_y)):
   print i

   state = seg_state[i]
   print state

   seg_lo = seg_y[i-1]
   seg_hi = seg_y[i]
   print seg_lo, seg_hi

   SetTimeSliderState(state)
   BoxAtts.miny = seg_lo
   BoxAtts.maxy = seg_hi
   SetOperatorOptions(BoxAtts, 1)

   DrawPlots()
   SaveWindow()