source: anuga_work/production/onslow_2006/project.py @ 4134

Last change on this file since 4134 was 4134, checked in by sexton, 18 years ago

report updates - taking Trevor's comments into account for revision of Onslow report

File size: 7.4 KB
Line 
1"""Common filenames and locations for topographic data, meshes and outputs.
2Also includes origin for slump scenario.
3"""
4
5from os import sep, environ, getenv, getcwd
6from os.path import expanduser
7from anuga.utilities.polygon import read_polygon, polygon_area
8import sys
9
10from anuga.coordinate_transforms.redfearn import convert_from_latlon_to_utm
11
12from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
13
14from time import localtime, strftime, gmtime
15               
16#Making assumptions about the location of scenario data
17state = 'western_australia'
18scenario_dir_name = 'onslow_tsunami_scenario_2006'
19
20# 250m data to be provided
21coarsename = 'onsl_bathydem250' # get from Neil/Ingo (DEM or topo data)
22
23# 30m data to be provided
24onshore_name_dted = 'onslow_onshore_30m_dted2' # get from Neil/Ingo (DEM or topo data)
25
26# 20m data to be provided
27onshore_name_dli = 'onslow_onshore_20m_dli' # get from Neil/Ingo (DEM or topo data)
28
29coast_name = 'onslow_coast'
30islands_name = 'onslow_islands_dted2'
31offshore_name = 'onslow_offshore_points'
32
33boundary_basename = 'SU-AU_clip'
34
35#swollen/ all data output
36basename = 'source'
37
38codename = 'project.py'
39
40if sys.platform == 'win32':
41    home = getenv('INUNDATIONHOME')
42#    python_home = getenv('PWD')     
43#    home = environ['INUNDATIONHOME']     #Sandpit's parent dir
44    user = getenv('USERPROFILE')
45#    user = basename(user_path)
46   
47else:   
48    home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation')     
49    user = getenv('LOGNAME')
50    print 'USER:', user
51
52# INUNDATIONHOME is the inundation directory, not the data directory.
53home += sep +'data'
54
55#Derive subdirectories and filenames
56#time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
57local_time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
58
59meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep
60datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep
61gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep
62polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep
63boundarydir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep
64#output dir without time
65outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep
66tidedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'tide_data'+sep
67comparereportdir = '..'+sep+'..'+sep+'documentation'+sep+'experimentation'+sep+'boundary_ANUGA_MOST'+sep+'report'
68
69outputtimedir = outputdir + local_time + sep
70
71print'bound', boundarydir
72
73#gauge_filename = gaugedir + 'onslow_gauges.xya'
74#for MOST
75gauge_filename = gaugedir + 'gauge_location_onslow.csv'
76gauge_filename_bindi = gaugedir + 'gauge_location_bindi.csv'
77gauges50 = gaugedir + '50_gauges.xya'
78gauge_comparison = gaugedir + 'MOST_comparison_gauges.xya'
79gauge_comparison_3d = gaugedir + 'MOST_comparison_gauges_3d.xya'
80community_filename = gaugedir + 'CHINS_v2.csv'
81community_scenario = gaugedir + 'community_onslow.csv'
82#buildings_filename = gaugedir + 'onslow_res.csv'
83buildings_filename = gaugedir + 'extra_points_nbed.csv'
84#buildings_filename_out = gaugedir + 'onslow_res_modified.csv'
85buildings_filename_damage_out = 'extra_points_nbed_modified.csv'
86
87gaugetimeseries = gaugedir + 'onslow'
88
89tidal_filename = tidedir + 'onsl.txt'
90tidal_outname = tidedir + 'max_min.txt'
91
92# boundary source data
93#MOST_dir = 'f:'+sep+'3'+sep+'ehn'+sep+'users'+sep+'davidb'+sep+'tsunami'+sep+'WA_project'+sep+'SU-AU_90'+sep+'most_2'+sep+'detailed'+sep
94
95codedir = getcwd()+sep
96                               
97codedirname = codedir + 'project.py'
98
99#meshname = meshdir + basename
100meshname = outputtimedir + 'mesh_' + basename
101print 'meshname',meshname
102coarsedemname = datadir + coarsename
103
104onshore_dem_name = datadir + onshore_name_dli
105
106offshore_dem_name = datadir + offshore_name
107coast_dem_name = datadir + coast_name
108islands_dem_name = datadir + islands_name
109combined_dem_name = datadir + 'onslow_combined_elevation'
110
111outputname = outputtimedir + basename  #Used by post processing
112
113#!gauge_filename = outputdir + 'onslow_gauges.xya'
114#!gauge_outname = outputdir + 'gauges_max_output.xya'
115
116# clipping region to make DEM (pts file) from fine elevation data
117eastingmin = 240000
118eastingmax = 340000
119northingmin = 7580000
120northingmax = 7700000
121
122south = degminsec2decimal_degrees(-22,15,0)
123north = degminsec2decimal_degrees(-20,30,0)
124west = degminsec2decimal_degrees(114,15,0)
125east = degminsec2decimal_degrees(115,50,0)
126'''
127# region for visualisation
128eminviz = 260000
129emaxviz = 320000
130nminviz = 7590000
131nmaxviz = 7630000
132'''
133# region to export
134
135e_min_area = 300000
136e_max_area = 310000
137n_min_area = 7600000
138n_max_area = 7610000
139
140# region to export to make elevation map: JS 22/9/06 - NOTE, this won't
141# work as region needs to be inside bounding box (polyAll)!!
142
143e_min_area = 240000
144e_max_area = 340000
145n_min_area = 7580000
146n_max_area = 7690000
147export_region = [[e_min_area, n_min_area],
148                 [e_min_area, n_max_area],
149                 [e_max_area, n_max_area],
150                 [e_max_area, n_min_area]]
151#Georeferencing
152from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
153
154refzone = 50
155
156#Updated Main Domain of Onslow: first run NB 6/4/06
157d0 = [310000, 7690000]
158d1 = [280000, 7690000]
159d2 = [270000, 7645000]
160d3 = [240000, 7625000]
161d4 = [270000, 7580000]
162d5 = [300000, 7590000]
163d6 = [340000, 7610000]
164
165polyAll = [d0, d1, d2, d3, d4, d5, d6]
166print 'bounding polygon area', polygon_area(polyAll)/1000000.0
167polygons = [polyAll, export_region]
168figname = 'checking.png'
169#from anuga.utilities.polygon import plot_polygons
170#plot_polygons(polygons, figname, verbose = False)
171#print figname
172#Interior region - Onslow town
173
174#first run!
175#i0 = [304000, 7608000]
176#i1 = [302000, 7605000]
177#i2 = [303000, 7602000]
178#i3 = [305000, 7601000]
179#i4 = [309000, 7603000]
180#i5 = [307000, 7606500]
181
182#refined run
183#i0 = [304000, 7607000]
184#i1 = [302000, 7605000]
185#i2 = [304000, 7603000]
186#i3 = [307000, 7602000]
187#i4 = [309000, 7603000]
188#i5 = [307000, 7606000]
189
190#for visualisation
191#i0 = [304000, 7609000]
192#i1 = [301500, 7605000]
193#i2 = [304000, 7603000]
194#i3 = [307000, 7602000]
195#i4 = [309000, 7603000]
196#i5 = [311000, 7607000]
197
198#i0 = [304000, 7608000]
199i0 = [304000, 7607000]
200i1 = [302000, 7605000]
201#i2 = [303000, 7602000]
202i2 = [304000, 7603000]
203#i3 = [305000, 7601000]
204i3 = [307000, 7602000]
205i4 = [309000, 7603000]
206#i5 = [307000, 7606500]
207i5 = [307000, 7606000]
208
209
210poly_onslow = [i0, i1, i2, i3, i4, i5]
211print 'onslow polygon area', polygon_area(poly_onslow)/1000000.0
212#Thevenard Island
213j0 = [294000, 7629000]
214j1 = [285000, 7625000]
215j2 = [294000, 7621000]
216j3 = [299000, 7625000]
217
218poly_thevenard = [j0, j1, j2, j3]
219print 'thevenard polygon area', polygon_area(poly_thevenard)/1000000.0
220'''
221# Direction Is
222k0 = [309000, 7619000]
223k1 = [304000, 7619000]
224k2 = [304000, 7616500]
225k3 = [309000, 7616500]
226
227poly_direction = [k0, k1, k2, k3]
228'''
229
230#med res around onslow
231l0 = [300000, 7610000]
232l1 = [285000, 7600000]
233l2 = [300000, 7597500]
234l3 = [310000, 7600000]
235l4 = [315000, 7610000]
236#l5 = [310000, 7612500]
237
238#poly_coast = [l0, l1, l2, l3, l4, l5]
239poly_coast = [l0, l1, l2, l3, l4]
240print 'coast polygon area', polygon_area(poly_coast)/1000000.0
241#general coast and local area to onslow region
242m0 = [270000, 7581000]
243m1 = [300000, 7591000]
244m2 = [339000, 7610000]
245m3 = [330000, 7630000]
246m4 = [290000, 7640000]
247m5 = [260000, 7600000]
248
249poly_region = [m0, m1, m2, m3, m4, m5]
250print 'region polygon area', polygon_area(poly_region)/1000000.0
Note: See TracBrowser for help on using the repository browser.