source: anuga_work/production/onslow_2006/export_results.py @ 4856

Last change on this file since 4856 was 4856, checked in by sexton, 17 years ago

rename plot_polygons_points to original name of plot_polygons

File size: 4.1 KB
Line 
1import project_grad, os
2import sys
3
4from anuga.shallow_water.data_manager import sww2dem
5from os import sep
6
7#time_dir = '20070613_034754_run_final_1.5_dampier_nbartzis' # HAT 1 in Dampier 10000 yr
8#time_dir = '20070518_021050_run_final_0.0_nbartzis' # MSL 1 in Dampier 10000 yr
9#time_dir = '' # HAT 1 in Broome 10000 yr
10#time_dir = '' # MSL 1 in Broome 10000 yr
11#time_dir = '' # HAT 1 in Pt Hedland 10000 yr
12#time_dir = '' # MSL 1 in Pt Hedland 10000 yr
13#time_dir = '20070608_060316_run_final_1.5_onslow_nbartzis' # HAT 1 in Onslow 10000 yr
14#time_dir = '20070531_002753_run_final_0.0_onslow_nbartzis' # MSL 1 in Onslow 10000 yr
15#time_dir = '20070608_062811_run_final_1.5_exmouth_nbartzis' # HAT 1 in Exmouth 10000 yr
16#time_dir = '20070605_234905_run_final_0.0_exmouth_nbartzis' # MSL 1 in Exmouth 10000 yr
17#time_dir = '20060704_063005' # 2006 simulation HAT Mw9
18#time_dir = '20070619_042140_run_final_1.5_exmouth_nbartzis' # exmouth HAT longer time
19#time_dir = '20070904_235118_run_final_1.5_jsexton_exmouth_original' # revised model original data
20#time_dir = '20070905_052311_run_final_1.5_jsexton_exmouth_revised' # revised model original + survey data
21time_dir = '20070906_061418_run_final_1.5_jsexton_exmouth_original' # refined again
22#time_dir = '20070907_055936_run_final_1.5_jsexton_exmouth_revised' # refined again
23cellsize = 25
24#cellsize = 150
25timestep = None
26directory = project_grad.output_dir
27#name = directory + time_dir + sep + project_grad.scenario_name
28name = directory+time_dir+sep+project_grad.scenario_name
29#name = directory+time_dir+sep+'onslow_time_35760_0'
30#name = directory+time_dir+sep+'source'
31
32from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
33
34#elevgrid = directory+time_dir+sep+'onslow_elevation_town'
35
36#convert_dem_from_ascii2netcdf(elevgrid, use_cache=True, verbose=True)
37
38#dem2pts(elevgrid,run_up_elev=True,run_up_loc=True)
39
40is_parallel = False
41#is_parallel = True
42if is_parallel == True: nodes = 4
43print 'output dir:', name
44
45#var = [2,3,4] # depth and speed
46#var = [2] # depth
47var = [4] 
48
49for which_var in var:
50    if which_var == 0:  # Stage
51        outname = name + '_stage'
52        quantityname = 'stage'
53
54    if which_var == 1:  # Absolute Momentum
55        outname = name + '_momentum'
56        quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
57
58    if which_var == 2:  # Depth
59        outname = name + '_depth'
60        quantityname = 'stage-elevation' 
61
62    if which_var == 3:  # Speed
63        outname = name + '_speed'
64        quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
65
66    if which_var == 4:  # Elevation
67        outname = name + '_elevation'
68        quantityname = 'elevation'  #Elevation
69
70    if is_parallel == True:
71    #    print 'is_parallel',is_parallel
72        for i in range(0,nodes):
73            namei = name + '_P%d_%d' %(i,nodes)
74            outnamei = outname + '_P%d_%d' %(i,nodes)
75            print 'start sww2dem for sww file %d' %(i)
76            sww2dem(namei, basename_out = outnamei,
77                        quantity = quantityname,
78                        timestep = timestep,
79                        cellsize = cellsize,     
80                        easting_min = project_grad.e_min_area,
81                        easting_max = project_grad.e_max_area,
82                        northing_min = project_grad.n_min_area,
83                        northing_max = project_grad.n_max_area,       
84                        reduction = max, 
85                        verbose = True,
86                        format = 'asc')
87    else:
88        print 'start sww2dem'
89        sww2dem(name, basename_out = outname,
90                    quantity = quantityname,
91                    timestep = timestep,
92                    cellsize = cellsize,     
93                    easting_min = project_grad.e_min_area,
94                    easting_max = project_grad.e_max_area,
95                    northing_min = project_grad.n_min_area,
96                    northing_max = project_grad.n_max_area,       
97                    reduction = max, 
98                    verbose = True,
99                    format = 'asc')
100
Note: See TracBrowser for help on using the repository browser.