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

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

Updated

File size: 7.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 ,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.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
94offshore_name4 = 'Bunbury_TIN' # for area within Bunbury 500 mesh less than zero generated from TIN
95offshore_name5 = 'Busselton_TIN' # for area within Busselton 500 mesh less than zero generated from TIN
96
97
98#final topo name
99combined_name ='busselton_combined_elevation'
100combined_name_small = 'busselton_combined_elevation_smaller'
101
102anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
103
104topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
105topographies_dir = anuga_dir+'topographies'+sep
106
107# input topo file location
108onshore_in_dir_name = topographies_in_dir + onshore_name #topo
109
110coast_in_dir_name = topographies_in_dir + coast_name #coastline
111coast_in_dir_name1 = topographies_in_dir + coast_name1 #beach survey
112
113offshore_in_dir_name = topographies_in_dir + offshore_name #bathymetry
114offshore_in_dir_name1 = topographies_in_dir + offshore_name1 #bathymetry Charts
115offshore_in_dir_name2 = topographies_in_dir + offshore_name2 #Digitised Fairsheet
116offshore_in_dir_name3 = topographies_in_dir + offshore_name3 #250m
117offshore_in_dir_name4 = topographies_in_dir + offshore_name4 #Bunbury TIN
118offshore_in_dir_name5 = topographies_in_dir + offshore_name5 #Busselton TIN
119
120#output to anuga from build file
121onshore_dir_name = topographies_dir + onshore_name
122
123coast_dir_name = topographies_dir + coast_name
124coast_dir_name1 = topographies_dir + coast_name1
125
126offshore_dir_name = topographies_dir + offshore_name
127offshore_dir_name1 = topographies_dir + offshore_name1
128offshore_dir_name2 = topographies_dir + offshore_name2
129offshore_dir_name3 = topographies_dir + offshore_name3
130offshore_dir_name4 = topographies_dir + offshore_name4
131offshore_dir_name5 = topographies_dir + offshore_name5
132
133#final topo files
134combined_dir_name = topographies_dir + combined_name
135combined_dir_name_small = topographies_dir + combined_name_small
136
137meshes_dir = anuga_dir+'meshes'+sep
138meshes_dir_name = meshes_dir + scenario_name
139
140polygons_dir = anuga_dir+'polygons'+sep+'New_Extents'+sep
141tide_dir = anuga_dir+'tide_data'+sep
142
143#boundaries_source = '1'
144
145##if source=='exmouth':
146##    boundaries_name = 'busselton_3103_30052008' # exmouth gun
147##    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
148##
149##if source=='test':
150##    boundaries_name = 'other' #exmouth gun
151##    boundaries_in_dir = anuga_dir+'boundaries'+sep
152##
153
154#boundaries locations
155#boundaries_in_dir_name = boundaries_in_dir + boundaries_name
156boundaries_dir = anuga_dir+'boundaries'+sep
157boundaries_dir_name = boundaries_dir + scenario_name
158boundaries_dir_mux = muxhome
159
160#output locations
161output_dir = anuga_dir+'outputs'+sep
162output_build_time_dir = output_dir +build_time + dir_comment + sep
163output_run_time_dir = output_dir + run_time + dir_comment +sep
164output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
165
166#gauges
167gauge_name = 'busselton.csv'
168gauge_name2 = 'thinned_MGA50+1-1.csv'
169
170gauges_dir = home+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
171gauges_dir_name = gauges_dir + gauge_name
172gauges_dir_name2 = gauges_dir + gauge_name2
173
174buildings_filename = gauges_dir + 'Busselton_res_Project.csv'
175buildings_filename_out = 'Busselton_res_Project_modified.csv'
176
177community_filename = gauges_dir +''
178community_broome = gauges_dir + ''
179
180
181###############################
182# Interior region definitions
183###############################
184
185# Initial bounding polygon for data clipping
186poly_all = read_polygon(polygons_dir+'poly_all_extend.csv')
187res_poly_all = 100000*res_factor
188
189#digitized polygons
190poly_large = read_polygon(polygons_dir+'coast_5km_d20m.csv')
191res_large = 40000*res_factor
192
193poly_busselton = read_polygon(polygons_dir+'busselton_1km.csv')
194res_busselton = 500*res_factor
195
196poly_bunbury = read_polygon(polygons_dir+'bunbury_1km.csv')
197res_bunbury = 500*res_factor
198
199poly_busselton2 = read_polygon(polygons_dir+'busselton_2km.csv')
200res_busselton2 = 10000*res_factor
201
202poly_bunbury2 = read_polygon(polygons_dir+'bunbury_2km.csv')
203res_bunbury2 = 10000*res_factor
204
205poly_island1 = read_polygon(polygons_dir+'island1.csv')
206res_island1 = 10000*res_factor
207
208poly_island2 = read_polygon(polygons_dir+'island2.csv')
209res_island2 = 10000*res_factor
210
211
212interior_regions = [[poly_large,res_large],[poly_busselton,res_busselton],[poly_bunbury,res_bunbury]
213                    ,[poly_busselton2,res_busselton2],[poly_bunbury2,res_bunbury2]
214                    ,[poly_island1, res_island1],[poly_island2, res_island2]]
215
216
217trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
218print 'min number triangles', trigs_min
219
220poly_mainland=read_polygon(polygons_dir+'initial_condition.csv')
221
222
223###################################################################
224# Clipping regions for export to asc and regions for clipping data
225###################################################################
226
227# exporting asc grid for Busselton
228xminBusselton = 340000
229xmaxBusselton = 352000
230yminBusselton = 6271500
231ymaxBusselton = 6280000
232
233# exporting asc grid for Bunbury
234xminBunbury = 369000
235xmaxBunbury = 381000
236yminBunbury = 6308000
237ymaxBunbury = 6316500
238
239# exporting asc grid for Dunsborough
240xminDunsborough = 321000
241xmaxDunsborough = 327500
242yminDunsborough = 6277000
243ymaxDunsborough = 6282000
244
Note: See TracBrowser for help on using the repository browser.