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

Last change on this file since 3672 was 3672, checked in by sexton, 18 years ago
File size: 1.6 KB
RevLine 
[3615]1import project, os
2import sys
3
[3650]4from anuga.shallow_water.data_manager import sww2dem
[3661]5from anuga.abstract_2d_finite_volumes.util import Screen_Catcher
[3615]6from os import sep
7
[3672]8time_dir = '20060927_081957' #MSL
[3615]9directory = project.outputdir
[3661]10name = directory + time_dir +sep + 'source'
[3615]11
[3661]12print 'output dir:', name
[3615]13#print 'Which variable do you want to export?'
14#which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3  '  ))
[3661]15which_var = 4
[3615]16if which_var == 0:  # Stage
17    outname = name + '_stage'
18    quantityname = 'stage'
19
20if which_var == 1:  # Absolute Momentum
21    outname = name + '_momentum'
22    quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  #Absolute momentum
23
24if which_var == 2:  # Depth
25    outname = name + '_depth'
26    quantityname = 'stage-elevation'  #Depth
27
28if which_var == 3:  # Speed
29    outname = name + '_speed'
30    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed
31
32if which_var == 4:  # Elevation
[3671]33    outname = name + '_elevation'
[3615]34    quantityname = 'elevation'  #Elevation
35
[3661]36print 'start sww2dem'
[3615]37sww2dem(name, basename_out = outname,
38            quantity = quantityname,
[3672]39            cellsize = 100,      # would prefer this at 25
[3615]40            # define region for viz purposes
[3672]41            easting_min = project.e_min_area,
42            easting_max = project.e_max_area,
43            northing_min = project.n_min_area,
44            northing_max = project.n_max_area,       
[3615]45            reduction = max, #this is because we want max quantityname
46            verbose = True,
47            format = 'asc')
[3661]48
Note: See TracBrowser for help on using the repository browser.