1 | import project, os |
---|
2 | import sys |
---|
3 | |
---|
4 | from anuga.shallow_water.data_manager import sww2dem |
---|
5 | from os import sep |
---|
6 | |
---|
7 | #time_dir = '20070426_045818_run' # HAT 1 in Dampier 10000 yr - CIPMA scenario |
---|
8 | #time_dir = '20070419_065050_run_final_2.4_dampier_nbartzis' # HAT 1 in Dampier 10000 yr |
---|
9 | #time_dir = '20070419_065018_run_final_0.0_dampier_nbartzis' # MSL 1 in Dampier 10000 yr |
---|
10 | #time_dir = '20070618_063824_run_final_2.4_onslow_nbartzis' # HAT 1 in Onslow 10000 yr |
---|
11 | #time_dir = '20070618_050232_run_final_0.0_onslow_nbartzis' # MSL 1 in Onslow 10000 yr |
---|
12 | #time_dir = '20070620_044413_run_final_2.4_exmouth_nbartzis' # HAT 1 in Exmouth 10000 yr |
---|
13 | time_dir = '20070620_044352_run_final_0.0_exmouth_nbartzis' # MSL 1 in Exmouth 10000 yr |
---|
14 | #time_dir = '20070618_063824_run_final_2.4_onslow_nbartzis' # HAT onslow |
---|
15 | #time_dir = '20070618_050232_run_final_0.0_onslow_nbartzis' # MSL onslow |
---|
16 | cellsize = 25 |
---|
17 | timestep = None |
---|
18 | directory = project.output_dir |
---|
19 | #name = directory + time_dir + sep + project.scenario_name |
---|
20 | name = directory+time_dir+sep+project.scenario_name |
---|
21 | |
---|
22 | is_parallel = False |
---|
23 | if is_parallel == True: nodes = 4 |
---|
24 | print 'output dir:', name |
---|
25 | |
---|
26 | #var = [2,3] # depth and speed |
---|
27 | var = [0,2,3] |
---|
28 | |
---|
29 | for which_var in var: |
---|
30 | if which_var == 0: # Stage |
---|
31 | outname = name + '_stage_dampier' |
---|
32 | quantityname = 'stage' |
---|
33 | |
---|
34 | if which_var == 1: # Absolute Momentum |
---|
35 | outname = name + '_momentum_i1' |
---|
36 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5' |
---|
37 | |
---|
38 | if which_var == 2: # Depth |
---|
39 | outname = name + '_depth_dampier' |
---|
40 | quantityname = 'stage-elevation' |
---|
41 | |
---|
42 | if which_var == 3: # Speed |
---|
43 | outname = name + '_speed_dampier' |
---|
44 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed |
---|
45 | |
---|
46 | if which_var == 4: # Elevation |
---|
47 | outname = name + '_elevation_dampier' |
---|
48 | quantityname = 'elevation' #Elevation |
---|
49 | |
---|
50 | if is_parallel == True: |
---|
51 | # print 'is_parallel',is_parallel |
---|
52 | for i in range(0,nodes): |
---|
53 | # this naming structure is defined in |
---|
54 | # parallel_shallow_water |
---|
55 | namei = name + '_P%d_%d' %(i,nodes) |
---|
56 | outnamei = outname + '_P%d_%d' %(i,nodes) |
---|
57 | print 'start sww2dem for sww file %d' %(i) |
---|
58 | sww2dem(namei, basename_out = outnamei, |
---|
59 | quantity = quantityname, |
---|
60 | timestep = timestep, |
---|
61 | cellsize = cellsize, |
---|
62 | #easting_min = project.e_min_area, |
---|
63 | #easting_max = project.e_max_area, |
---|
64 | #northing_min = project.n_min_area, |
---|
65 | #northing_max = project.n_max_area, |
---|
66 | reduction = max, |
---|
67 | verbose = True, |
---|
68 | format = 'asc') |
---|
69 | else: |
---|
70 | print 'start sww2dem' |
---|
71 | sww2dem(name, basename_out = outname, |
---|
72 | quantity = quantityname, |
---|
73 | timestep = timestep, |
---|
74 | cellsize = cellsize, |
---|
75 | easting_min = project.e_min_area_d, |
---|
76 | easting_max = project.e_max_area_d, |
---|
77 | northing_min = project.n_min_area_d, |
---|
78 | northing_max = project.n_max_area_d, |
---|
79 | reduction = max, |
---|
80 | verbose = True, |
---|
81 | format = 'asc') |
---|