source: production/sydney_2006/export_results.py @ 2763

Last change on this file since 2763 was 2326, checked in by sexton, 19 years ago

Fixes to velocity calculation

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
6#name = project.newoutputname
7name = project.outputname
8
9#print 'Which variable do you want to export?'
10#which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3  '  ))
11which_var = 3
12
13if which_var == 0:  # Stage
14    outname = name + '_stage'
15    quantityname = 'stage'
16
17if which_var == 1:  # Absolute Momentum
18    outname = name + '_momentum'
19    quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  #Absolute momentum
20
21if which_var == 2:  # Depth
22    outname = name + '_depth'
23    quantityname = 'stage-elevation'  #Depth
24
25if which_var == 3:  # Speed
26    outname = name + '_speed'
27    #quantityname = '((xmomentum/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5'  #Speed
28    #quantityname = 'xmomentum/(stage-elevation)'  #Speed
29    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed
30
31   
32sww2dem(name, basename_out = outname,
33            quantity = quantityname,
34            cellsize = 25,       # Trevor would like this at 25
35            # define region for viz purposes
36            easting_min = project.eminviz,
37            easting_max = project.emaxviz,
38            northing_min = project.nminviz,
39            northing_max = project.nmaxviz,       
40            reduction = max, #this is because we want max quantityname
41            verbose = True,
42            format = 'asc')
43
44#Check
45
46#data = read_ermapper_grid(name)
47#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.