source: anuga_work/production/busselton/project.py @ 5607

Last change on this file since 5607 was 5607, checked in by kristy, 16 years ago
File size: 7.2 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 ,umask
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.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
13
14# file and system info
15#---------------------------------
16#codename = 'project.py'
17
18home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir   
19muxhome = getenv('MUXHOME')
20user = get_user_name()
21host = get_host_name()
22
23# INUNDATIONHOME is the inundation directory, not the data directory.
24
25#time stuff
26time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
27gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
28build_time = time+'_build'
29run_time = time+'_run'
30print 'gtime: ', gtime
31
32#Making assumptions about the location of scenario data
33state = 'western_australia'
34scenario_name = 'busselton'
35scenario = 'busselton_tsunami_scenario'
36
37tide = 0.0 #0.6
38
39alpha = 0.1 
40friction=0.01
41starttime=0
42finaltime=80000 
43export_cellsize=25
44setup='final'
45source='polyline'
46
47
48if setup =='trial':
49    print'trial'
50    res_factor=10
51    time_thinning=48
52    yieldstep=240
53if setup =='basic': 
54    print'basic'
55    res_factor=4
56    time_thinning=12
57    yieldstep=120
58if setup =='final': 
59    print'final'
60    res_factor=1
61    time_thinning=4
62    yieldstep=60
63
64rev_num = 'newExtent'
65#rev_num = '5449'
66#rev_num = '4695' # 2nd Sept 2007
67#rev_num = '4743' # 3nd Oct 2007
68#rev_num = '4777' # 1st Nov 2007
69#rev_num = '4874' # 3rd Dec 2007
70#rev_num = '4901' # 3rd Jan 2007
71#rev_num = '4990' # 5th Feb 2007
72#rev_num = '5103' # 3rd March 2007
73#rev_num = '5120' # 5th March 2007
74#rev_num = '5140' # 7th March 2007
75#rev_num = '5160' # 11th March 2007
76#rev_num = '5185' # 1st April 2007
77#rev_num = '5273' # 2nd May 2007
78
79
80dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(rev_num)+'_'+str(user)
81
82
83# onshore data provided by WA DLI - provided by Hamish on the 17th June 2008
84
85onshore_name = 'busselton_v2_gda94_mga50' # original
86
87# AHO + DPI data
88coast_name = 'Busselton_Contour0' # provided by hamish, represent better coastline than the 100km as compared to charts
89coast_name1 = 'Busselton_BeachSurvey'
90offshore_name = 'Busselton_NavyFinal'
91offshore_name1 = 'Busselton_Chart'
92offshore_name2 = 'Busselton_Digitised'
93offshore_name3 = 'Busselton_250m' # for areas that were heading to zero - 2005 Bathymetry grid
94
95
96#final topo name
97combined_name ='busselton_combined_elevation'
98combined_name_small = 'busselton_combined_elevation_smaller'
99
100anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
101
102topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
103topographies_dir = anuga_dir+'topographies'+sep
104
105# input topo file location
106onshore_in_dir_name = topographies_in_dir + onshore_name #topo
107
108coast_in_dir_name = topographies_in_dir + coast_name #coastline
109coast_in_dir_name1 = topographies_in_dir + coast_name1 #beach survey
110
111offshore_in_dir_name = topographies_in_dir + offshore_name #bathymetry
112offshore_in_dir_name1 = topographies_in_dir + offshore_name1 #bathymetry Charts
113offshore_in_dir_name2 = topographies_in_dir + offshore_name2 #Digitised Fairsheet
114offshore_in_dir_name3 = topographies_in_dir + offshore_name3 #250m
115
116#output to anuga from build file
117onshore_dir_name = topographies_dir + onshore_name
118
119coast_dir_name = topographies_dir + coast_name
120coast_dir_name1 = topographies_dir + coast_name1
121
122offshore_dir_name = topographies_dir + offshore_name
123offshore_dir_name1 = topographies_dir + offshore_name1
124offshore_dir_name2 = topographies_dir + offshore_name2
125offshore_dir_name3 = topographies_dir + offshore_name3
126
127#final topo files
128combined_dir_name = topographies_dir + combined_name
129combined_dir_name_small = topographies_dir + combined_name_small
130
131meshes_dir = anuga_dir+'meshes'+sep
132meshes_dir_name = meshes_dir + scenario_name
133
134polygons_dir = anuga_dir+'polygons'+sep+'New_Extents'+sep
135tide_dir = anuga_dir+'tide_data'+sep
136
137#boundaries_source = '1'
138
139##if source=='exmouth':
140##    boundaries_name = 'busselton_3103_30052008' # exmouth gun
141##    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
142##
143##if source=='test':
144##    boundaries_name = 'other' #exmouth gun
145##    boundaries_in_dir = anuga_dir+'boundaries'+sep
146##
147
148#boundaries locations
149#boundaries_in_dir_name = boundaries_in_dir + boundaries_name
150boundaries_dir = anuga_dir+'boundaries'+sep
151boundaries_dir_name = boundaries_dir + scenario_name
152boundaries_dir_mux = muxhome
153
154#output locations
155output_dir = anuga_dir+'outputs'+sep
156output_build_time_dir = output_dir +build_time + dir_comment + sep
157output_run_time_dir = output_dir + run_time + dir_comment +sep
158output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
159
160#gauges
161gauge_name = 'busselton.csv'
162gauges_dir = home+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
163gauges_dir_name = gauges_dir + gauge_name
164
165buildings_filename = gauges_dir + 'Busselton_res_Project.csv'
166buildings_filename_out = 'Busselton_res_Project_modified.csv'
167
168community_filename = gauges_dir +''
169community_broome = gauges_dir + ''
170
171
172###############################
173# Interior region definitions
174###############################
175
176# Initial bounding polygon for data clipping
177poly_all = read_polygon(polygons_dir+'poly_all_extend.csv')
178res_poly_all = 100000*res_factor
179
180#digitized polygons
181poly_large = read_polygon(polygons_dir+'coast_5km_d20m.csv')
182res_large = 40000*res_factor
183
184poly_busselton = read_polygon(polygons_dir+'busselton_1km.csv')
185res_busselton = 500*res_factor
186
187poly_bunbury = read_polygon(polygons_dir+'bunbury_1km.csv')
188res_bunbury = 500*res_factor
189
190poly_dunsborough = read_polygon(polygons_dir+'dunsborough_1km.csv')
191res_dunsborough = 500*res_factor
192
193poly_busselton2 = read_polygon(polygons_dir+'busselton_2km.csv')
194res_busselton2 = 10000*res_factor
195
196poly_bunbury2 = read_polygon(polygons_dir+'bunbury_2km.csv')
197res_bunbury2 = 10000*res_factor
198
199
200interior_regions = [[poly_large,res_large],[poly_busselton,res_busselton],[poly_bunbury,res_bunbury]
201                    ,[poly_dunsborough,res_dunsborough],[poly_busselton2,res_busselton2]
202                    ,[poly_bunbury2,res_bunbury2]]
203
204
205trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
206print 'min number triangles', trigs_min
207
208poly_mainland=read_polygon(polygons_dir+'initial_condition.csv')
209
210
211###################################################################
212# Clipping regions for export to asc and regions for clipping data
213###################################################################
214
215# exporting asc grid for Busselton
216xminBusselton = 340000
217xmaxBusselton = 352000
218yminBusselton = 6271500
219ymaxBusselton = 6280000
220
221# exporting asc grid for Bunbury
222xminBunbury = 369000
223xmaxBunbury = 381000
224yminBunbury = 6308000
225ymaxBunbury = 6316500
226
227# exporting asc grid for Dunsborough
228xminDunsborough = 321000
229xmaxDunsborough = 327500
230yminDunsborough = 6277000
231ymaxDunsborough = 6282000
232
Note: See TracBrowser for help on using the repository browser.