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

Last change on this file since 5122 was 5122, checked in by nick, 16 years ago

updates to perth

File size: 6.8 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=10000
40midtime=21600
41finaltime=10000
42export_cellsize=50
43setup='trial'
44source='test'
45
46if setup =='trial':
47    print'trial'
48    res_factor=10
49    time_thinning=48
50    yieldstep=240
51if setup =='basic': 
52    print'basic'
53    res_factor=4
54    time_thinning=12
55    yieldstep=120
56if setup =='final': 
57    print'final'
58    res_factor=1
59    time_thinning=4
60    yieldstep=60
61
62dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(user)
63
64# onshore data provided by WA DLI
65onshore_name = 'perth_dli_ext' # original
66#island
67island_name = 'rott_dli_ext' # original
68island_name1 = 'gard_dli_ext'
69island_name2 = 'carnac_island_dted'
70island_name3 = 'penguin_dted'
71
72# AHO + DPI data + colin French coastline
73coast_name = 'waterline'
74offshore_name = 'perth_bathymetry'
75offshore1_name = 'missing_fairsheets'
76
77#final topo name
78combined_name ='perth_combined_elevation'
79combined_smaller_name = 'perth_combined_elevation_smaller'
80
81anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
82
83topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
84topographies_dir = anuga_dir+'topographies'+sep
85#topographies_time_dir = topographies_dir+build_time+sep
86
87# input topo file location
88onshore_in_dir_name = topographies_in_dir + onshore_name
89island_in_dir_name = topographies_in_dir + island_name
90island_in_dir_name1 = topographies_in_dir + island_name1
91island_in_dir_name2 = topographies_in_dir + island_name2
92island_in_dir_name3 = topographies_in_dir + island_name3
93
94coast_in_dir_name = topographies_in_dir + coast_name
95offshore_in_dir_name = topographies_in_dir + offshore_name
96offshore1_in_dir_name = topographies_in_dir + offshore1_name
97
98onshore_dir_name = topographies_dir + onshore_name
99island_dir_name = topographies_dir + island_name
100island_dir_name1 = topographies_dir + island_name1
101island_dir_name2 = topographies_dir + island_name2
102island_dir_name3 = topographies_dir + island_name3
103
104coast_dir_name = topographies_dir + coast_name
105offshore_dir_name = topographies_dir + offshore_name
106
107#final topo files
108combined_dir_name = topographies_dir + combined_name
109#combined_time_dir_name = topographies_time_dir + combined_name
110combined_smaller_name_dir = topographies_dir + combined_smaller_name
111#combined_time_dir_final_name = topographies_time_dir + combined_final_name
112
113meshes_dir = anuga_dir+'meshes'+sep
114meshes_dir_name = meshes_dir + scenario_name
115
116polygons_dir = anuga_dir+'polygons'+sep
117tide_dir = anuga_dir+'tide_data'+sep
118
119
120#boundaries_source = '1'
121
122if source =='dampier':
123    boundaries_name = 'broome_3854_17042007' #Dampier gun
124    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep
125
126if source=='onslow':
127    boundaries_name = 'broome_3859_16052007' #onslow_hedland_broome gun
128    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
129   
130if source=='exmouth':
131    boundaries_name = 'broome_3103_18052007' #exmouth gun
132    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
133
134if source=='test':
135    boundaries_name = 'other' #exmouth gun
136    boundaries_in_dir = anuga_dir+'boundaries'+sep
137
138
139#boundaries locations
140boundaries_in_dir_name = boundaries_in_dir + scenario_name
141boundaries_dir = anuga_dir+'boundaries'+sep
142boundaries_dir_name = boundaries_dir + scenario_name
143#boundaries_time_dir = anuga_dir+'boundaries'+sep+build_time+sep
144#boundaries_time_dir_name = boundaries_time_dir + boundaries_name  #Used by post processing
145
146#output locations
147output_dir = anuga_dir+'outputs'+sep
148output_build_time_dir = anuga_dir+'outputs'+sep+build_time+dir_comment+sep
149output_run_time_dir = anuga_dir+'outputs'+sep+run_time+dir_comment+sep
150output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
151
152#gauges
153gauge_name = 'perth.csv'
154gauges_dir = anuga_dir+'gauges'+sep
155gauges_dir_name = gauges_dir + gauge_name
156
157buildings_filename = gauges_dir + 'Perth_res_Project.csv'
158buildings_filename_out = 'Perth_res_Project_modified.csv'
159
160###############################
161# Domain definitions
162###############################
163from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
164
165poly_all = read_polygon(polygons_dir+'bounding_poly.csv')
166res_poly_all = 100000*res_factor
167
168#refzone = 50
169
170###############################
171# Interior region definitions
172###############################
173
174#poly_pos20_neg20 = read_polygon(polygons_dir+'pos20_neg20pts.csv')
175poly_pos20_neg20 = read_polygon(polygons_dir+'pos20_neg20_new_pts.csv')
176res_pos20_neg20 = 20000*res_factor
177
178#poly_cbd = read_polygon(polygons_dir+'cbd_pts.csv')
179poly_cbd = read_polygon(polygons_dir+'cbd_smaller_pts.csv')
180res_cbd = 500*res_factor
181
182poly_penguin = read_polygon(polygons_dir+'penguin_pts.csv')
183res_penguin = 500*res_factor
184
185poly_geordie_bay = read_polygon(polygons_dir+'geordie_bay_pts.csv')
186res_geordie_bay = 500*res_factor
187
188poly_sorrento_gauge = read_polygon(polygons_dir+'sorrento_gauge_pts.csv')
189res_sorrento_gauge = 500*res_factor
190#assert zone == refzone
191
192interior_regions = [[poly_pos20_neg20,res_pos20_neg20],[poly_cbd,res_cbd]
193                     ,[poly_penguin,res_penguin],[poly_penguin,res_penguin]
194                     ,[poly_penguin,res_penguin]]
195
196boundary_tags={'back': [4], 'side': [0,3],'ocean': [1, 2]}
197
198trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
199
200print 'min number triangles', trigs_min
201
202###################################################################
203# Clipping regions for export to asc and regions for clipping data
204###################################################################
205
206# exporting asc grid
207eastingmin = 379000
208eastingmax = 385000
209northingmin = 6450700
210northingmax = 6459800
211
212
213
Note: See TracBrowser for help on using the repository browser.