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

Last change on this file since 5714 was 5669, checked in by kristy, 17 years ago

Updated

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