source: anuga_work/production/dampier_2006/project_new.py @ 3959

Last change on this file since 3959 was 3827, checked in by nick, 17 years ago

more dampier

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