source: production/hobart_2006/project.py @ 3559

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

starting on Hobart script

File size: 4.2 KB
RevLine 
[3559]1# -*- coding: cp1252 -*-
2"""Common filenames and locations for topographic data, meshes and outputs.
3"""
4
5
6
7from os import sep, environ, getenv, getcwd
8from os.path import expanduser
9import sys
10from time import localtime, strftime, gmtime
11               
12#Making assumptions about the location of scenario data
13state = 'tasmania'
14scenario_dir_name = 'hobart_tsunami_scenario_2006'
15
16# data provided by Tas SES and checked by NM&I
17onshore_name = 'hobart_onshore' 
18offshore_name = 'hobart_offshore_points'
19
20# developed by NM&I
21coast_name = 'hobart_coast'
22
23boundary_basename = 'SU-AU_clip'
24
25#swollen/ all data output
26basename = 'source'
27
28codename = 'project.py'
29
30if sys.platform == 'win32':
31    home = getenv('INUNDATIONHOME')
32    user = getenv('USERPROFILE')   
33else:   
34    home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation')     
35    user = getenv('LOGNAME')
36    print 'USER:', user
37
38#Derive subdirectories and filenames
39#time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
40local_time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
41
42meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep
43datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep
44gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep
45polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep
46boundarydir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep
47#output dir without time
48outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep
49outputtimedir = outputdir + local_time + sep
50polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep
51
52gauge_filename = gaugedir + 'hobart_gauges.xya'
53buildings_filename = gaugedir + 'hobart_res.csv'
54buildings_filename_damage_out = 'hobart_res_modified.csv'
55
56gaugetimeseries = gaugedir + 'hobart'
57
58# boundary source data
59#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
60
61codedir = getcwd()+sep
62                               
63codedirname = codedir + 'project.py'
64
65meshname = outputtimedir + 'mesh_' + basename
66coarsedemname = datadir + coarsename
67
68onshore_dem_name = datadir + onshore_name
69offshore_dem_name = datadir + offshore_name
70coast_dem_name = datadir + coast_name
71combined_dem_name = datadir + 'hobart_combined_elevation'
72
73outputname = outputtimedir + basename  #Used by post processing
74
75from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
76from anuga.coordinate_transforms.redfearn import redfearn
77
78# bounding box
79south = degminsec2decimal_degrees(-43,45,0)
80north = degminsec2decimal_degrees(-42,30,0)
81west = degminsec2decimal_degrees(146,45,0)
82east = degminsec2decimal_degrees(148,15,0)
83
84'''
85# region for visualisation
86eminviz = 260000
87emaxviz = 320000
88nminviz = 7590000
89nmaxviz = 7630000
90'''
91# region to export
92
93e_min_area = 300000
94e_max_area = 310000
95n_min_area = 7600000
96n_max_area = 7610000
97
98
99#Main Domain of Hobart: first run JS 15/9/06
100zone, e0, n0 = redfearn(south, west)
101zone, e1, n1 = redfearn(south, east)
102zone, e2, n2 = redfearn(north, east)
103zone, e3, n3 = redfearn(north, west)
104refzone = zone
105d0 = [e0, n0]
106d1 = [e1, n1]
107d2 = [e2, n2]
108d3 = [e3, n3]
109
110polyAll = [d0, d1, d2, d3]
111
112#Interior region - Hobart city area
113#from anuga.utilities.polygon import read_polygon
114polygonptsfile0 = polygondir + 'poly1’
115polygonptsfile1 = polygondir + 'poly2’
116northern_polygon = read_polygon(polygonptsfile0 + '.csv')
117southern_polygon = read_polygon(polygonptsfile1 + '.csv')
118
119i0 = [304000, 7607000]
120i1 = [302000, 7605000]
121i2 = [304000, 7603000]
122i3 = [307000, 7602000]
123i4 = [309000, 7603000]
124i5 = [307000, 7606000]
125
126poly_hobart = [i0, i1, i2, i3, i4, i5]
127
128#med res around Hobart
129l0 = [300000, 7610000]
130l1 = [285000, 7600000]
131l2 = [300000, 7597500]
132l3 = [310000, 7600000]
133l4 = [315000, 7610000]
134
135poly_coast = [l0, l1, l2, l3, l4]
136
137#general coast and local area to Hobart region
138m0 = [270000, 7581000]
139m1 = [300000, 7591000]
140m2 = [339000, 7610000]
141m3 = [330000, 7630000]
142m4 = [290000, 7640000]
143m5 = [260000, 7600000]
144
145poly_region = [m0, m1, m2, m3, m4, m5]
146
147# Bruny Island
148poly_bruny = [b0, b1, b2, b3, b4]
Note: See TracBrowser for help on using the repository browser.