source: anuga_work/production/perth/project.py @ 5446

Last change on this file since 5446 was 5446, checked in by kristy, 16 years ago
File size: 7.6 KB
Line 
1# -*- coding: cp1252 -*-
2"""Common filenames and locations for topographic data, meshes and outputs.
3"""
4
5from os import sep, environ, getenv, getcwd
6from os.path import expanduser
7import sys
8from time import localtime, strftime, gmtime
9from anuga.utilities.polygon import read_polygon, plot_polygons, is_inside_polygon, number_mesh_triangles
10#from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_points_from_latlon_to_utm
11from anuga.utilities.system_tools import get_user_name, get_host_name
12
13# file and system info
14#---------------------------------
15#codename = 'project.py'
16
17home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent diruser = get_user_name()
18user = get_user_name()
19host = get_host_name()
20
21# INUNDATIONHOME is the inundation directory, not the data directory.
22
23#time stuff
24time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
25gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
26build_time = time+'_build'
27run_time = time+'_run'
28print 'gtime: ', gtime
29
30#Making assumptions about the location of scenario data
31state = 'western_australia'
32scenario_name = 'perth'
33scenario = 'perth_tsunami_scenario'
34
35tide = 0.6
36
37alpha = 0.1
38friction=0.01
39starttime=0
40finaltime=80000
41export_cellsize=25
42setup='final'
43source='exmouth'
44
45if setup =='trial':
46    print'trial'
47    res_factor=10
48    time_thinning=48
49    yieldstep=240
50if setup =='basic': 
51    print'basic'
52    res_factor=4
53    time_thinning=12
54    yieldstep=120
55if setup =='final': 
56    print'final'
57    res_factor=1
58    time_thinning=4
59    yieldstep=60
60
61dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(user)
62
63# onshore data provided by WA DLI
64onshore_name = 'perth_dli_ext' # original
65#island
66island_name = 'rott_dli_ext' # original
67island_name1 = 'gard_dli_ext'
68island_name2 = 'carnac_island_dted'
69island_name3 = 'penguin_dted'
70
71# AHO + DPI data + colin French coastline
72coast_name = 'coastline'
73offshore_name = 'perth_bathymetry'
74
75
76#final topo name
77combined_name ='perth_combined_elevation'
78combined_smaller_name = 'perth_combined_elevation_smaller'
79
80anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
81
82topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
83topographies_dir = anuga_dir+'topographies'+sep
84#topographies_time_dir = topographies_dir+build_time+sep
85
86# input topo file location
87onshore_in_dir_name = topographies_in_dir + onshore_name
88island_in_dir_name = topographies_in_dir + island_name
89island_in_dir_name1 = topographies_in_dir + island_name1
90island_in_dir_name2 = topographies_in_dir + island_name2
91island_in_dir_name3 = topographies_in_dir + island_name3
92
93coast_in_dir_name = topographies_in_dir + coast_name
94offshore_in_dir_name = topographies_in_dir + offshore_name
95
96
97onshore_dir_name = topographies_dir + onshore_name
98island_dir_name = topographies_dir + island_name
99island_dir_name1 = topographies_dir + island_name1
100island_dir_name2 = topographies_dir + island_name2
101island_dir_name3 = topographies_dir + island_name3
102
103coast_dir_name = topographies_dir + coast_name
104offshore_dir_name = topographies_dir + offshore_name
105
106#final topo files
107combined_dir_name = topographies_dir + combined_name
108#combined_time_dir_name = topographies_time_dir + combined_name
109combined_smaller_name_dir = topographies_dir + combined_smaller_name
110#combined_time_dir_final_name = topographies_time_dir + combined_final_name
111
112meshes_dir = anuga_dir+'meshes'+sep
113meshes_dir_name = meshes_dir + scenario_name
114
115polygons_dir = anuga_dir+'polygons'+sep
116tide_dir = anuga_dir+'tide_data'+sep
117
118
119#boundaries_source = '1'
120   
121if source=='exmouth':
122    boundaries_name = 'perth_3103_28052008' #exmouth gun
123    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
124
125if source=='test':
126    boundaries_name = 'other' #exmouth gun
127    boundaries_in_dir = anuga_dir+'boundaries'+sep
128
129
130#boundaries locations
131boundaries_in_dir_name = boundaries_in_dir + boundaries_name
132boundaries_dir = anuga_dir+'boundaries'+sep
133boundaries_dir_name = boundaries_dir + scenario_name
134#boundaries_time_dir = anuga_dir+'boundaries'+sep+build_time+sep
135#boundaries_time_dir_name = boundaries_time_dir + boundaries_name  #Used by post processing
136
137#output locations
138output_dir = anuga_dir+'outputs'+sep
139output_build_time_dir = anuga_dir+'outputs'+sep+build_time+dir_comment+sep
140output_run_time_dir = anuga_dir+'outputs'+sep+run_time+dir_comment+sep
141output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
142
143#gauges
144gauge_name = 'perth.csv'
145
146gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
147beach_gauges = gauges_dir + 'beach_gauges.csv'
148gauges_dir_name = gauges_dir + gauge_name
149
150buildings_filename = gauges_dir + 'Perth_resA.csv'
151buildings_filename_out = 'Perth_res_Project_modified.csv'
152
153###############################
154# Domain definitions
155###############################
156from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
157
158poly_all = read_polygon(polygons_dir+'bounding_area.csv')
159res_poly_all = 100000*res_factor
160
161#refzone = 50
162
163###############################
164# Interior region definitions
165###############################
166
167#Polygon designed by 20m contours, or 3km from the coastline
168poly_internal_20_3 = read_polygon(polygons_dir+'internal_h20mORd3km.csv')
169res_internal_20_3 = 25000*res_factor
170
171#Polygon designed to incorporate Garden Island and sand bank infront of Rockingham
172poly_garden_rockingham = read_polygon(polygons_dir+'garden_rockingham.csv')
173res_garden_rockingham = 1500*res_factor
174
175#Polygon designed to incorporate coastline of rottnest
176poly_rottnest_ex = read_polygon(polygons_dir+'rottnest_external.csv')
177res_rottnest_ex = 1000*res_factor
178
179#Polygon designed to cut out the rottnest island land.
180poly_rottnest_in = read_polygon(polygons_dir+'rottnest_internal.csv')
181res_rottnest_in = 25000*res_factor
182
183#Polygon designed to incorporate perth and Fremantle CBD
184poly_cbd = read_polygon(polygons_dir+'CBD_coastal.csv')
185res_cbd = 500*res_factor
186
187#Polygon designed to incorporate rockingham and penguin island
188poly_penguin = read_polygon(polygons_dir+'rockingham_penguin.csv')
189res_penguin = 500*res_factor
190
191poly_geordie_bay = read_polygon(polygons_dir+'Geordie_Bay.csv')
192res_geordie_bay = 500*res_factor
193
194poly_sorrento_gauge = read_polygon(polygons_dir+'Sorrento_gauge.csv')
195res_sorrento_gauge = 500*res_factor
196#assert zone == refzone
197
198interior_regions = [[poly_internal_20_3,res_internal_20_3],[poly_cbd,res_cbd]
199                     ,[poly_garden_rockingham,res_garden_rockingham]
200                     ,[poly_penguin,res_penguin],[poly_geordie_bay,res_geordie_bay]
201                     ,[poly_sorrento_gauge,res_sorrento_gauge],[poly_rottnest_in, res_rottnest_in]
202                     ,[poly_rottnest_ex, res_rottnest_ex]]
203
204boundary_tags={'back': [0,1,2], 'side': [3,7],'ocean': [4, 5, 6]}
205
206trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
207
208print 'min number triangles', trigs_min
209
210poly_mainland = read_polygon(polygons_dir+'Initial_Condition.csv')
211
212###################################################################
213# Clipping regions for export to asc and regions for clipping data
214###################################################################
215
216
217#Geordie Bay extract ascii grid
218xminGeordie = 358000
219xmaxGeordie = 362000
220yminGeordie = 6458500
221ymaxGeordie = 6461000
222
223#Sorrento extract ascii grid
224xminSorrento = 379000
225xmaxSorrento = 382500
226yminSorrento = 6477000
227ymaxSorrento = 6480000
228
229#Fremantle extract ascii grid
230xminFremantle = 376000
231xmaxFremantle = 388000
232yminFremantle = 6449000
233ymaxFremantle = 6461000
234
235#Rockingham extract ascii grid
236xminRockingham = 373500
237xmaxRockingham = 385500
238yminRockingham = 6424000
239ymaxRockingham = 6433000
240
Note: See TracBrowser for help on using the repository browser.