source: anuga_work/production/hobart_2006/export_results.py @ 3672

Last change on this file since 3672 was 3672, checked in by sexton, 18 years ago
File size: 1.6 KB
Line 
1import project, os
2import sys
3
4from anuga.shallow_water.data_manager import sww2dem
5from anuga.abstract_2d_finite_volumes.util import Screen_Catcher
6from os import sep
7
8time_dir = '20060927_081957' #MSL
9directory = project.outputdir
10name = directory + time_dir +sep + 'source'
11
12print 'output dir:', name
13#print 'Which variable do you want to export?'
14#which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3  '  ))
15which_var = 4
16if which_var == 0:  # Stage
17    outname = name + '_stage'
18    quantityname = 'stage'
19
20if which_var == 1:  # Absolute Momentum
21    outname = name + '_momentum'
22    quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  #Absolute momentum
23
24if which_var == 2:  # Depth
25    outname = name + '_depth'
26    quantityname = 'stage-elevation'  #Depth
27
28if which_var == 3:  # Speed
29    outname = name + '_speed'
30    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed
31
32if which_var == 4:  # Elevation
33    outname = name + '_elevation'
34    quantityname = 'elevation'  #Elevation
35
36print 'start sww2dem'
37sww2dem(name, basename_out = outname,
38            quantity = quantityname,
39            cellsize = 100,      # would prefer this at 25
40            # define region for viz purposes
41            easting_min = project.e_min_area,
42            easting_max = project.e_max_area,
43            northing_min = project.n_min_area,
44            northing_max = project.n_max_area,       
45            reduction = max, #this is because we want max quantityname
46            verbose = True,
47            format = 'asc')
48
Note: See TracBrowser for help on using the repository browser.