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

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

test case for export

File size: 2.0 KB
Line 
1import project, os
2import sys
3
4from anuga.shallow_water.data_manager import sww2dem
5#from anuga.pyvolution.ermapper_grids import read_ermapper_grid
6from anuga.abstract_2d_finite_volumes.util import Screen_Catcher
7from os import sep
8
9time_dir = '20060925_115139' #MSL
10directory = project.outputdir
11name = directory + time_dir +sep + 'source'
12
13print 'output dir:', name
14#print 'Which variable do you want to export?'
15#which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3  '  ))
16which_var = 4
17#sys.stderr.write(sys.stdout.data)
18if which_var == 0:  # Stage
19    outname = name + '_stage'
20    quantityname = 'stage'
21
22if which_var == 1:  # Absolute Momentum
23    outname = name + '_momentum'
24    quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  #Absolute momentum
25
26if which_var == 2:  # Depth
27    outname = name + '_depth'
28    quantityname = 'stage-elevation'  #Depth
29
30if which_var == 3:  # Speed
31    outname = name + '_speed'
32    #quantityname = '((xmomentum/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5'  #Speed
33    #quantityname = 'xmomentum/(stage-elevation)'  #Speed
34    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed
35
36if which_var == 4:  # Elevation
37    outname = name + '_elevation_node3'
38    quantityname = 'elevation'  #Elevation
39
40print 'start sww2dem'
41#sys.stderr.write(sys.stdout.data)
42sww2dem(name, basename_out = outname,
43            quantity = quantityname,
44            cellsize = 25,      # would prefer this at 25
45            # define region for viz purposes
46            easting_min = project.e_min_area,
47            easting_max = project.e_max_area,
48            northing_min = project.n_min_area,
49            northing_max = project.n_max_area,       
50            reduction = max, #this is because we want max quantityname
51            verbose = True,
52            format = 'asc')
53
54#sys.stderr.write(sys.stdout.data)
55
56#Check
57
58#data = read_ermapper_grid(name)
59#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.