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

Last change on this file since 5388 was 5388, checked in by kristy, 16 years ago

update for current run

File size: 4.3 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
21#time_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
23#time_dir = '20080526_043334_run_final_1.5_kvanputt_exmouth_revised' # New
24time_dir = '20080529_053834_run_final_1.5_kvanputt_exmouth_revised' # New
25
26
27cellsize = 25
28#cellsize = 150
29timestep = None
30directory = project_grad.output_dir
31#name = directory + time_dir + sep + project_grad.scenario_name
32name = directory+time_dir+sep+project_grad.scenario_name
33#name = directory+time_dir+sep+'onslow_time_35760_0'
34#name = directory+time_dir+sep+'source'
35
36from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
37
38#elevgrid = directory+time_dir+sep+'onslow_elevation_town'
39
40#convert_dem_from_ascii2netcdf(elevgrid, use_cache=True, verbose=True)
41
42#dem2pts(elevgrid,run_up_elev=True,run_up_loc=True)
43
44is_parallel = False
45#is_parallel = True
46if is_parallel == True: nodes = 4
47print 'output dir:', name
48
49var = [2,3,4] # depth and speed
50#var = [2] # depth
51#var = [4]
52#var = [0]
53
54for which_var in var:
55    if which_var == 0:  # Stage
56        outname = name + '_stage'
57        quantityname = 'stage'
58
59    if which_var == 1:  # Absolute Momentum
60        outname = name + '_momentum'
61        quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
62
63    if which_var == 2:  # Depth
64        outname = name + '_depth'
65        quantityname = 'stage-elevation' 
66
67    if which_var == 3:  # Speed
68        outname = name + '_speed'
69        quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
70
71    if which_var == 4:  # Elevation
72        outname = name + '_elevation'
73        quantityname = 'elevation'  #Elevation
74
75    if is_parallel == True:
76    #    print 'is_parallel',is_parallel
77        for i in range(0,nodes):
78            namei = name + '_P%d_%d' %(i,nodes)
79            outnamei = outname + '_P%d_%d' %(i,nodes)
80            print 'start sww2dem for sww file %d' %(i)
81            sww2dem(namei, basename_out = outnamei,
82                        quantity = quantityname,
83                        timestep = timestep,
84                        cellsize = cellsize,     
85                        easting_min = project_grad.e_min_area,
86                        easting_max = project_grad.e_max_area,
87                        northing_min = project_grad.n_min_area,
88                        northing_max = project_grad.n_max_area,       
89                        reduction = max, 
90                        verbose = True,
91                        format = 'asc')
92    else:
93        print 'start sww2dem'
94        sww2dem(name, basename_out = outname,
95                    quantity = quantityname,
96                    timestep = timestep,
97                    cellsize = cellsize,     
98                    #easting_min = project_grad.e_min_area,
99                    #easting_max = project_grad.e_max_area,
100                    #northing_min = project_grad.n_min_area,
101                    #northing_max = project_grad.n_max_area,       
102                    reduction = max, 
103                    verbose = True,
104                    format = 'asc')
105
Note: See TracBrowser for help on using the repository browser.