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

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

updated export script for Hobart

File size: 1.7 KB
Line 
1import project, os
2import sys
3
4from anuga.shallow_water.data_manager import sww2dem
5from anuga.abstract_2d_finite_volumes.util import Screen_Catcher
6from os import sep
7
8#time_dir = '20060928_073318' #alpha = 0.5
9time_dir = '20060928_064732' #alpha = 0.01
10#time_dir = '20060928_220905' #alpha = 1.0
11directory = project.outputdir
12name = directory + time_dir +sep + 'source'
13
14print 'output dir:', name
15#print 'Which variable do you want to export?'
16#which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3  '  ))
17which_var = 4
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**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
38print 'start sww2dem'
39sww2dem(name, basename_out = outname,
40            quantity = quantityname,
41            cellsize = 100,      # would prefer this at 25
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')
50
Note: See TracBrowser for help on using the repository browser.