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

Last change on this file since 4580 was 4580, checked in by sexton, 17 years ago

minor updates for gauge names plus plotting files

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