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

Last change on this file since 3650 was 3650, checked in by sexton, 18 years ago

updates for Hobart and want to export elevation grid for Onslow

File size: 1.7 KB
Line 
1import project, os
2import sys
3
4from anuga.shallow_water.data_manager import sww2dem
5from os import sep
6
7time_dir = '20060921_083846' #MSL
8directory = project.outputdir
9name = directory + time_dir + sep + 'source'
10
11#print 'Which variable do you want to export?'
12#which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3  '  ))
13which_var = 4 # for Hamish/Alex to compare
14#which_var = 2 # for Ingo/Neil to make maps
15
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/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5'  #Speed
31    #quantityname = 'xmomentum/(stage-elevation)'  #Speed
32    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed
33
34if which_var == 4:  # Elevation
35    outname = name + '_elevation'
36    quantityname = 'elevation'  #Elevation
37
38sww2dem(name, basename_out = outname,
39            quantity = quantityname,
40            cellsize = 25,       
41            # define region for viz purposes
42            easting_min = project.e_min_area,
43            easting_max = project.e_max_area,
44            northing_min = project.n_min_area,
45            northing_max = project.n_max_area,       
46            reduction = max, #this is because we want max quantityname
47            verbose = True,
48            format = 'asc')
Note: See TracBrowser for help on using the repository browser.