source: production/sydney_2006/export_results.py @ 3190

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

MOST and ANUGA comparisons and updates

File size: 1.6 KB
Line 
1import project, os
2
3from pyvolution.data_manager import sww2dem
4from pyvolution.ermapper_grids import read_ermapper_grid
5
6name = project.outputname
7
8#print 'Which variable do you want to export?'
9#which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3  '  ))
10which_var = 2
11
12if which_var == 0:  # Stage
13    outname = name + '_stage'
14    quantityname = 'stage'
15
16if which_var == 1:  # Absolute Momentum
17    outname = name + '_momentum'
18    quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  #Absolute momentum
19
20if which_var == 2:  # Depth
21    outname = name + '_depth'
22    quantityname = 'stage-elevation'  #Depth
23
24if which_var == 3:  # Speed
25    outname = name + '_speed'
26    #quantityname = '((xmomentum/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5'  #Speed
27    #quantityname = 'xmomentum/(stage-elevation)'  #Speed
28    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed
29
30   
31sww2dem(name, basename_out = outname,
32            quantity = quantityname,
33            cellsize = 25,       # Trevor would like this at 25
34            # define region for viz purposes
35            easting_min = project.eminviz,
36            easting_max = project.emaxviz,
37            northing_min = project.nminviz,
38            northing_max = project.nmaxviz,       
39            reduction = max, #this is because we want max quantityname
40            verbose = True,
41            format = 'asc')
42
43#Check
44
45#data = read_ermapper_grid(name)
46#print 'Values from %s are in [%f, %f]' %(name, min(data.flat), max(data.flat))
Note: See TracBrowser for help on using the repository browser.