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

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

clean up

File size: 2.0 KB
RevLine 
[3615]1import project, os
2import sys
3
[3650]4from anuga.shallow_water.data_manager import sww2dem
[3661]5#from anuga.pyvolution.ermapper_grids import read_ermapper_grid
6from anuga.abstract_2d_finite_volumes.util import Screen_Catcher
[3615]7from os import sep
8
[3661]9time_dir = '20060922_024842' #MSL
[3615]10directory = project.outputdir
[3661]11name = directory + time_dir +sep + 'source'
[3615]12
[3661]13print 'output dir:', name
[3615]14#print 'Which variable do you want to export?'
15#which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3  '  ))
[3661]16which_var = 4
17#sys.stderr.write(sys.stdout.data)
[3615]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
[3661]37    outname = name + '_elevation_node3'
[3615]38    quantityname = 'elevation'  #Elevation
39
[3661]40print 'start sww2dem'
41#sys.stderr.write(sys.stdout.data)
[3615]42sww2dem(name, basename_out = outname,
43            quantity = quantityname,
[3661]44            cellsize = 25,      # Trevor would like this at 25
[3615]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')
[3661]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.