source: anuga_work/production/hobart_2006/project.py @ 3779

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

refining Hobart example even further ...

File size: 7.8 KB
Line 
1# -*- coding: cp1252 -*-
2"""Common filenames and locations for topographic data, meshes and outputs.
3"""
4
5from os import sep, environ, getenv, getcwd
6from os.path import expanduser
7import sys
8from time import localtime, strftime, gmtime
9from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area
10from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_from_latlon_to_utm
11
12if sys.platform == 'win32':
13    home = getenv('INUNDATIONHOME')
14    user = getenv('USERPROFILE')
15
16else:   
17    home = getenv('INUNDATIONHOME', sep+'d'+sep+'xrd'+sep+'gem'+sep+'2'+sep+'ramp'+sep+'risk_assessment_methods_project'+sep+'inundation')     
18    user = getenv('LOGNAME')
19    print 'USER:', user
20
21# INUNDATIONHOME is the inundation directory, not the data directory.
22home += sep +'data'
23
24#Making assumptions about the location of scenario data
25state = 'tasmania'
26scenario_dir_name = 'hobart_tsunami_scenario_2006'
27
28# data provided by Tas SES and checked by NM&I
29#onshore_name = 'hob3_topo' # original
30onshore_name_25 = 'hob5_topo_25m' # 25m grid and clipped to 100m elevation or 3000m from coast
31onshore_name = 'hob5_topo' # 12.5m grid and clipped to 100m elevation or 3000m from coast
32#onshore_name_25 = 'hob6_topo_25m' # 25m grid NOT clipped
33offshore_name_tas1 = 'derwent_2m'
34offshore_name_tas2 = 'derwent_5m'
35offshore_name_tas3 = 'south_east_tas' #actually this is AHO
36offshore_name_tas4 = 'hobart_1m'
37
38# AHO data and checked by NM&I
39offshore_name1 = 'xy100003760'
40offshore_name2 = 'xy100003761'
41offshore_name3 = 'xy100003762'
42offshore_name4 = 'xy100003907'
43offshore_name5 = 'xy100003908'
44offshore_name6 = 'xy100003909'
45offshore_name7 = 'xy100003910'
46offshore_name8 = 'xy100003932'
47offshore_name9 = 'xy100003933'
48offshore_name10 = 'xy100003934'
49offshore_name11 = 'xy100003935'
50offshore_name12 = 'xy100003936'
51offshore_name13 = 'xy100003964'
52offshore_name14 = 'xy100014250'
53offshore_name15 = 'xy100014253'
54offshore_name16 = 'xy100016142'
55
56# developed by NM&I
57coast_name = 'coastline_points'
58
59boundary_basename = 'puysegur' # Mw 8.7
60#boundary_basename = 'puysegur_clip' # Mw 8.5
61
62#swollen/ all data output
63basename = 'source'
64
65codename = 'project.py'
66
67#Derive subdirectories and filenames
68#time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
69local_time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
70meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep
71datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep
72gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep
73polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep
74boundarydir = home+sep+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep
75outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep
76outputtimedir = outputdir + local_time + sep
77polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep
78
79#gauge_filename = gaugedir + 'hobart_gauges_final.csv'
80gauge_filename = gaugedir + 'check_boundary.csv'
81
82codedir = getcwd()+sep                           
83codedirname = codedir + 'project.py'
84meshname = outputtimedir + 'mesh_' + basename
85
86# Necessary if using point datasets, rather than grid
87onshore_dem_name = datadir + onshore_name
88onshore_dem_name_25 = datadir + onshore_name_25
89all_onshore_dem_name = datadir + 'combined_onshore'
90offshore_dem_name_local1 = datadir + offshore_name_tas1
91offshore_dem_name_local2 = datadir + offshore_name_tas2
92offshore_dem_name_local3 = datadir + offshore_name_tas3
93offshore_dem_name_local4 = datadir + offshore_name_tas4
94offshore_dem_name_aho1 = datadir + offshore_name1
95offshore_dem_name_aho2 = datadir + offshore_name2
96offshore_dem_name_aho3 = datadir + offshore_name3
97offshore_dem_name_aho4 = datadir + offshore_name4
98offshore_dem_name_aho5 = datadir + offshore_name5
99offshore_dem_name_aho6 = datadir + offshore_name6
100offshore_dem_name_aho7 = datadir + offshore_name7
101offshore_dem_name_aho8 = datadir + offshore_name8
102offshore_dem_name_aho9 = datadir + offshore_name9
103offshore_dem_name_aho10 = datadir + offshore_name10
104offshore_dem_name_aho11 = datadir + offshore_name11
105offshore_dem_name_aho12 = datadir + offshore_name12
106offshore_dem_name_aho13 = datadir + offshore_name13
107offshore_dem_name_aho14 = datadir + offshore_name14
108offshore_dem_name_aho15 = datadir + offshore_name15
109offshore_dem_name_aho16 = datadir + offshore_name16
110coast_dem_name = datadir + coast_name
111
112# addition once total grid delivered
113onshore_offshore_dem_name_25 = datadir + '25m_se_tas' #25m grid
114onshore_offshore_dem_name    = datadir + '50m_se_tas' #50m grid
115
116# output names
117bruny_dem_name_25   = datadir + 'bruny_25_dem'
118hobart_dem_name_25  = datadir + 'hobart_25_dem'
119combined_dem_name   = datadir + 'hobart_combined_elevation'
120combined_dem_name_2 = datadir + 'hobart_combined_elevation_2'
121combined_dem_name_3 = datadir + 'hobart_combined_elevation_jane'
122combined_dem_name_4 = datadir + 'hobart_combined_elevation_test'
123
124#outputname = outputtimedir + basename  #Used by post processing
125
126
127###############################
128# Domain definitions
129###############################
130
131# bounding box for clipping MOST output (much bigger than study area)
132south = degminsec2decimal_degrees(-44,45,0)
133north = degminsec2decimal_degrees(-42,0,0)
134west  = degminsec2decimal_degrees(146,45,0)
135east  = degminsec2decimal_degrees(148,25,0) 
136
137###Main Domain of Hobart:
138d0 = [south, west]
139d1 = [south, east]
140d2 = [north, east]
141d3 = [north, west]
142polyAll2, zone = convert_from_latlon_to_utm([d0, d1, d2, d3])
143refzone = zone
144
145# Mark run - morning Fri 29 Sep; surrounds -100m and 20mish elevation
146polyAll = read_polygon(polygondir+'new_extent_2.csv')
147plot_polygons([polyAll, polyAll2],'boundingpoly',verbose=False)
148print 'Area of bounding polygon', polygon_area(polyAll)
149polyAll_refine = read_polygon(polygondir+'extent_refine.csv')
150print 'Area of refined bounding polygon', polygon_area(polyAll_refine)
151print 'change', polygon_area(polyAll_refine)/polygon_area(polyAll)
152
153polyAll_refine2 = read_polygon(polygondir+'export_refine_2.csv')
154print 'Area of refined bounding polygon 2', polygon_area(polyAll_refine2)
155print 'change 2', polygon_area(polyAll_refine2)/polygon_area(polyAll)
156
157###################################################################
158# Clipping regions for export to asc and regions for clipping data
159###################################################################
160
161# clipping 12.5m onshore data set
162eastingmin = 520000
163eastingmax = 536000
164northingmin = 5245000
165northingmax = 5260000
166
167# clipping 25m data set - Hobart
168eastingmin25 = 524208.387
169eastingmax25 = 554867.24
170northingmin25 = 5229154.555
171northingmax25 = 5258511.857
172hob_clip = [[eastingmin25,northingmin25],[eastingmin25,northingmax25],[eastingmax25,northingmax25],[eastingmax25,northingmin25]]
173# clipping 25m data set - Bruny
174eastingmin25_2 = 523672.502
175eastingmax25_2 = 536020.057
176northingmin25_2 = 5203120.035
177northingmax25_2 = 5212052.309
178bruny_clip = [[eastingmin25_2,northingmin25_2],[eastingmin25_2,northingmax25_2],[eastingmax25_2,northingmax25_2],[eastingmax25_2,northingmin25_2]]
179# overall 25m clipping region - covering Hobart and Bruny
180eastingmin25_3 = 523672.502
181eastingmax25_3 = 554867.24
182northingmin25_3 = 5203120.035
183northingmax25_3 = 5258511.857
184
185###############################
186# Interior region definitions
187###############################
188
189# Hobart digitized polygons
190poly_hobart1 = read_polygon(polygondir+'Hob_poly1.csv')
191poly_hobart2 = read_polygon(polygondir+'Hob_poly2.csv')
192poly_hobart3 = read_polygon(polygondir+'Hob_poly3.csv')
193poly_hobart4 = read_polygon(polygondir+'Hob_poly4.csv')
194
195plot_polygons([polyAll, poly_hobart1,poly_hobart2,poly_hobart3,poly_hobart4],'boundingpoly2',verbose=False)
196print 'Area of interior regions', (polygon_area(poly_hobart1)+\
197      polygon_area(poly_hobart2)+polygon_area(poly_hobart3)+polygon_area(poly_hobart4))/1000000.
198
199print 'Area of original 25m data clipping', (polygon_area(hob_clip)+polygon_area(bruny_clip))/1000000.
200
Note: See TracBrowser for help on using the repository browser.