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

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

path fixups

File size: 7.3 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'
76gauges50 = gaugedir + '50_gauges.xya'
77gauge_comparison = gaugedir + 'MOST_comparison_gauges.xya'
78gauge_comparison_3d = gaugedir + 'MOST_comparison_gauges_3d.xya'
79community_filename = gaugedir + 'CHINS_v2.csv'
80community_scenario = gaugedir + 'community_onslow.csv'
81#buildings_filename = gaugedir + 'onslow_res.csv'
82buildings_filename = gaugedir + 'extra_points_nbed.csv'
83#buildings_filename_out = gaugedir + 'onslow_res_modified.csv'
84buildings_filename_damage_out = 'extra_points_nbed_modified.csv'
85
86gaugetimeseries = gaugedir + 'onslow'
87
88tidal_filename = tidedir + 'onsl.txt'
89tidal_outname = tidedir + 'max_min.txt'
90
91# boundary source data
92#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
93
94codedir = getcwd()+sep
95                               
96codedirname = codedir + 'project.py'
97
98#meshname = meshdir + basename
99meshname = outputtimedir + 'mesh_' + basename
100print 'meshname',meshname
101coarsedemname = datadir + coarsename
102
103onshore_dem_name = datadir + onshore_name_dli
104
105offshore_dem_name = datadir + offshore_name
106coast_dem_name = datadir + coast_name
107islands_dem_name = datadir + islands_name
108combined_dem_name = datadir + 'onslow_combined_elevation'
109
110outputname = outputtimedir + basename  #Used by post processing
111
112#!gauge_filename = outputdir + 'onslow_gauges.xya'
113#!gauge_outname = outputdir + 'gauges_max_output.xya'
114
115# clipping region to make DEM (pts file) from fine elevation data
116eastingmin = 240000
117eastingmax = 340000
118northingmin = 7580000
119northingmax = 7700000
120
121south = degminsec2decimal_degrees(-22,15,0)
122north = degminsec2decimal_degrees(-20,30,0)
123west = degminsec2decimal_degrees(114,15,0)
124east = degminsec2decimal_degrees(115,50,0)
125'''
126# region for visualisation
127eminviz = 260000
128emaxviz = 320000
129nminviz = 7590000
130nmaxviz = 7630000
131'''
132# region to export
133
134e_min_area = 300000
135e_max_area = 310000
136n_min_area = 7600000
137n_max_area = 7610000
138
139# region to export to make elevation map: JS 22/9/06 - NOTE, this won't
140# work as region needs to be inside bounding box (polyAll)!!
141
142e_min_area = 240000
143e_max_area = 340000
144n_min_area = 7580000
145n_max_area = 7690000
146export_region = [[e_min_area, n_min_area],
147                 [e_min_area, n_max_area],
148                 [e_max_area, n_max_area],
149                 [e_max_area, n_min_area]]
150#Georeferencing
151from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
152
153refzone = 50
154
155#Updated Main Domain of Onslow: first run NB 6/4/06
156d0 = [310000, 7690000]
157d1 = [280000, 7690000]
158d2 = [270000, 7645000]
159d3 = [240000, 7625000]
160d4 = [270000, 7580000]
161d5 = [300000, 7590000]
162d6 = [340000, 7610000]
163
164polyAll = [d0, d1, d2, d3, d4, d5, d6]
165print 'bounding polygon area', polygon_area(polyAll)/1000000.0
166polygons = [polyAll, export_region]
167figname = 'checking.png'
168from anuga.utilities.polygon import plot_polygons
169plot_polygons(polygons, figname, verbose = False)
170print figname
171#Interior region - Onslow town
172
173#first run!
174#i0 = [304000, 7608000]
175#i1 = [302000, 7605000]
176#i2 = [303000, 7602000]
177#i3 = [305000, 7601000]
178#i4 = [309000, 7603000]
179#i5 = [307000, 7606500]
180
181#refined run
182#i0 = [304000, 7607000]
183#i1 = [302000, 7605000]
184#i2 = [304000, 7603000]
185#i3 = [307000, 7602000]
186#i4 = [309000, 7603000]
187#i5 = [307000, 7606000]
188
189#for visualisation
190#i0 = [304000, 7609000]
191#i1 = [301500, 7605000]
192#i2 = [304000, 7603000]
193#i3 = [307000, 7602000]
194#i4 = [309000, 7603000]
195#i5 = [311000, 7607000]
196
197#i0 = [304000, 7608000]
198i0 = [304000, 7607000]
199i1 = [302000, 7605000]
200#i2 = [303000, 7602000]
201i2 = [304000, 7603000]
202#i3 = [305000, 7601000]
203i3 = [307000, 7602000]
204i4 = [309000, 7603000]
205#i5 = [307000, 7606500]
206i5 = [307000, 7606000]
207
208
209poly_onslow = [i0, i1, i2, i3, i4, i5]
210print 'onslow polygon area', polygon_area(poly_onslow)/1000000.0
211#Thevenard Island
212j0 = [294000, 7629000]
213j1 = [285000, 7625000]
214j2 = [294000, 7621000]
215j3 = [299000, 7625000]
216
217poly_thevenard = [j0, j1, j2, j3]
218print 'thevenard polygon area', polygon_area(poly_thevenard)/1000000.0
219'''
220# Direction Is
221k0 = [309000, 7619000]
222k1 = [304000, 7619000]
223k2 = [304000, 7616500]
224k3 = [309000, 7616500]
225
226poly_direction = [k0, k1, k2, k3]
227'''
228
229#med res around onslow
230l0 = [300000, 7610000]
231l1 = [285000, 7600000]
232l2 = [300000, 7597500]
233l3 = [310000, 7600000]
234l4 = [315000, 7610000]
235#l5 = [310000, 7612500]
236
237#poly_coast = [l0, l1, l2, l3, l4, l5]
238poly_coast = [l0, l1, l2, l3, l4]
239print 'coast polygon area', polygon_area(poly_coast)/1000000.0
240#general coast and local area to onslow region
241m0 = [270000, 7581000]
242m1 = [300000, 7591000]
243m2 = [339000, 7610000]
244m3 = [330000, 7630000]
245m4 = [290000, 7640000]
246m5 = [260000, 7600000]
247
248poly_region = [m0, m1, m2, m3, m4, m5]
249print 'region polygon area', polygon_area(poly_region)/1000000.0
Note: See TracBrowser for help on using the repository browser.