source: trunk/anuga_work/development/attenuation_near_shore/visualise_height.py @ 7884

Last change on this file since 7884 was 5161, checked in by steve, 16 years ago
File size: 1.0 KB
Line 
1#!/usr/bin/env python
2##########
3# Demonstration of the VTK sww Visualiser
4# Jack Kelly
5# September 2006
6##########
7
8# Import the offline visualiser
9from anuga.visualiser import OfflineVisualiser
10from vtk import vtkCubeAxesActor2D
11from Numeric import sqrt
12
13o = OfflineVisualiser("zz0.0.sww")
14
15
16# Specify the height-based-quantities to render.
17# Remember to set dynamic=True for time-varying quantities
18o.render_quantity_height("elevation", zScale=100.0, offset = 5.0, dynamic=False)
19o.render_quantity_height("stage", zScale=100.0, opacity=0.7, dynamic=True)
20
21# Colour the stage:
22o.colour_height_quantity('stage', (lambda q:(q['stage']), -1.5, 1.5))
23#o.colour_height_quantity('stage', (0,0,0.7))
24
25#o.colour_height_quantity('stage', (lambda q:sqrt(((q['xmomentum']/(q['stage']-q['elevation'])) ** 2) +
26#                                             ((q['ymomentum']/(q['stage']-q['elevation'])) ** 2)), 0, 0.5))
27
28# Start the visualiser (in its own thread).
29o.start()
30
31# Wait for the visualiser to terminate before shutting down.
32o.join()
Note: See TracBrowser for help on using the repository browser.