[3559] | 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 |
---|
[3650] | 15 | #onshore_name = 'hob3_topo' # original |
---|
| 16 | onshore_name = 'hob5_topo' # 12.5m grid and clipped to 100m elevation or 3000m from coast |
---|
[3661] | 17 | #onshore_name_25 = 'hob5_topo_25m' # 25m grid and clipped to 100m elevation or 3000m from coast |
---|
| 18 | onshore_name_25 = 'hob6_topo_25m' # 25m grid NOT clipped |
---|
[3626] | 19 | offshore_name_tas1 = 'derwent_2m' |
---|
| 20 | offshore_name_tas2 = 'derwent_5m' |
---|
[3650] | 21 | offshore_name_tas3 = 'south_east_tas' #actually this is AHO |
---|
[3626] | 22 | offshore_name_tas4 = 'hobart_1m' |
---|
[3559] | 23 | |
---|
[3626] | 24 | # AHO data and checked by NM&I |
---|
| 25 | offshore_name1 = 'xy100003760' |
---|
| 26 | offshore_name2 = 'xy100003761' |
---|
| 27 | offshore_name3 = 'xy100003762' |
---|
| 28 | offshore_name4 = 'xy100003907' |
---|
| 29 | offshore_name5 = 'xy100003908' |
---|
| 30 | offshore_name6 = 'xy100003909' |
---|
| 31 | offshore_name7 = 'xy100003910' |
---|
| 32 | offshore_name8 = 'xy100003932' |
---|
| 33 | offshore_name9 = 'xy100003933' |
---|
| 34 | offshore_name10 = 'xy100003934' |
---|
| 35 | offshore_name11 = 'xy100003935' |
---|
| 36 | offshore_name12 = 'xy100003936' |
---|
| 37 | offshore_name13 = 'xy100003964' |
---|
| 38 | offshore_name14 = 'xy100014250' |
---|
| 39 | offshore_name15 = 'xy100014253' |
---|
| 40 | offshore_name16 = 'xy100016142' |
---|
| 41 | |
---|
[3559] | 42 | # developed by NM&I |
---|
[3626] | 43 | coast_name = 'coastline_points' |
---|
[3559] | 44 | |
---|
| 45 | boundary_basename = 'SU-AU_clip' |
---|
| 46 | |
---|
| 47 | #swollen/ all data output |
---|
| 48 | basename = 'source' |
---|
| 49 | |
---|
| 50 | codename = 'project.py' |
---|
| 51 | |
---|
| 52 | if sys.platform == 'win32': |
---|
| 53 | home = getenv('INUNDATIONHOME') |
---|
[3668] | 54 | user = getenv('USERPROFILE') |
---|
| 55 | |
---|
[3559] | 56 | else: |
---|
[3668] | 57 | home = getenv('INUNDATIONHOME', sep+'d'+sep+'xrd'+sep+'gem'+sep+'2'+sep+'ramp'+sep+'risk_assessment_methods_project'+sep+'inundation') |
---|
[3559] | 58 | user = getenv('LOGNAME') |
---|
| 59 | print 'USER:', user |
---|
| 60 | |
---|
[3668] | 61 | # INUNDATIONHOME is the inundation directory, not the data directory. |
---|
| 62 | home += sep +'data' |
---|
| 63 | |
---|
[3559] | 64 | #Derive subdirectories and filenames |
---|
| 65 | #time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
| 66 | local_time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir |
---|
[3669] | 67 | print 'home', home |
---|
[3559] | 68 | meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep |
---|
| 69 | datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep |
---|
| 70 | gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep |
---|
| 71 | polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep |
---|
[3669] | 72 | boundarydir = home+sep+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep |
---|
[3559] | 73 | #output dir without time |
---|
| 74 | outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep |
---|
| 75 | outputtimedir = outputdir + local_time + sep |
---|
| 76 | polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep |
---|
| 77 | |
---|
| 78 | gauge_filename = gaugedir + 'hobart_gauges.xya' |
---|
| 79 | buildings_filename = gaugedir + 'hobart_res.csv' |
---|
| 80 | buildings_filename_damage_out = 'hobart_res_modified.csv' |
---|
| 81 | |
---|
| 82 | gaugetimeseries = gaugedir + 'hobart' |
---|
| 83 | |
---|
| 84 | # boundary source data |
---|
| 85 | #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 |
---|
| 86 | |
---|
| 87 | codedir = getcwd()+sep |
---|
| 88 | |
---|
| 89 | codedirname = codedir + 'project.py' |
---|
| 90 | |
---|
| 91 | meshname = outputtimedir + 'mesh_' + basename |
---|
| 92 | |
---|
| 93 | onshore_dem_name = datadir + onshore_name |
---|
[3650] | 94 | onshore_dem_name_25 = datadir + onshore_name_25 |
---|
| 95 | all_onshore_dem_name = datadir + 'combined_onshore' |
---|
[3626] | 96 | offshore_dem_name_local1 = datadir + offshore_name_tas1 |
---|
| 97 | offshore_dem_name_local2 = datadir + offshore_name_tas2 |
---|
| 98 | offshore_dem_name_local3 = datadir + offshore_name_tas3 |
---|
| 99 | offshore_dem_name_local4 = datadir + offshore_name_tas4 |
---|
| 100 | offshore_dem_name_aho1 = datadir + offshore_name1 |
---|
| 101 | offshore_dem_name_aho2 = datadir + offshore_name2 |
---|
| 102 | offshore_dem_name_aho3 = datadir + offshore_name3 |
---|
| 103 | offshore_dem_name_aho4 = datadir + offshore_name4 |
---|
| 104 | offshore_dem_name_aho5 = datadir + offshore_name5 |
---|
| 105 | offshore_dem_name_aho6 = datadir + offshore_name6 |
---|
| 106 | offshore_dem_name_aho7 = datadir + offshore_name7 |
---|
| 107 | offshore_dem_name_aho8 = datadir + offshore_name8 |
---|
| 108 | offshore_dem_name_aho9 = datadir + offshore_name9 |
---|
| 109 | offshore_dem_name_aho10 = datadir + offshore_name10 |
---|
| 110 | offshore_dem_name_aho11 = datadir + offshore_name11 |
---|
| 111 | offshore_dem_name_aho12 = datadir + offshore_name12 |
---|
| 112 | offshore_dem_name_aho13 = datadir + offshore_name13 |
---|
| 113 | offshore_dem_name_aho14 = datadir + offshore_name14 |
---|
| 114 | offshore_dem_name_aho15 = datadir + offshore_name15 |
---|
| 115 | offshore_dem_name_aho16 = datadir + offshore_name16 |
---|
[3559] | 116 | coast_dem_name = datadir + coast_name |
---|
| 117 | combined_dem_name = datadir + 'hobart_combined_elevation' |
---|
| 118 | |
---|
| 119 | outputname = outputtimedir + basename #Used by post processing |
---|
| 120 | |
---|
[3650] | 121 | # clipping 12.5m onshore data set |
---|
| 122 | eastingmin = 520000 |
---|
| 123 | eastingmax = 536000 |
---|
| 124 | northingmin = 5245000 |
---|
[3667] | 125 | northingmax = 5265000 |
---|
| 126 | # clipping 25m onshore data set |
---|
| 127 | eastingmin25 = 520000 |
---|
| 128 | eastingmax25 = 580000 |
---|
| 129 | northingmin25 = 5170000 |
---|
| 130 | northingmax25 = 5260000 |
---|
[3650] | 131 | |
---|
| 132 | # region to export for inundation map |
---|
[3667] | 133 | e_min_area = 521000#490000 |
---|
| 134 | e_max_area = 522000#580000 |
---|
| 135 | n_min_area = 5190000#5160000 |
---|
| 136 | n_max_area = 5200000#5275000 |
---|
[3559] | 137 | |
---|
[3626] | 138 | from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_points_from_latlon_to_utm |
---|
[3615] | 139 | |
---|
[3559] | 140 | # bounding box |
---|
| 141 | south = degminsec2decimal_degrees(-43,45,0) |
---|
| 142 | north = degminsec2decimal_degrees(-42,30,0) |
---|
| 143 | west = degminsec2decimal_degrees(146,45,0) |
---|
[3667] | 144 | east = degminsec2decimal_degrees(148,0,0)#degminsec2decimal_degrees(148,15,0) |
---|
[3559] | 145 | |
---|
[3615] | 146 | #Main Domain of Hobart: first run JS 18/9/06 |
---|
| 147 | d0 = [south, west] |
---|
| 148 | d1 = [south, east] |
---|
| 149 | d2 = [north, east] |
---|
| 150 | d3 = [north, west] |
---|
[3559] | 151 | |
---|
[3615] | 152 | polyAll, zone = convert_points_from_latlon_to_utm([d0, d1, d2, d3]) |
---|
[3559] | 153 | refzone = zone |
---|
[3667] | 154 | #polyAll = [[500000, 5200000],[580000, 5200000],[580000, 5270000],[500000,5270000]] #073937 |
---|
| 155 | #polyAll = [[500000, 5160000],[580000, 5160000],[580000, 5270000],[500000,5270000]] # try this is the above works |
---|
| 156 | #polyAll = [[510000, 5170000],[570000, 5170000],[570000, 5250000],[510000,5250000]] # try this is the above works |
---|
| 157 | #polyAll = [[520000, 5160000],[580000, 5170000],[580000, 5200000],[600000,5260000],[510000,5280000]] # try this is the above works |
---|
| 158 | polyAll = [[520000, 5170000],[580000, 5170000],[580000, 5200000],[590000,5240000],[520000,5260000]] # try this is the above works |
---|
| 159 | # bottom bright, topr, top, left |
---|
[3559] | 160 | |
---|
[3650] | 161 | # region to export for Alex to make bathymetry map |
---|
[3667] | 162 | e_min_area = 560000#500000 #490000 |
---|
| 163 | e_max_area = 570000#560000 #580000 |
---|
| 164 | n_min_area = 5200000#5240000#5160000 |
---|
| 165 | n_max_area = 5230000#5260000#5270000 |
---|
[3650] | 166 | |
---|
[3626] | 167 | #Interior region - Hobart city area + Glenorchy, Kingston |
---|
[3615] | 168 | i0 = [517000, 5267000] |
---|
| 169 | i1 = [517000, 5255000] |
---|
| 170 | i2 = [520000, 5250000] |
---|
| 171 | i3 = [522000, 5239000] |
---|
| 172 | i4 = [524000, 5238000] |
---|
| 173 | i5 = [526000, 5236000] |
---|
| 174 | i6 = [530000, 5244000] |
---|
| 175 | i7 = [530000, 5250000] |
---|
[3626] | 176 | i8 = [534000, 5254000] |
---|
| 177 | i9 = [520000, 5270000] |
---|
[3559] | 178 | |
---|
[3626] | 179 | poly_hobart = [i0, i1, i2, i3, i4, i5, i6, i7, i8, i9] |
---|
[3559] | 180 | |
---|
[3615] | 181 | # Tasman Peninsula |
---|
| 182 | l0 = [550000, 5247000] |
---|
| 183 | l1 = [550000, 5211000] |
---|
| 184 | l2 = [583000, 5211000] |
---|
| 185 | l3 = [583000, 5247000] |
---|
[3559] | 186 | |
---|
[3615] | 187 | poly_tasman_peninsula = [l0, l1, l2, l3] |
---|
[3559] | 188 | |
---|
| 189 | # Bruny Island |
---|
[3615] | 190 | from anuga.utilities.polygon import read_polygon |
---|
| 191 | poly_bruny = read_polygon(polygondir+'bruny.csv') |
---|