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

Last change on this file since 3615 was 3615, checked in by sexton, 17 years ago

updates to Hobart script(data not yet received)

File size: 1.7 KB
Line 
1import project, os
2import sys
3
4from anuga.pyvolution.data_manager import sww2dem
5from anuga.pyvolution.ermapper_grids import read_ermapper_grid
6from anuga.pyvolution.util import Screen_Catcher
7from os import sep
8
9time_dir = '20060706_235246' #MSL
10directory = project.outputdir
11name = directory + time_dir + sep + 'source'
12
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 = 2
16
17if which_var == 0:  # Stage
18    outname = name + '_stage'
19    quantityname = 'stage'
20
21if which_var == 1:  # Absolute Momentum
22    outname = name + '_momentum'
23    quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  #Absolute momentum
24
25if which_var == 2:  # Depth
26    outname = name + '_depth'
27    quantityname = 'stage-elevation'  #Depth
28
29if which_var == 3:  # Speed
30    outname = name + '_speed'
31    #quantityname = '((xmomentum/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5'  #Speed
32    #quantityname = 'xmomentum/(stage-elevation)'  #Speed
33    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed
34
35if which_var == 4:  # Elevation
36    outname = name + '_elevation'
37    quantityname = 'elevation'  #Elevation
38
39sww2dem(name, basename_out = outname,
40            quantity = quantityname,
41            cellsize = 20,       
42            # define region for viz purposes
43            easting_min = project.e_min_area,
44            easting_max = project.e_max_area,
45            northing_min = project.n_min_area,
46            northing_max = project.n_max_area,       
47            reduction = max, #this is because we want max quantityname
48            verbose = True,
49            format = 'asc')
Note: See TracBrowser for help on using the repository browser.