source: anuga_work/production/wa/onslow_2006/aticket160_project.py @ 7855

Last change on this file since 7855 was 4506, checked in by duncan, 18 years ago

bug hunting

File size: 7.1 KB
Line 
1"""Common filenames and locations for topographic data, meshes and outputs.
2"""
3
4from os import sep, environ, getenv, getcwd,umask
5from os.path import expanduser
6import sys
7from time import localtime, strftime, gmtime
8from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon, number_mesh_triangles
9from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_from_latlon_to_utm
10from anuga.utilities.system_tools import get_user_name, get_host_name
11
12# file and system info
13#---------------------------------
14codename = 'project.py'
15
16home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir   
17user = get_user_name()
18host = get_host_name()
19#needed when running using mpirun, mpirun doesn't inherit umask from .bashrc
20umask(002)
21
22
23# INUNDATIONHOME is the inundation directory, not the data directory.
24#home += sep +'data'
25
26#time stuff
27time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
28build_time = time+'_build'
29run_time = time+'_run'
30
31#tide = -1.5
32#tide = 0.0
33tide = 1.5
34
35#Maybe will try to make project a class to allow these parameters to be passed in.
36res_factor= 1000000000000000
37alpha = 0.1
38friction=0.01
39time_thinning=4
40dir_comment='_DSG_'+str(tide)+'_'+str(user)
41starttime=3600
42yieldstep=60
43finaltime=25000
44 
45#Making assumptions about the location of scenario data
46state = 'western_australia'
47scenario_name = 'onslow'
48scenario = 'onslow_tsunami_scenario_2006'
49
50# onshore data provided by WA DLI
51onshore_name = 'onslow_onshore_30m_dted2' # original
52onshore_name1 = 'onslow_onshore_20m_dli' # original
53
54# AHO + DPI data + colin French coastline
55coast_name = 'onslow_coast'
56islands_name = 'onslow_islands_dted2'
57offshore_name = 'onslow_offshore_points'
58offshore1_name = '1'
59offshore2_name = '2'
60
61#final topo name
62combined_name ='onslow_combined_elevation'
63combined_smaller_name = 'onslow_combined_elevation_small'
64combined_smallest_name = 'onslow_combined_elevation_smallest'
65
66anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
67#anuga_dir_name = temp_dir + temp_time+sep
68
69topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'070112'+sep+'points'+sep
70topographies_dir = anuga_dir+'topographies'+sep
71topographies_time_dir = topographies_dir+build_time+sep
72
73
74# input topo file location
75onshore_in_dir_name = topographies_in_dir + onshore_name
76coast_in_dir_name = topographies_in_dir + coast_name
77offshore_in_dir_name = topographies_in_dir + offshore_name
78offshore1_in_dir_name = topographies_in_dir + offshore1_name
79offshore2_in_dir_name = topographies_in_dir + offshore2_name
80
81onshore_dir_name = topographies_dir + onshore_name
82coast_dir_name = topographies_dir + coast_name
83offshore_dir_name = topographies_dir + offshore_name
84offshore1_dir_name = topographies_dir + offshore1_name
85offshore2_dir_name = topographies_dir + offshore2_name
86
87#final topo files
88combined_dir_name = topographies_dir + combined_name
89combined_time_dir_name = topographies_time_dir + combined_name
90#combined_smaller_dir_name = topographies_dir + combined_smaller_name
91#combined_smallest_dir_name = topographies_dir + combined_smallest_name
92#combined_time_dir_final_name = topographies_time_dir + combined_final_name
93
94meshes_dir = anuga_dir+'meshes'+sep
95meshes_dir_name = meshes_dir + scenario_name
96
97polygons_dir = anuga_dir+'polygons'+sep
98tide_dir = anuga_dir+'tide_data'+sep
99
100boundaries_source = ''
101boundaries_name = 'onslow_3854_17042007'
102
103#boundaries locations
104#boundaries_in_dir = anuga_dir+'boundaries'+sep
105boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'1_10000'+sep
106boundaries_in_dir_name = boundaries_in_dir + boundaries_name
107boundaries_dir = anuga_dir+'boundaries'+sep
108boundaries_dir_name = boundaries_dir + boundaries_name
109
110#output locations
111output_dir = anuga_dir+'outputs'+sep
112output_build_time_dir = output_dir+build_time+sep
113output_run_time_dir = output_dir +run_time+dir_comment+sep
114output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
115
116#gauges
117gauges_dir = anuga_dir+'gauges'+sep
118
119gauges_dir_name = gauges_dir + 'gauge_location_onslow.csv'
120gauges_dir_name_bindi = gauges_dir + 'gauge_location_bindi.csv'
121gauges_comparison_dir_name_50 = gauges_dir + '50_gauges.xya'
122gauges_comparison_dir_name = gauges_dir + 'MOST_comparison_gauges.xya'
123gauges_comparison_dir_name_3d = gauges_dir + 'MOST_comparison_gauges_3d.xya'
124
125community_filename = gauges_dir + 'CHINS_v2.csv'
126community_scenario = gauges_dir + 'community_onslow.csv'
127buildings_filename = gauges_dir + 'Onslow_res_Project.csv'
128buildings_filename_out = 'Onslow_res_Project_modified.csv'
129###############################
130# Domain definitions
131###############################
132
133south_boundary = degminsec2decimal_degrees(-22,15,0)
134north_boundary = degminsec2decimal_degrees(-20,30,0)
135west_boundary = degminsec2decimal_degrees(114,15,0)
136east_boundary = degminsec2decimal_degrees(115,50,0)
137
138#Updated Main Domain of Onslow: first run NB 6/4/06
139d0 = [310000, 7690000]
140d1 = [280000, 7690000]
141d2 = [270000, 7645000]
142d3 = [240000, 7625000]
143d4 = [270000, 7580000]
144d5 = [300000, 7590000]
145d6 = [340000, 7610000]
146
147poly_all = [d0, d1, d2, d3, d4, d5, d6]
148res_poly_all = 100000*res_factor
149print 'bounding polygon area', polygon_area(poly_all)/1000000.0
150#Interior region - Onslow town
151
152#for visualisation
153#i0 = [304000, 7609000]
154#i1 = [301500, 7605000]
155#i2 = [304000, 7603000]
156#i3 = [307000, 7602000]
157#i4 = [309000, 7603000]
158#i5 = [311000, 7607000]
159
160i0 = [304000, 7607000]
161i1 = [302000, 7605000]
162i2 = [304000, 7603000]
163i3 = [307000, 7602000]
164i4 = [309000, 7603000]
165i5 = [307000, 7606000]
166poly_onslow = [i0, i1, i2, i3, i4, i5]
167res_onslow = 500*res_factor
168print 'onslow polygon area', polygon_area(poly_onslow)/1000000.0
169
170#Thevenard Island
171j0 = [294000, 7629000]
172j1 = [285000, 7625000]
173j2 = [294000, 7621000]
174j3 = [299000, 7625000]
175poly_thevenard = [j0, j1, j2, j3]
176res_thevenard = 2500*res_factor
177print 'thevenard polygon area', polygon_area(poly_thevenard)/1000000.0
178
179#med res around onslow
180l0 = [300000, 7610000]
181l1 = [285000, 7600000]
182l2 = [300000, 7597500]
183l3 = [310000, 7600000]
184l4 = [315000, 7610000]
185poly_coast = [l0, l1, l2, l3, l4]
186res_coast = 2500*res_factor
187print 'coast polygon area', polygon_area(poly_coast)/1000000.0
188
189#general coast and local area to onslow region
190m0 = [270000, 7581000]
191m1 = [300000, 7591000]
192m2 = [339000, 7610000]
193m3 = [330000, 7630000]
194m4 = [290000, 7640000]
195m5 = [260000, 7600000]
196poly_region = [m0, m1, m2, m3, m4, m5]
197res_region = 20000*res_factor
198print 'region polygon area', polygon_area(poly_region)/1000000.0
199
200interior_regions = [[poly_onslow,res_onslow],[poly_coast,res_coast],
201                    [poly_region,res_region]
202#                   ,[poly_thevenard,res_thevenard]
203                    ]
204
205trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
206
207print 'min number triangles', trigs_min
208
209
210###################################################################
211# Clipping regions for export to asc and regions for clipping data
212###################################################################
213
214poly_mainland = read_polygon(polygons_dir+'InitialCondition_points.csv')
215
216# region to export
217e_min_area = 300000
218e_max_area = 310000
219n_min_area = 7600000
220n_max_area = 7610000
221
Note: See TracBrowser for help on using the repository browser.