source: anuga_work/production/dampier_2006/project.py @ 3877

Last change on this file since 3877 was 3877, checked in by nick, 18 years ago

build_dampier works... run might needs some changes

File size: 10.5 KB
Line 
1"""Common filenames and locations for topographic data, meshes and outputs.
2"""
3
4import sys
5from os import sep, environ, getenv, getcwd
6from os.path import expanduser, basename
7
8from anuga.coordinate_transforms.redfearn import\
9     degminsec2decimal_degrees,\
10     convert_from_latlon_to_utm
11
12from time import localtime, strftime
13from anuga.geospatial_data.geospatial_data import *
14
15# file and system info
16#---------------------------------
17codename = 'project.py'
18
19home = getenv('INUNDATIONHOME') #Sandpit's parent dir   
20
21if sys.platform == 'win32':
22    user = getenv('USERPROFILE')
23else:
24    user = getenv('LOGNAME')
25
26# INUNDATIONHOME is the inundation directory, not the data directory.
27home += sep +'data'
28#----------------------------------
29# Location and naming of scenario data
30#----------------------------------
31state = 'western_australia'
32scenario_name = 'dampier_tsunami'
33scenario_datas_name = 'dampier_tsunami_scenario_2006'  #name of the directory where the data is stored
34#scenario_datas_name = 'karratha_tsunami_scenario_2005' # Tmp location
35
36#mesh_name = 'elevation50m'
37boundaries_name = 'dampier'
38boundaries_source = 'mag_9_corrected'
39
40tide = 2.4
41
42# topography file names
43onshore_name = 'dli_no_islands'
44coast_name = 'DTED_05_Contour'
45islands_name = 'dted_islands'
46offshore_name = 'XY100003902'
47offshore_name1 = 'XY100003903'
48offshore_name2 = 'XY100003951'
49offshore_name3 = 'XY100006321'
50offshore_name4 = 'XY100011756'
51offshore_name5 = 'XY100014243'
52offshore_name6 = 'XY100014244'
53offshore_name7 = 'XY100021081'
54offshore_name8 = 'XY100021082'
55offshore_name9 = 'XY100021083'
56offshore_name10 = 'XY100021085'
57offshore_name11 = 'XY100021086'
58offshore_name12 = 'XY100026309'
59offshore_name13 = 'XY100026338'
60offshore_name14 = 'XYDM83'
61
62combined_name ='dampier_combined_elevation'
63
64
65
66#Derive subdirectories and filenames
67
68meshes_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'meshes'+sep
69topographies_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'topographies'+sep
70gauges_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'gauges'+sep
71polygons_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'polygons'+sep
72boundaries_in_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+boundaries_source+sep
73#outputdir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'output'+sep
74tide_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'tide_data'+sep
75
76time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
77build_time = time+'_build'
78run_time = time+'_run'
79
80output_build_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep+build_time+sep
81output_run_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep+run_time+sep
82topographies_time_dir = topographies_dir+build_time+sep
83boundaries_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'boundaries'+sep
84boundaries_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'boundaries'+sep+build_time+sep
85
86#ideas
87#boundaries_time_dir = boundaries_in_dir+'urs'+sep+boundaries_source+sep
88
89
90#gauge_filename = gaugedir + 'gauge_location_broome.csv'
91
92onshore_dir_name = topographies_dir + onshore_name
93coast_dir_name = topographies_dir + coast_name
94islands_dir_name = topographies_dir + islands_name
95offshore_dir_name = topographies_dir + offshore_name
96offshore_dir_name1 = topographies_dir + offshore_name1
97offshore_dir_name2 = topographies_dir + offshore_name2
98offshore_dir_name3 = topographies_dir + offshore_name3
99offshore_dir_name4 = topographies_dir + offshore_name4
100offshore_dir_name5 = topographies_dir + offshore_name5
101offshore_dir_name6 = topographies_dir + offshore_name6
102offshore_dir_name7 = topographies_dir + offshore_name7
103offshore_dir_name8 = topographies_dir + offshore_name8
104offshore_dir_name9 = topographies_dir + offshore_name9
105offshore_dir_name10 = topographies_dir + offshore_name10
106offshore_dir_name11 = topographies_dir + offshore_name11
107offshore_dir_name12 = topographies_dir + offshore_name12
108offshore_dir_name13 = topographies_dir + offshore_name13
109offshore_dir_name14 = topographies_dir + offshore_name14
110
111#output dir
112combined_dir_name = topographies_dir + combined_name
113combined_time_dir_name = topographies_time_dir + combined_name
114
115meshes_dir_name = meshes_dir + scenario_name
116
117#output_build_time_dir_name = output_build_time_dir + scenario_name  #Used by post processing
118output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
119boundaries_in_dir_name = boundaries_in_dir + boundaries_name
120boundaries_time_dir_name = boundaries_time_dir + boundaries_name  #Used by post processing
121
122
123
124
125# Regions
126
127refzone = 50 
128south = degminsec2decimal_degrees(-20,55,0)
129north = degminsec2decimal_degrees(-20,15,0)
130#north = degminsec2decimal_degrees(-19,15,0)
131west = degminsec2decimal_degrees(116,17,0)
132east = degminsec2decimal_degrees(117,10,0)
133
134#only used to clip boundary condition
135north_boundary = north + 0.02
136south_boundary = south - 0.02
137west_boundary = west - 0.02
138east_boundary = east + 0.02
139
140
141p0 = [south, degminsec2decimal_degrees(116,32,0)]
142p1 = [south, west]
143p2 = [degminsec2decimal_degrees(-20,23,0), west]
144p3 = [north, degminsec2decimal_degrees(116,45,0)]
145p4 = [north, degminsec2decimal_degrees(117,0,0)]
146p5 = [p2[0], degminsec2decimal_degrees(117,8,0)]
147p6 = [degminsec2decimal_degrees(-20,30,0), east]
148p7 = [degminsec2decimal_degrees(-20,38,0), east]
149p8 = [south, east]
150
151bounding_polygon, zone =\
152                  convert_from_latlon_to_utm([p0, p1, p2, p3, p4,
153                                              p5, p6, p7, p8])
154refzone = zone
155
156
157#Interior regions
158
159# CIPMA point of interest
160cipma_latitude = -20.588456
161cipma_longitude = 116.771527
162
163
164k0 = [cipma_latitude-0.02, cipma_longitude-0.02]
165k1 = [cipma_latitude-0.02, cipma_longitude+0.02]
166k2 = [cipma_latitude+0.02, cipma_longitude+0.02]
167k3 = [cipma_latitude+0.02, cipma_longitude-0.02]
168
169cipma_polygon, zone = convert_from_latlon_to_utm([k0, k1, k2, k3])
170assert zone == refzone
171
172e_min_area = 474000
173e_max_area = 480000
174n_min_area = 7719000
175n_max_area = 7725000
176
177#Interior regions
178karratha_south = degminsec2decimal_degrees(-20,44,0)
179karratha_north = degminsec2decimal_degrees(-20,42,0)
180karratha_west = degminsec2decimal_degrees(116,48,0)
181karratha_east = degminsec2decimal_degrees(116,53,30)
182
183k0 = [karratha_south, karratha_west]
184k1 = [karratha_south, karratha_east]
185k2 = [karratha_north, karratha_east]
186k3 = [karratha_north, karratha_west]   
187
188karratha_polygon, zone = convert_from_latlon_to_utm([k0, k1, k2, k3])
189assert zone == refzone
190
191
192#Interior regions
193dampier_south = degminsec2decimal_degrees(-20,40,0)
194dampier_north = degminsec2decimal_degrees(-20,38,10)
195dampier_west = degminsec2decimal_degrees(116,43,0)
196dampier_east = degminsec2decimal_degrees(116,45,0)
197
198d0 = [dampier_south, dampier_west]
199d1 = [dampier_south, dampier_east]
200d2 = [dampier_north, dampier_east]
201d3 = [dampier_north, dampier_west]   
202
203dampier_polygon, zone = convert_from_latlon_to_utm([d0, d1, d2, d3])
204assert zone == refzone
205
206
207#Interior regions
208refinery_south = degminsec2decimal_degrees(-20,37,50)
209refinery_north = degminsec2decimal_degrees(-20,36,0)
210refinery_west = degminsec2decimal_degrees(116,44,0)
211refinery_east = degminsec2decimal_degrees(116,46,10)
212
213d0 = [refinery_south, refinery_west]
214d1 = [refinery_south, refinery_east]
215d2 = [refinery_north, refinery_east]
216d3 = [refinery_north, refinery_west]   
217
218refinery_polygon, zone = convert_from_latlon_to_utm([d0, d1, d2, d3])
219assert zone == refzone
220
221
222#Interior region around 468899, 7715177:
223#lat (-20, 39, 44.93753), lon (116, 42, 5.09106)
224
225point_south = degminsec2decimal_degrees(-20,39,46)
226point_north = degminsec2decimal_degrees(-20,39,42)
227point_west = degminsec2decimal_degrees(116,42,0)
228point_east = degminsec2decimal_degrees(116,42,10)
229
230d0 = [point_south, point_west]
231d1 = [point_south, point_east]
232d2 = [point_north, point_east]
233d3 = [point_north, point_west]   
234
235point_polygon, zone = convert_from_latlon_to_utm([d0, d1, d2, d3])
236assert zone == refzone
237
238
239#Neils areas around interesting points
240neil1_point1 = [degminsec2decimal_degrees(-20,35,34),
241                degminsec2decimal_degrees(116,45,18)]
242neil1_point2 = [degminsec2decimal_degrees(-20,36,15),
243                degminsec2decimal_degrees(116,46,18)]
244neil1_point3 = [degminsec2decimal_degrees(-20,35,9),
245                degminsec2decimal_degrees(116,47,17)]
246neil1_point4 = [degminsec2decimal_degrees(-20,34,26),
247                degminsec2decimal_degrees(116,46,17)]
248
249neil1_polygon, zone = convert_from_latlon_to_utm([neil1_point1,
250                                                  neil1_point2,
251                                                  neil1_point3,
252                                                  neil1_point4])
253assert zone == refzone
254
255
256
257
258neil2_point1 = [degminsec2decimal_degrees(-20,39,36),
259                degminsec2decimal_degrees(116,41,33)]
260neil2_point2 = [degminsec2decimal_degrees(-20,40,10),
261                degminsec2decimal_degrees(116,42,13)]
262neil2_point3 = [degminsec2decimal_degrees(-20,38,39),
263                degminsec2decimal_degrees(116,43,49)]
264neil2_point4 = [degminsec2decimal_degrees(-20,38,5),
265                degminsec2decimal_degrees(116,43,9)]
266
267neil2_polygon, zone = convert_from_latlon_to_utm([neil2_point1,
268                                                  neil2_point2,
269                                                  neil2_point3,
270                                                  neil2_point4])
271assert zone == refzone
272
273
274
275
276
277#Withnell bay
278wb_point1 = [degminsec2decimal_degrees(-20,35,34),
279                degminsec2decimal_degrees(116,45,18)]
280wb_point2 = [degminsec2decimal_degrees(-20,36,15),
281                degminsec2decimal_degrees(116,46,18)]
282wb_point3 = [degminsec2decimal_degrees(-20,35,9),
283                degminsec2decimal_degrees(116,47,17)]
284wb_point4 = [degminsec2decimal_degrees(-20,34,26),
285                degminsec2decimal_degrees(116,46,17)]
286
287wb_polygon, zone = convert_from_latlon_to_utm([wb_point1, wb_point2,
288                                               wb_point3, wb_point4])
289assert zone == refzone
290
291
292
293
294
295#Larger Withnell bay
296lwb_point1 = [degminsec2decimal_degrees(-20,35,59),
297                degminsec2decimal_degrees(116,42,00)]
298lwb_point2 = [degminsec2decimal_degrees(-20,36,50),
299                degminsec2decimal_degrees(116,46,50)]
300lwb_point3 = [degminsec2decimal_degrees(-20,34,00),
301                degminsec2decimal_degrees(116,47,39)]
302lwb_point4 = [degminsec2decimal_degrees(-20,33,00),
303                degminsec2decimal_degrees(116,42,50)]
304
305lwb_polygon, zone = convert_from_latlon_to_utm([lwb_point1, lwb_point2,
306                                                lwb_point3, lwb_point4])
307                                                     
308assert zone == refzone
309
310
311
312
Note: See TracBrowser for help on using the repository browser.