source: anuga_work/production/Broome_2008/project.py @ 7159

Last change on this file since 7159 was 5810, checked in by rwilson, 15 years ago

Initial setup of the new Broome scenario.

File size: 9.4 KB
Line 
1"""Common filenames and locations for elevation, meshes and outputs.
2This script is the heart of all scripts in folder
3"""
4#------------------------------------------------------------------------------
5# Import necessary modules
6#------------------------------------------------------------------------------
7
8from os import sep, environ, getenv, getcwd
9from os.path import expanduser
10import sys
11from time import localtime, strftime, gmtime
12from anuga.utilities.polygon import read_polygon, plot_polygons, is_inside_polygon, number_mesh_triangles
13from anuga.utilities.system_tools import get_user_name, get_host_name
14from anuga.shallow_water.data_manager import urs2sts,create_sts_boundary
15from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
16
17#------------------------------------------------------------------------------
18# Directory setup
19#------------------------------------------------------------------------------
20##Note: INUNDATIONHOME is the inundation directory, not the data directory.
21
22home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent diruser = get_user_name()
23muxhome = getenv('MUXHOME')
24user = get_user_name()
25host = get_host_name()
26
27##time stuff
28time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
29gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
30build_time = time+'_build'
31run_time = time+'_run'
32print 'gtime: ', gtime
33
34#------------------------------------------------------------------------------
35# Initial Conditions
36#------------------------------------------------------------------------------
37
38##Changed to reflect the modeled community (also sets up the directory system)
39state = 'western_australia'
40scenario_name = 'broome'
41scenario = 'broome_tsunami_scenario_2008'
42##One or all can be changed each time the run_scenario script is excuted
43tide = 0.6
44event_number = 27255
45#event_number = 27283
46alpha = 0.1
47friction=0.01
48starttime=0
49finaltime=80000 
50
51setup='final'  ## Can replace with trial or basic, this action will thin the mesh
52               ## so that the run script will take less time (hence less acurate)
53
54if setup =='trial':
55    print'trial'
56    res_factor=10
57    time_thinning=48
58    yieldstep=240
59if setup =='basic': 
60    print'basic'
61    res_factor=4
62    time_thinning=12
63    yieldstep=120
64if setup =='final': 
65    print'final'
66    res_factor=1
67    time_thinning=4
68    yieldstep=60
69
70#------------------------------------------------------------------------------
71# Output Filename
72#------------------------------------------------------------------------------
73##Important to distiquish each run
74dir_comment='_'+setup+'_'+str(tide)+'_'+str(event_number)+'_'+ 'alpha' +str(alpha)+'_'+str(user)
75
76#------------------------------------------------------------------------------
77# INPUT DATA
78#------------------------------------------------------------------------------
79
80##ELEVATION DATA## - used in build_broome.py
81## onshore data: format ascii grid with accompaning projection file
82onshore_name = 'town_topo_10m' 
83## island: format ascii grid with accompaning projection file
84#island_name = 'rott_dli_ext'
85#island_name1 = 'gard_dli_ext'
86#island_name2 = 'carnac_island_dli_ext'
87#island_name3 = 'penguin_dli_ext'
88## coastline: format x,y,elevation (with title)
89coast_name = 'Broome_coastline.txt'
90## bathymetry: format x,y,elevation (with title)
91offshore_name = 'Broome_Bathymetry.txt'
92offshore_name1 = 'cable_250m'
93offshore_name2 = 'inferred_north'
94offshore_name3 = 'inferred_south'
95offshore_name4 = 'north_250m'
96offshore_name5 = 'other_topo_250m'
97offshore_name6 = 'south_250m'
98
99##GAUGES## - used in get_timeseries.py
100#gauge_name = 'Broome.csv'
101#gauge_name2 = 'thinned_MGA50.csv'
102
103##BOUNDING POLYGON## -used in build_boundary.py and run_broome.py respectively
104#NOTE: when files are put together must be in sequence - for ease go clockwise!
105#Check the run_broome.py for boundary_tags
106##thinned ordering file from Hazard Map: format index,latitude,longitude (with title)
107order_filename = 'thinned_boundary_ordering.csv'
108##landward bounding points
109landward = 'landward_bounding_polygon.csv'
110
111#------------------------------------------------------------------------------
112# OUTPUT ELEVATION DATA
113#------------------------------------------------------------------------------
114##Output filename for elevation
115## its a combination of all the data put together (utilisied in build_boundary)
116combined_name ='broome_combined_elevation'
117combined_smaller_name = 'broome_combined_elevation_smaller'
118
119#------------------------------------------------------------------------------
120# Directory Structure
121#------------------------------------------------------------------------------
122anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
123topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
124topographies_dir = anuga_dir+'topographies'+sep
125polygons_dir = anuga_dir+'polygons'+sep
126tide_dir = anuga_dir+'tide_data'+sep
127boundaries_dir = anuga_dir+'boundaries'+ sep
128output_dir = anuga_dir+'outputs'+sep
129gauges_dir = anuga_dir+'gauges'+sep
130meshes_dir = anuga_dir+'meshes'+sep
131
132#------------------------------------------------------------------------------
133# Location of input and output Data
134#------------------------------------------------------------------------------
135##where the input data sits
136onshore_in_dir_name = topographies_in_dir + onshore_name
137coast_in_dir_name = topographies_in_dir + coast_name
138offshore_in_dir_name = topographies_in_dir + offshore_name
139offshore_in_dir_name1 = topographies_in_dir + offshore_name1
140offshore_in_dir_name2 = topographies_in_dir + offshore_name2
141offshore_in_dir_name3 = topographies_in_dir + offshore_name3
142offshore_in_dir_name4 = topographies_in_dir + offshore_name4
143offshore_in_dir_name5 = topographies_in_dir + offshore_name5
144offshore_in_dir_name6 = topographies_in_dir + offshore_name6
145
146##where the output data sits
147onshore_dir_name = topographies_dir + onshore_name
148coast_dir_name = topographies_dir + coast_name
149offshore_dir_name = topographies_dir + offshore_name
150offshore_dir_name1 = topographies_dir + offshore_name1
151offshore_dir_name2 = topographies_dir + offshore_name2
152offshore_dir_name3 = topographies_dir + offshore_name3
153offshore_dir_name4 = topographies_dir + offshore_name4
154offshore_dir_name5 = topographies_dir + offshore_name5
155offshore_dir_name6 = topographies_dir + offshore_name6
156
157##where the combined file sits
158combined_dir_name = topographies_dir + combined_name
159combined_smaller_name_dir = topographies_dir + combined_smaller_name
160
161##where the mesh sits (this is created during the run_broome.py)
162meshes_dir_name = meshes_dir + scenario_name+'.msh'
163
164#where the boundary order files sit (this is used within build_boundary.py)
165order_filename_dir = boundaries_dir + order_filename
166
167#where the landward points of boundary extent sit (this is used within run_broome.py)
168landward_dir = boundaries_dir + landward
169
170#where the event sts files sits (this is created during the build_boundary.py)
171boundaries_dir_event = boundaries_dir + str(event_number) + sep
172boundaries_dir_mux = muxhome
173
174#where the directory of the output filename sits
175output_build_time_dir = output_dir+build_time+dir_comment+sep #used for build_broome.py
176output_run_time_dir = output_dir+run_time+dir_comment+sep #used for run_broome.py
177output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
178
179#where the directory of the gauges sit
180#gauges_dir_name = gauges_dir + gauge_name #used for get_timeseries.py
181#gauges_dir_name2 = gauges_dir + gauge_name2 #used for get_timeseries.py
182
183#------------------------------------------------------------------------------
184# Interior region definitions
185#------------------------------------------------------------------------------
186
187#Land, to set the stage/water to be offcoast only
188poly_mainland = read_polygon(polygons_dir+'initial_conditions_mainland.csv')
189
190#Initial bounding polygon for data clipping
191poly_all = read_polygon(polygons_dir+'poly_all.csv')
192res_poly_all = 100000*res_factor
193
194#Area of Interest 1 (Broome)
195poly_aoi1 = read_polygon(polygons_dir+'Area_Of_Interest.csv')
196res_aoi1 = 500*res_factor
197
198#Area of Significance 1 (Broome)
199poly_aos1 = read_polygon(polygons_dir+'Area_Of_Significance.csv')
200res_aos1 = 1000*res_factor
201
202#Shallow water 1
203poly_sw1 = read_polygon(polygons_dir+'Shallow_Water.csv')
204res_sw1 = 25000*res_factor
205
206##Deep water (land of Rottnest, ANUGA does not do donuts!)
207#poly_dw1 = read_polygon(polygons_dir+'rottnest_internal.csv')
208#res_dw1 = 100000*res_factor
209
210# Combined all regions, must check that all are included!
211interior_regions = [[poly_aoi1,res_aoi1],
212                    [poly_aos1,res_aos1],
213                    [poly_sw1,res_sw1]]
214
215   
216trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
217print 'min estimated number of triangles', trigs_min
218   
219
220###------------------------------------------------------------------------------
221### Clipping regions for export to asc and regions for clipping data
222###------------------------------------------------------------------------------
223##
224###Geordie Bay extract ascii grid
225##xminGeordie = 358000
226##xmaxGeordie = 362000
227##yminGeordie = 6458500
228##ymaxGeordie = 6461000
229##
230###Sorrento extract ascii grid
231##xminSorrento = 379000
232##xmaxSorrento = 382500
233##yminSorrento = 6477000
234##ymaxSorrento = 6480000
235##
236###Fremantle extract ascii grid
237##xminFremantle = 376000
238##xmaxFremantle = 388000
239##yminFremantle = 6449000
240##ymaxFremantle = 6461000
241##
242###Rockingham extract ascii grid
243##xminRockingham = 373500
244##xmaxRockingham = 385500
245##yminRockingham = 6424000
246##ymaxRockingham = 6433000
247##
248##
Note: See TracBrowser for help on using the repository browser.