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

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

hobart script updates

File size: 7.5 KB
RevLine 
[3559]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
[3671]9from anuga.utilities.polygon import read_polygon, plot_polygons
10from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_points_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
[3559]24#Making assumptions about the location of scenario data
25state = 'tasmania'
26scenario_dir_name = 'hobart_tsunami_scenario_2006'
27
28
[3701]29##
30### data provided by Tas SES and checked by NM&I
31###onshore_name = 'hob3_topo' # original
32###onshore_name_25 = 'hob5_topo_25m' # 25m grid and clipped to 100m elevation or 3000m from coast
33##onshore_name = 'hob5_topo' # 12.5m grid and clipped to 100m elevation or 3000m from coast
34##onshore_name_25 = 'hob6_topo_25m' # 25m grid NOT clipped
35##offshore_name_tas1 = 'derwent_2m'
36##offshore_name_tas2 = 'derwent_5m'
37##offshore_name_tas3 = 'south_east_tas' #actually this is AHO
38##offshore_name_tas4 = 'hobart_1m'
39##
40### AHO data and checked by NM&I
41##offshore_name1 = 'xy100003760'
42##offshore_name2 = 'xy100003761'
43##offshore_name3 = 'xy100003762'
44##offshore_name4 = 'xy100003907'
45##offshore_name5 = 'xy100003908'
46##offshore_name6 = 'xy100003909'
47##offshore_name7 = 'xy100003910'
48##offshore_name8 = 'xy100003932'
49##offshore_name9 = 'xy100003933'
50##offshore_name10 = 'xy100003934'
51##offshore_name11 = 'xy100003935'
52##offshore_name12 = 'xy100003936'
53##offshore_name13 = 'xy100003964'
54##offshore_name14 = 'xy100014250'
55##offshore_name15 = 'xy100014253'
56##offshore_name16 = 'xy100016142'
57##
58### developed by NM&I
59##coast_name = 'coastline_points'
[3626]60
[3701]61boundary_basename = 'puysegur' # Mw 8.7
62#boundary_basename = 'puysegur_clip' # Mw 8.5
[3559]63
64
65#swollen/ all data output
66basename = 'source'
67
68codename = 'project.py'
69
70#Derive subdirectories and filenames
71#time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
72local_time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
73meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep
74datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep
75gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep
76polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep
[3669]77boundarydir = home+sep+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep
[3559]78outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep
79outputtimedir = outputdir + local_time + sep
80polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep
81
[3701]82gauge_filename = gaugedir + 'hobart_gauges_final.csv'
83#buildings_filename = gaugedir + 'hobart_res.csv'
84#buildings_filename_damage_out = 'hobart_res_modified.csv'
85#gaugetimeseries = gaugedir + 'hobart'
[3559]86
87# boundary source data
88#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
89
[3671]90codedir = getcwd()+sep                           
[3559]91codedirname = codedir + 'project.py'
92meshname = outputtimedir + 'mesh_' + basename
93
[3701]94# Necessary if using point datasets, rather than grid
95##onshore_dem_name = datadir + onshore_name
96##onshore_dem_name_25 = datadir + onshore_name_25
97##all_onshore_dem_name = datadir + 'combined_onshore'
98##offshore_dem_name_local1 = datadir + offshore_name_tas1
99##offshore_dem_name_local2 = datadir + offshore_name_tas2
100##offshore_dem_name_local3 = datadir + offshore_name_tas3
101##offshore_dem_name_local4 = datadir + offshore_name_tas4
102##offshore_dem_name_aho1 = datadir + offshore_name1
103##offshore_dem_name_aho2 = datadir + offshore_name2
104##offshore_dem_name_aho3 = datadir + offshore_name3
105##offshore_dem_name_aho4 = datadir + offshore_name4
106##offshore_dem_name_aho5 = datadir + offshore_name5
107##offshore_dem_name_aho6 = datadir + offshore_name6
108##offshore_dem_name_aho7 = datadir + offshore_name7
109##offshore_dem_name_aho8 = datadir + offshore_name8
110##offshore_dem_name_aho9 = datadir + offshore_name9
111##offshore_dem_name_aho10 = datadir + offshore_name10
112##offshore_dem_name_aho11 = datadir + offshore_name11
113##offshore_dem_name_aho12 = datadir + offshore_name12
114##offshore_dem_name_aho13 = datadir + offshore_name13
115##offshore_dem_name_aho14 = datadir + offshore_name14
116##offshore_dem_name_aho15 = datadir + offshore_name15
117##offshore_dem_name_aho16 = datadir + offshore_name16
118##coast_dem_name = datadir + coast_name
119
120
[3671]121# addition once total grid delivered
[3683]122onshore_offshore_dem_name_25 = datadir + '25m_se_tas' #25m grid
[3701]123onshore_offshore_dem_name    = datadir + '50m_se_tas' #50m grid
124
[3683]125# output names
[3701]126bruny_dem_name_25   = datadir + 'bruny_25_dem'
127hobart_dem_name_25  = datadir + 'hobart_25_dem'
128combined_dem_name   = datadir + 'hobart_combined_elevation'
[3683]129combined_dem_name_2 = datadir + 'hobart_combined_elevation_2'
[3559]130
[3701]131#outputname = outputtimedir + basename  #Used by post processing
[3559]132
[3701]133
[3671]134###############################
135# Domain definitions
136###############################
[3650]137
[3701]138# bounding box for clipping MOST output (much bigger than study area)
[3679]139south = degminsec2decimal_degrees(-44,45,0)
140north = degminsec2decimal_degrees(-42,0,0)
[3701]141west  = degminsec2decimal_degrees(146,45,0)
142east  = degminsec2decimal_degrees(148,25,0) 
[3559]143
[3701]144###Main Domain of Hobart:
[3615]145d0 = [south, west]
146d1 = [south, east]
147d2 = [north, east]
148d3 = [north, west]
[3679]149polyAll2, zone = convert_points_from_latlon_to_utm([d0, d1, d2, d3])
[3559]150refzone = zone
151
[3671]152# Second run - bottom bright, topr, top, left
[3679]153#polyAll = [[520000, 5170000],[580000, 5170000],[580000, 5200000],[590000,5240000],[520000,5260000]]
[3650]154
[3679]155
156# Mark run - morning Fri 29 Sep; surrounds -100m and 20mish elevation
[3671]157polyAll = read_polygon(polygondir+'new_extent.csv')
[3679]158plot_polygons([polyAll, polyAll2],'boundingpoly',verbose=False)
[3671]159
[3679]160
[3671]161###################################################################
162# Clipping regions for export to asc and regions for clipping data
163###################################################################
164
165
[3683]166# clipping 25m data set - Hobart
[3701]167eastingmin25 = 524208.387
168eastingmax25 = 554867.24
[3683]169northingmin25 = 5229154.555
170northingmax25 = 5258511.857
171
172# clipping 25m data set - Bruny
173eastingmin25_2 = 523672.502
174eastingmax25_2 = 536020.057
175northingmin25_2 = 5203120.035
176northingmax25_2 = 5212052.309
177
178
179
[3671]180###############################
181# Interior region definitions
182###############################
183
[3679]184###Interior region - Hobart city area + Glenorchy, Kingston
185##i0 = [517000, 5267000]
186##i1 = [517000, 5255000]
187##i2 = [520000, 5250000]
188##i3 = [522000, 5239000]
189##i4 = [524000, 5238000]
190##i5 = [526000, 5236000]
191##i6 = [530000, 5244000]
192##i7 = [530000, 5250000]
193##i8 = [534000, 5254000]
194##i9 = [520000, 5270000]
195##
196##poly_hobart = [i0, i1, i2, i3, i4, i5, i6, i7, i8, i9]
197##
198### Tasman Peninsula
199##l0 = [550000, 5247000]
200##l1 = [550000, 5211000]
201##l2 = [583000, 5211000]
202##l3 = [583000, 5247000]
203##
204##poly_tasman_peninsula = [l0, l1, l2, l3]
205##
206### Bruny Island
207##poly_bruny = read_polygon(polygondir+'bruny.csv')
[3559]208
209
[3679]210# Hobart digitized polygons
211poly_hobart1 = read_polygon(polygondir+'Hob_poly1.csv')
212poly_hobart2 = read_polygon(polygondir+'Hob_poly2.csv')
213poly_hobart3 = read_polygon(polygondir+'Hob_poly3.csv')
[3559]214
[3701]215plot_polygons([polyAll, poly_hobart1,poly_hobart2,poly_hobart3],'boundingpoly2',verbose=False)
Note: See TracBrowser for help on using the repository browser.