1 | # -*- coding: cp1252 -*- |
---|
2 | """Common filenames and locations for topographic data, meshes and outputs. |
---|
3 | """ |
---|
4 | |
---|
5 | from os import sep, environ, getenv, getcwd |
---|
6 | from os.path import expanduser |
---|
7 | import sys |
---|
8 | from time import localtime, strftime, gmtime |
---|
9 | |
---|
10 | #Making assumptions about the location of scenario data |
---|
11 | state = 'tasmania' |
---|
12 | scenario_dir_name = 'hobart_tsunami_scenario_2006' |
---|
13 | |
---|
14 | # data provided by Tas SES and checked by NM&I |
---|
15 | onshore_name = 'hobart_onshore' |
---|
16 | offshore_name = 'hobart_offshore_points' |
---|
17 | |
---|
18 | # developed by NM&I |
---|
19 | coast_name = 'hobart_coast' |
---|
20 | |
---|
21 | boundary_basename = 'SU-AU_clip' |
---|
22 | |
---|
23 | #swollen/ all data output |
---|
24 | basename = 'source' |
---|
25 | |
---|
26 | codename = 'project.py' |
---|
27 | |
---|
28 | if sys.platform == 'win32': |
---|
29 | home = getenv('INUNDATIONHOME') |
---|
30 | user = getenv('USERPROFILE') |
---|
31 | else: |
---|
32 | home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation') |
---|
33 | user = getenv('LOGNAME') |
---|
34 | print 'USER:', user |
---|
35 | |
---|
36 | #Derive subdirectories and filenames |
---|
37 | #time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
38 | local_time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir |
---|
39 | |
---|
40 | meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep |
---|
41 | datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep |
---|
42 | gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep |
---|
43 | polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep |
---|
44 | boundarydir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep |
---|
45 | #output dir without time |
---|
46 | outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep |
---|
47 | outputtimedir = outputdir + local_time + sep |
---|
48 | polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep |
---|
49 | |
---|
50 | gauge_filename = gaugedir + 'hobart_gauges.xya' |
---|
51 | buildings_filename = gaugedir + 'hobart_res.csv' |
---|
52 | buildings_filename_damage_out = 'hobart_res_modified.csv' |
---|
53 | |
---|
54 | gaugetimeseries = gaugedir + 'hobart' |
---|
55 | |
---|
56 | # boundary source data |
---|
57 | #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 |
---|
58 | |
---|
59 | codedir = getcwd()+sep |
---|
60 | |
---|
61 | codedirname = codedir + 'project.py' |
---|
62 | |
---|
63 | meshname = outputtimedir + 'mesh_' + basename |
---|
64 | coarsedemname = datadir + coarsename |
---|
65 | |
---|
66 | onshore_dem_name = datadir + onshore_name |
---|
67 | offshore_dem_name_local = datadir + offshore_name_local |
---|
68 | offshore_dem_name_aho = datadir + offshore_name_fairsheets |
---|
69 | coast_dem_name = datadir + coast_name |
---|
70 | combined_dem_name = datadir + 'hobart_combined_elevation' |
---|
71 | |
---|
72 | outputname = outputtimedir + basename #Used by post processing |
---|
73 | |
---|
74 | # region to export |
---|
75 | e_min_area = 500000 |
---|
76 | e_max_area = 540000 |
---|
77 | n_min_area = 5220000 |
---|
78 | n_max_area = 5275000 |
---|
79 | |
---|
80 | from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, |
---|
81 | convert_points_from_latlon_to_utm |
---|
82 | |
---|
83 | # bounding box |
---|
84 | south = degminsec2decimal_degrees(-43,45,0) |
---|
85 | north = degminsec2decimal_degrees(-42,30,0) |
---|
86 | west = degminsec2decimal_degrees(146,45,0) |
---|
87 | east = degminsec2decimal_degrees(148,15,0) |
---|
88 | |
---|
89 | #Main Domain of Hobart: first run JS 18/9/06 |
---|
90 | d0 = [south, west] |
---|
91 | d1 = [south, east] |
---|
92 | d2 = [north, east] |
---|
93 | d3 = [north, west] |
---|
94 | |
---|
95 | polyAll, zone = convert_points_from_latlon_to_utm([d0, d1, d2, d3]) |
---|
96 | refzone = zone |
---|
97 | |
---|
98 | #Interior region - Hobart city area + glenorchy, Kingston |
---|
99 | i0 = [517000, 5267000] |
---|
100 | i1 = [517000, 5255000] |
---|
101 | i2 = [520000, 5250000] |
---|
102 | i3 = [522000, 5239000] |
---|
103 | i4 = [524000, 5238000] |
---|
104 | i5 = [526000, 5236000] |
---|
105 | i6 = [530000, 5244000] |
---|
106 | i7 = [530000, 5250000] |
---|
107 | i7 = [534000, 5254000] |
---|
108 | i7 = [520000, 5270000] |
---|
109 | |
---|
110 | poly_hobart = [i0, i1, i2, i3, i4, i5] |
---|
111 | |
---|
112 | # Tasman Peninsula |
---|
113 | l0 = [550000, 5247000] |
---|
114 | l1 = [550000, 5211000] |
---|
115 | l2 = [583000, 5211000] |
---|
116 | l3 = [583000, 5247000] |
---|
117 | |
---|
118 | poly_tasman_peninsula = [l0, l1, l2, l3] |
---|
119 | |
---|
120 | # Bruny Island |
---|
121 | from anuga.utilities.polygon import read_polygon |
---|
122 | poly_bruny = read_polygon(polygondir+'bruny.csv') |
---|