source: anuga_work/development/boxingday08/export_results.py @ 5316

Last change on this file since 5316 was 5247, checked in by jakeman, 17 years ago

First commit of 2008 Boxing day validation files

File size: 2.1 KB
Line 
1
2import sys
3
4from anuga.shallow_water.data_manager import sww2dem
5from os import sep
6
7
8#time_dir = '20070322_035135' # birubi
9
10#directory = project_slide.outputdir
11#name = directory + time_dir + sep + project_slide.basename
12#name = 'test500000.035000'
13#name = 'test'
14name = 'good_simulationsourcefriction20080404_140016'
15is_parallel = False
16if is_parallel == True: nodes = 4
17print 'output dir:', name
18
19which_var = 2
20if which_var == 0:  # Stage
21    outname = name + '_stage-eq-thurs-test'
22    quantityname = 'stage'
23
24if which_var == 1:  # Absolute Momentum
25    outname = name + '_momentum_i1'
26    quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
27
28if which_var == 2:  # Depth
29    outname = name + '_depth'
30    quantityname = 'stage-elevation' 
31
32if which_var == 3:  # Speed
33    outname = name + '_speed_i0'
34    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
35
36if which_var == 4:  # Elevation
37    outname = name + '_elevation'
38    quantityname = 'elevation'  #Elevation
39
40if is_parallel == True:
41    for i in range(0,nodes):
42        namei = name + '_P%d_%d' %(i,nodes)
43        outnamei = outname + '_P%d_%d' %(i,nodes)
44        print 'start sww2dem for sww file %d' %(i)
45        sww2dem(namei, basename_out = outnamei,
46                    quantity = quantityname,
47                    timestep = 1,
48                    cellsize = 100,     
49                    #easting_min = project.e_min_area,
50                    #easting_max = project.e_max_area,
51                    #northing_min = project.n_min_area,
52                    #northing_max = project.n_max_area,       
53                    reduction = max, 
54                    verbose = True,
55                    format = 'asc')
56else:
57    print 'start sww2dem'
58    sww2dem(name, basename_out = outname,
59                quantity = quantityname,
60                #timestep = 0,
61                cellsize = 50,     
62                #easting_min = 416920,
63                #easting_max = 425310,
64                #northing_min = 877864,
65                #northing_max = 869570,       
66                reduction = max, 
67                verbose = True,
68                format = 'asc')
Note: See TracBrowser for help on using the repository browser.