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

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

small update to dampier

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