source: anuga_work/production/broome/2007/export_results.py @ 5001

Last change on this file since 5001 was 5001, checked in by nick, 16 years ago

update broome with new structure

File size: 2.9 KB
Line 
1import project_urs, os
2import sys
3
4from anuga.shallow_water.data_manager import sww2dem
5from os import sep
6
7time_dir = '20070615_063022_run_final_4.9_exmouth_nbartzis' # HAT exmouth
8#time_dir = '20070615_062730_run_final_0_exmouth_nbartzis' # MSL exmouth
9#time_dir = '20070618_064014_run_final_4.9_onslow_nbartzis' # HAT onslow
10#time_dir = '20070622_004008_run_final_0_onslow_nbartzis' # MSL onslow
11#time_dir = '20070615_063137_run_final_4.9_dampier_nbartzis' # HAT dampier
12#time_dir = '20070621_002922_run_final_0_dampier_nbartzis' # MSL dampier
13
14
15cellsize = 25
16timestep = None
17directory = project_urs.output_dir
18#name = directory + time_dir + sep + project.scenario_name
19name = directory+time_dir+sep+project_urs.scenario_name
20
21#is_parallel = True
22is_parallel = False
23if is_parallel == True: nodes = 4
24print 'output dir:', name
25
26var = [3]
27
28for which_var in var:
29    if which_var == 0:  # Stage
30        outname = name + '_stage'
31        quantityname = 'stage'
32
33    if which_var == 1:  # Absolute Momentum
34        outname = name + '_momentum_i1'
35        quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
36
37    if which_var == 2:  # Depth
38        outname = name + '_depth'
39        quantityname = 'stage-elevation' 
40
41    if which_var == 3:  # Speed
42        outname = name + '_speed'
43        quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
44
45    if which_var == 4:  # Elevation
46        outname = name + '_elevation'
47        quantityname = 'elevation'  #Elevation
48
49    if is_parallel == True:
50    #    print 'is_parallel',is_parallel
51        for i in range(0,nodes):
52            namei = name + '_P%d_%d' %(i,nodes)
53            outnamei = outname + '_P%d_%d' %(i,nodes)
54            print 'start sww2dem for sww file %d' %(i)
55            sww2dem(namei, basename_out = outnamei,
56                        quantity = quantityname,
57                        timestep = timestep,
58                        cellsize = cellsize,     
59                        easting_min = project_urs.e_min_area,
60                        easting_max = project_urs.e_max_area,
61                        northing_min = project_urs.n_min_area,
62                        northing_max = project_urs.n_max_area,       
63                        reduction = max, 
64                        verbose = True,
65                        format = 'asc')
66    else:
67        print 'start sww2dem'
68        sww2dem(name, basename_out = outname,
69                    quantity = quantityname,
70                    timestep = timestep,
71                    cellsize = cellsize,     
72                    easting_min = project_urs.eastingmin,
73                    easting_max = project_urs.eastingmax,
74                    northing_min = project_urs.northingmin,
75                    northing_max = project_urs.northingmax,       
76                    reduction = max, 
77                    verbose = True,
78                    format = 'asc')
79
Note: See TracBrowser for help on using the repository browser.