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

Last change on this file since 6806 was 5364, checked in by kristy, 17 years ago

updated current directory structure

File size: 7.3 KB
RevLine 
[2616]1"""Common filenames and locations for topographic data, meshes and outputs.
2Also includes origin for slump scenario.
3"""
4
[3249]5from os import sep, environ, getenv, getcwd
[2616]6from os.path import expanduser
[3788]7from anuga.utilities.polygon import read_polygon, polygon_area
[2616]8import sys
9
[3769]10from anuga.coordinate_transforms.redfearn import convert_from_latlon_to_utm
[2616]11
[3535]12from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
[2616]13
[3249]14from time import localtime, strftime, gmtime
[2616]15               
16#Making assumptions about the location of scenario data
[3270]17state = 'western_australia'
[2616]18scenario_dir_name = 'onslow_tsunami_scenario_2006'
[4151]19scenario_name = 'onslow'
[2616]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
[3261]25onshore_name_dted = 'onslow_onshore_30m_dted2' # get from Neil/Ingo (DEM or topo data)
[2616]26
[3261]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'
[2616]32offshore_name = 'onslow_offshore_points'
33
[2645]34boundary_basename = 'SU-AU_clip'
[2616]35
36#swollen/ all data output
37basename = 'source'
38
39codename = 'project.py'
40
41if sys.platform == 'win32':
[3249]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   
[2616]48else:   
[3249]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
[2616]52
[3669]53# INUNDATIONHOME is the inundation directory, not the data directory.
54home += sep +'data'
55
[2616]56#Derive subdirectories and filenames
[3249]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
[3270]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
[2682]65#output dir without time
[3270]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
[3276]68comparereportdir = '..'+sep+'..'+sep+'documentation'+sep+'experimentation'+sep+'boundary_ANUGA_MOST'+sep+'report'
[3249]69
[5364]70outputtimedir = outputdir + local_time + sep + scenario_name + sep +
[3249]71
[2624]72print'bound', boundarydir
[2616]73
[2773]74#gauge_filename = gaugedir + 'onslow_gauges.xya'
75#for MOST
[2958]76gauge_filename = gaugedir + 'gauge_location_onslow.csv'
[4580]77beach_gauges = gaugedir + 'beach_gauges.csv'
[4581]78boundary_gauges = gaugedir + 'boundary_gauges.csv'
[4580]79td_gauges = gaugedir + 'gauges_td.csv'
[4581]80db_point = gaugedir + 'db_points.csv'
[4134]81gauge_filename_bindi = gaugedir + 'gauge_location_bindi.csv'
[3136]82gauges50 = gaugedir + '50_gauges.xya'
[3158]83gauge_comparison = gaugedir + 'MOST_comparison_gauges.xya'
[3188]84gauge_comparison_3d = gaugedir + 'MOST_comparison_gauges_3d.xya'
[3136]85community_filename = gaugedir + 'CHINS_v2.csv'
86community_scenario = gaugedir + 'community_onslow.csv'
[4477]87buildings_filename = gaugedir + 'Onslow_res_Project.csv'
88buildings_filename_out = gaugedir + 'Onslow_res_Project.csv'
[3136]89
[4477]90
[2682]91gaugetimeseries = gaugedir + 'onslow'
92
[2721]93tidal_filename = tidedir + 'onsl.txt'
94tidal_outname = tidedir + 'max_min.txt'
95
[2624]96# boundary source data
[2645]97#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
[2624]98
[2616]99codedir = getcwd()+sep
100                               
101codedirname = codedir + 'project.py'
102
[3249]103#meshname = meshdir + basename
104meshname = outputtimedir + 'mesh_' + basename
105print 'meshname',meshname
[2616]106coarsedemname = datadir + coarsename
107
[3261]108onshore_dem_name = datadir + onshore_name_dli
[2616]109
110offshore_dem_name = datadir + offshore_name
[3261]111coast_dem_name = datadir + coast_name
112islands_dem_name = datadir + islands_name
[2616]113combined_dem_name = datadir + 'onslow_combined_elevation'
114
[2682]115outputname = outputtimedir + basename  #Used by post processing
[2616]116
117#!gauge_filename = outputdir + 'onslow_gauges.xya'
118#!gauge_outname = outputdir + 'gauges_max_output.xya'
119
[2682]120# clipping region to make DEM (pts file) from fine elevation data
121eastingmin = 240000
122eastingmax = 340000
[2616]123northingmin = 7580000
[2682]124northingmax = 7700000
[2616]125
[2773]126south = degminsec2decimal_degrees(-22,15,0)
[2683]127north = degminsec2decimal_degrees(-20,30,0)
[2773]128west = degminsec2decimal_degrees(114,15,0)
[2683]129east = degminsec2decimal_degrees(115,50,0)
[2682]130'''
[2616]131# region for visualisation
132eminviz = 260000
133emaxviz = 320000
134nminviz = 7590000
135nmaxviz = 7630000
[2682]136'''
137# region to export
[2616]138
[4504]139e_min_area = 290500
140e_max_area = 321500
141n_min_area = 7601550
142n_max_area = 7620000
[2682]143
[4856]144# old onslow for Gordon Monday 27 July 2007
145e_min_area = 290828
146e_max_area = 301021
147n_min_area = 7596160
148n_max_area = 7603100
149
[4581]150# for test grid for ITEM ppt
151#e_min_area = 207600
152#e_max_area = 320000
153#n_min_area = 7600350
154#n_max_area = 7691200
155
[3669]156# region to export to make elevation map: JS 22/9/06 - NOTE, this won't
157# work as region needs to be inside bounding box (polyAll)!!
[3650]158
[4423]159#e_min_area = 240000
160#e_max_area = 340000
161#n_min_area = 7580000
162#n_max_area = 7690000
[3669]163export_region = [[e_min_area, n_min_area],
164                 [e_min_area, n_max_area],
165                 [e_max_area, n_max_area],
166                 [e_max_area, n_min_area]]
[2616]167#Georeferencing
[3535]168from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
[2616]169
170refzone = 50
171
[2682]172#Updated Main Domain of Onslow: first run NB 6/4/06
173d0 = [310000, 7690000]
174d1 = [280000, 7690000]
175d2 = [270000, 7645000]
176d3 = [240000, 7625000]
177d4 = [270000, 7580000]
178d5 = [300000, 7590000]
179d6 = [340000, 7610000]
[2616]180
[2645]181polyAll = [d0, d1, d2, d3, d4, d5, d6]
[3788]182print 'bounding polygon area', polygon_area(polyAll)/1000000.0
[3669]183polygons = [polyAll, export_region]
184figname = 'checking.png'
[2616]185#Interior region - Onslow town
186
[3249]187#for visualisation
[3265]188#i0 = [304000, 7609000]
189#i1 = [301500, 7605000]
190#i2 = [304000, 7603000]
191#i3 = [307000, 7602000]
192#i4 = [309000, 7603000]
193#i5 = [311000, 7607000]
194
195#i0 = [304000, 7608000]
196i0 = [304000, 7607000]
197i1 = [302000, 7605000]
198#i2 = [303000, 7602000]
[2773]199i2 = [304000, 7603000]
[3265]200#i3 = [305000, 7601000]
[2773]201i3 = [307000, 7602000]
[2616]202i4 = [309000, 7603000]
[3265]203#i5 = [307000, 7606500]
204i5 = [307000, 7606000]
[2616]205
[3249]206
[2616]207poly_onslow = [i0, i1, i2, i3, i4, i5]
[3788]208print 'onslow polygon area', polygon_area(poly_onslow)/1000000.0
[2616]209#Thevenard Island
210j0 = [294000, 7629000]
211j1 = [285000, 7625000]
212j2 = [294000, 7621000]
213j3 = [299000, 7625000]
214
215poly_thevenard = [j0, j1, j2, j3]
[3788]216print 'thevenard polygon area', polygon_area(poly_thevenard)/1000000.0
[2773]217'''
[2616]218# Direction Is
219k0 = [309000, 7619000]
220k1 = [304000, 7619000]
221k2 = [304000, 7616500]
222k3 = [309000, 7616500]
223
224poly_direction = [k0, k1, k2, k3]
[2682]225'''
[2773]226
227#med res around onslow
228l0 = [300000, 7610000]
229l1 = [285000, 7600000]
230l2 = [300000, 7597500]
231l3 = [310000, 7600000]
232l4 = [315000, 7610000]
233#l5 = [310000, 7612500]
234
235#poly_coast = [l0, l1, l2, l3, l4, l5]
236poly_coast = [l0, l1, l2, l3, l4]
[3788]237print 'coast polygon area', polygon_area(poly_coast)/1000000.0
[2773]238#general coast and local area to onslow region
239m0 = [270000, 7581000]
240m1 = [300000, 7591000]
241m2 = [339000, 7610000]
242m3 = [330000, 7630000]
243m4 = [290000, 7640000]
244m5 = [260000, 7600000]
245
246poly_region = [m0, m1, m2, m3, m4, m5]
[3788]247print 'region polygon area', polygon_area(poly_region)/1000000.0
Note: See TracBrowser for help on using the repository browser.