source: anuga_work/development/convergence_okushiri_2008/project_truescale.py @ 5604

Last change on this file since 5604 was 5604, checked in by Leharne, 14 years ago

Update project_truescale.py to include x&y extents for export_results.py

File size: 5.8 KB
Line 
1"""Common filenames for truescale Okushiri Island convergence study
2Formats are given as ANUGA native netCDF where applicable.
3
4"""
5from os import sep, environ, getenv, getcwd, umask
6from os.path import expanduser, basename, join
7from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon, number_mesh_triangles
8import sys
9from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
10from time import localtime, strftime, gmtime
11from anuga.utilities.system_tools import get_user_name, get_host_name
12
13home = join(getenv('INUNDATIONHOME'),'data', 'anuga_validation',
14            'convergence_okushiri_2008') # Location of Data
15user = get_user_name()
16host = get_host_name()
17#needed when running using mpirun, mpirun doesn't inherit umask from .bashrc
18umask(002)
19
20#-------------------
21# Input file names
22#-------------------
23
24# Given boundary wave
25boundary_filename = 'okushiri_truescale_input.tms'
26
27# Observed timeseries
28validation_filename = 'okushiri_output_truescale_ch5-7-9.txt'
29
30# Digital Elevation Model
31bathymetry_filename = 'okushiri_truescale_bathymetry.pts'
32
33
34#------------------------------------
35# Output file names and directories
36#------------------------------------
37
38# Model output
39output_filename = 'okushiri_truescale.sww'
40
41# Time stuff
42time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
43run_time = time+'_run'
44
45# Set anuga input directory names
46
47anuga_dir = join(home,'anuga')+sep
48
49mesh_dir = join(anuga_dir, 'meshes')+sep
50mesh_name = join(mesh_dir, 'okushiri_truescale')
51
52polygons_dir = join(anuga_dir, 'polygons')+sep # Created with ArcGIS (csv files)
53
54#------------------------
55# Run parameters
56#------------------------
57
58finaltime=450
59setup='sixteen'
60polygons = 'contour_polygons'
61
62if setup =='no polygons':
63    print 'no interior polygons'
64    base_resolution=1
65    yieldstep=1
66if setup =='octuple':
67    print '8 times original resolution'
68    base_resolution=0.125
69    yieldstep=1
70if setup =='sixteen':
71    print '16 times original resolution'
72    base_resolution=0.0625
73    yieldstep=1
74if setup =='quadruple':
75    print '4 times original resolution'
76    base_resolution=0.25
77    yieldstep=1
78if setup =='double':
79    print 'double original resolution'
80    base_resolution=0.5
81    yieldstep=1
82if setup =='1.5':
83    print '1.5 times original resolution'
84    base_resolution=0.66
85    yieldstep=1
86if setup =='original':
87    print 'original resolution'
88    base_resolution=1
89    yieldstep=1
90if setup =='0.75':
91    print '0.75 times original resolution'
92    base_resolution=1.33
93    yieldstep=1
94if setup =='half':
95    print 'half original resolution'
96    base_resolution=2
97    yieldstep=1
98if setup =='quarter':
99    print '1/4 original resolution'
100    base_resolution=4
101    yieldstep=1
102if setup =='eighth':
103    print '1/8 original resolution'
104    base_resolution=8
105    yieldstep=1
106if setup =='sixteenth':
107    print '1/16 original resolution'
108    base_resolution=16
109    yieldstep = 1
110if setup =='1-32':
111    print '1/32 original resolution'
112    base_resolution=32
113    yieldstep=1
114if setup =='1-64':
115    print '1/64 original resolution'
116    base_resolution=64
117    yieldstep=1
118 
119 
120#------------------------------
121# Polygon definitions
122#------------------------------
123   
124poly_all = read_polygon(polygons_dir+'bounding_polygon.csv')
125res_poly_all = 16000*base_resolution
126
127# Original polygon definitions
128
129poly_gulleys = read_polygon(polygons_dir+'gulleys_polygon.csv')
130res_gulleys = 3.2*base_resolution
131
132poly_island = read_polygon(polygons_dir+'island_polygon.csv')
133res_island = 32*base_resolution
134
135poly_rhs = read_polygon(polygons_dir+'rhs_polygon.csv')
136res_rhs = 80*base_resolution
137
138                   
139# Contour-based polygon definitions
140
141poly_25 = read_polygon(polygons_dir+'polygon_25m.csv')
142res_poly_25 = 800*base_resolution
143
144poly_10 = read_polygon(polygons_dir+'polygon_10m.csv')
145res_poly_10 = 80*base_resolution
146
147poly_5 = read_polygon(polygons_dir+'polygon_5m.csv')
148res_poly_5 = 32*base_resolution
149
150poly_1 = read_polygon(polygons_dir+'polygon_1m.csv')
151res_poly_1 = 10*base_resolution
152
153                   
154if polygons =='original_polygons':
155    print 'original polygon definition'
156    interior_regions = [[poly_gulleys,res_gulleys],[poly_island,res_island],
157                    [poly_rhs,res_rhs]]
158
159if polygons =='contour_polygons':
160    print 'contour-based polygon definition'
161    interior_regions = [[poly_25,res_poly_25],[poly_10,res_poly_10],
162                    [poly_5,res_poly_5],[poly_1,res_poly_1] ]
163
164
165trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
166print 'min number triangles', trigs_min
167
168this_area = polygon_area(poly_all)
169print this_area
170
171
172# Polygon QC
173#polygon_plot='polygons.png'
174#plot_polygons([poly_all, poly_25, poly_10, poly_5, poly_1], style=None, figname=polygon_plot)
175
176
177#--------------------------------
178# Set anuga output locations
179#--------------------------------
180
181# Directory comment
182dir_comment='_'+setup+'_'+polygons+'_'+str(user)
183
184output_dir = join(anuga_dir, 'outputs')+sep
185output_run_time_dir = output_dir+run_time+dir_comment+sep
186output_run_time_dir_name = output_run_time_dir + output_filename #Used by post processing
187
188# Gauges
189gauges_dir = join(anuga_dir,'gauges')+sep
190gauge_name = 'gauge_location_okushiri.csv'
191gauges_dir_name = gauges_dir+gauge_name
192
193# Vertex coordinates
194vertex_filename = output_run_time_dir+'vertex_coordinates.txt'
195
196
197#--------------------------------
198# Area definitions for sww2dem
199#--------------------------------
200
201xminDeep = 0
202xmaxDeep = 1000
203yminDeep = 0
204ymaxDeep = 1360.8
205
206xminMid = 1000
207xmaxMid = 1700
208yminMid = 0
209ymaxMid = 1360.8
210
211xminShallow = 1700
212xmaxShallow = 2179.2
213yminShallow = 0
214ymaxShallow = 1360.8
215
216
217
218
219
Note: See TracBrowser for help on using the repository browser.