source: anuga_work/production/onslow_2008/project.py @ 5635

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

To re-run Onslow with new boundary input

File size: 7.2 KB
Line 
1""" Designed from run_perth 08/08/2008 """ 
2
3# -*- coding: cp1252 -*-
4"""Common filenames and locations for topographic data, meshes and outputs.
5"""
6
7from os import sep, environ, getenv, getcwd
8from os.path import expanduser
9import sys
10from time import localtime, strftime, gmtime
11from anuga.utilities.polygon import read_polygon, plot_polygons, is_inside_polygon, number_mesh_triangles
12#from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_points_from_latlon_to_utm
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# file and system info
18#---------------------------------
19#codename = 'project.py'
20
21home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent diruser = get_user_name()
22muxhome = getenv('MUXHOME')
23user = get_user_name()
24host = get_host_name()
25
26# INUNDATIONHOME is the inundation directory, not the data directory.
27
28#time stuff
29time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
30gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
31build_time = time+'_build'
32run_time = time+'_run'
33print 'gtime: ', gtime
34
35#Making assumptions about the location of scenario data
36state = 'western_australia'
37#scenario_name = 'perth_44unitsources'
38scenario_name = 'onslow_2008'
39scenario = 'onslow_tsunami_scenario_2008'
40
41
42tide = 0.0 #1.5
43
44alpha = 0.1
45friction=0.01
46starttime=0
47finaltime=80000 
48export_cellsize=25
49setup='final'
50source='polyline'
51
52if setup =='trial':
53    print'trial'
54    res_factor=10
55    time_thinning=48
56    yieldstep=240
57if setup =='basic': 
58    print'basic'
59    res_factor=4
60    time_thinning=12
61    yieldstep=120
62if setup =='final': 
63    print'final'
64    res_factor=1
65    time_thinning=4
66    yieldstep=60
67
68dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+ 'alpha' +str(alpha)+'_'+str(user)
69
70# onshore data provided by WA DLI
71onshore_name = 'revised_onshore_20m_dli' #revised
72
73#island
74island_name = 'onslow_islands_dted2' # revised
75
76# AHO + DPI data + colin French coastline
77coast_name = 'revised_coastline'
78offshore_name = 'onslow_offshore_points'
79offshore_name1 = 'beach_survey'
80offshore_name2 = 'ONS16FINAL'
81offshore_name3 = 'ONS17FINAL'
82offshore_name4 = 'ONS18FINAL'
83
84
85#final topo name
86combined_name ='onslow_combined_elevation'
87combined_smaller_name = 'onslow_combined_elevation_smaller'
88
89anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
90
91topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
92topographies_dir = anuga_dir+'topographies'+sep
93#topographies_time_dir = topographies_dir+build_time+sep
94
95# input topo file location
96onshore_in_dir_name = topographies_in_dir + onshore_name
97island_in_dir_name = topographies_in_dir + island_name
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
103offshore_in_dir_name3 = topographies_in_dir + offshore_name3
104offshore_in_dir_name4 = topographies_in_dir + offshore_name4
105
106onshore_dir_name = topographies_dir + onshore_name
107island_dir_name = topographies_dir + island_name
108
109coast_dir_name = topographies_dir + coast_name
110offshore_dir_name = topographies_dir + offshore_name
111offshore_dir_name1 = topographies_dir + offshore_name1
112offshore_dir_name2 = topographies_dir + offshore_name2
113offshore_dir_name3 = topographies_dir + offshore_name3
114offshore_dir_name4 = topographies_dir + offshore_name4
115
116#final topo files
117combined_dir_name = topographies_dir + combined_name
118#combined_time_dir_name = topographies_time_dir + combined_name
119combined_smaller_name_dir = topographies_dir + combined_smaller_name
120#combined_time_dir_final_name = topographies_time_dir + combined_final_name
121
122meshes_dir = anuga_dir+'meshes'+sep
123meshes_dir_name = meshes_dir + scenario_name
124
125polygons_dir = anuga_dir+'polygons'+sep
126tide_dir = anuga_dir+'tide_data'+sep
127
128
129#boundaries_source = '1'
130   
131if source=='polyline':
132    boundaries_name = 'perth_3103_28052008' #polyline gun
133    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'polyline'+sep+'1_10000'+sep
134
135if source=='test':
136    boundaries_name = 'other' #polyline
137    boundaries_in_dir = anuga_dir+'boundaries'+sep
138
139
140#boundaries locations
141boundaries_in_dir_name = boundaries_in_dir + boundaries_name
142boundaries_dir = anuga_dir+'boundaries'+sep
143boundaries_dir_name = boundaries_dir + scenario_name # what it creates???
144boundaries_dir_mux = muxhome
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
152vertex_filename = output_run_time_dir + 'mesh_vertex.csv'
153
154#gauges
155gauge_name = 'gauge_location_onslow.csv'
156gauge_name2 = 'thinned_MGA50+1.csv'
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
163
164#buildings_filename = gauges_dir + 'Onslow_res_Project.csv'
165#buildings_filename_out = 'Onslow_res_Project_modified.csv'
166
167
168###############################
169# Interior region definitions
170###############################
171
172#Initial bounding polygon for data clipping
173poly_all = read_polygon(polygons_dir+'domain.csv')
174res_poly_all = 100000*res_factor
175
176#Polygon designed by 20m contours, or 3km from the coastline
177poly_inner_region = read_polygon(polygons_dir+'inner_region.csv')
178res_inner_region = 5000*res_factor
179
180#Polygon designed to cut out the rottnest island land.
181poly_region_50m = read_polygon(polygons_dir+'region_50m.csv')
182res_region_50m = 50000*res_factor
183
184#Polygon designed to incorporate Garden Island and sand bank infront of Rockingham
185poly_onslow_v2 = read_polygon(polygons_dir+'onslow_v2.csv')
186res_onslow_v2 = 500*res_factor
187
188#Polygon designed to incorporate coastline of rottnest
189poly_beach_left = read_polygon(polygons_dir+'beach_left.csv')
190res_beach_left = 200*res_factor
191
192#Polygon designed to incorporate perth and Fremantle CBD
193poly_beach_right = read_polygon(polygons_dir+'beach_right.csv')
194res_beach_right = 200*res_factor
195
196
197
198#assert zone == refzone
199
200interior_regions = [[poly_inner_region,res_inner_region],[poly_region_50m,res_region_50m]
201                     ,[poly_onslow_v2,res_onslow_v2],[poly_beach_left,res_beach_left]
202                     ,[poly_beach_right,res_beach_right]]
203
204   
205trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
206print 'min number triangles', trigs_min
207   
208
209poly_mainland = read_polygon(topographies_in_dir+'InitialCondition_points.csv')
210
211###################################################################
212# Clipping regions for export to asc and regions for clipping data
213###################################################################
214
215# region to export (used from export_results.py)
216e_min_area = 300000   # Eastings min
217e_max_area = 310000
218n_min_area = 7600000
219n_max_area = 7610000
220# for old onslow town
221##e_min_area = 300000   # Eastings min
222##e_max_area = 310000
223##n_min_area = 7600000
224##n_max_area = 7610000
Note: See TracBrowser for help on using the repository browser.