[3627] | 1 | """Common filenames and locations for topographic data, meshes and outputs. |
---|
| 2 | """ |
---|
| 3 | |
---|
[3802] | 4 | import sys |
---|
[3627] | 5 | from os import sep, environ, getenv, getcwd |
---|
| 6 | from os.path import expanduser, basename |
---|
[3802] | 7 | |
---|
[3627] | 8 | from anuga.coordinate_transforms.redfearn import\ |
---|
| 9 | degminsec2decimal_degrees,\ |
---|
[3744] | 10 | convert_from_latlon_to_utm |
---|
[3627] | 11 | |
---|
| 12 | from time import localtime, strftime |
---|
| 13 | from anuga.geospatial_data.geospatial_data import * |
---|
| 14 | |
---|
[3828] | 15 | # file and system info |
---|
| 16 | #--------------------------------- |
---|
[3627] | 17 | codename = 'project.py' |
---|
| 18 | |
---|
| 19 | home = getenv('INUNDATIONHOME') #Sandpit's parent dir |
---|
| 20 | |
---|
| 21 | if sys.platform == 'win32': |
---|
| 22 | user = getenv('USERPROFILE') |
---|
| 23 | else: |
---|
| 24 | user = getenv('LOGNAME') |
---|
| 25 | |
---|
[3669] | 26 | # INUNDATIONHOME is the inundation directory, not the data directory. |
---|
| 27 | home += sep +'data' |
---|
[3828] | 28 | #---------------------------------- |
---|
| 29 | # Location and naming of scenario data |
---|
| 30 | #---------------------------------- |
---|
| 31 | state = 'western_australia' |
---|
| 32 | scenario_name = 'dampier_tsunami' |
---|
| 33 | scenario_datas_name = 'dampier_tsunami_scenario_2006' #name of the directory where the data is stored |
---|
| 34 | #scenario_datas_name = 'karratha_tsunami_scenario_2005' # Tmp location |
---|
[3627] | 35 | |
---|
[3828] | 36 | #mesh_name = 'elevation50m' |
---|
[3851] | 37 | boundaries_name = 'dampier' |
---|
[3877] | 38 | boundaries_source = 'mag_9_corrected' |
---|
[3828] | 39 | |
---|
[3877] | 40 | tide = 2.4 |
---|
[3871] | 41 | |
---|
[3828] | 42 | # topography file names |
---|
| 43 | onshore_name = 'dli_no_islands' |
---|
| 44 | coast_name = 'DTED_05_Contour' |
---|
| 45 | islands_name = 'dted_islands' |
---|
| 46 | offshore_name = 'XY100003902' |
---|
| 47 | offshore_name1 = 'XY100003903' |
---|
| 48 | offshore_name2 = 'XY100003951' |
---|
| 49 | offshore_name3 = 'XY100006321' |
---|
| 50 | offshore_name4 = 'XY100011756' |
---|
| 51 | offshore_name5 = 'XY100014243' |
---|
| 52 | offshore_name6 = 'XY100014244' |
---|
| 53 | offshore_name7 = 'XY100021081' |
---|
| 54 | offshore_name8 = 'XY100021082' |
---|
| 55 | offshore_name9 = 'XY100021083' |
---|
| 56 | offshore_name10 = 'XY100021085' |
---|
| 57 | offshore_name11 = 'XY100021086' |
---|
| 58 | offshore_name12 = 'XY100026309' |
---|
| 59 | offshore_name13 = 'XY100026338' |
---|
| 60 | offshore_name14 = 'XYDM83' |
---|
| 61 | |
---|
| 62 | combined_name ='dampier_combined_elevation' |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | |
---|
[3627] | 66 | #Derive subdirectories and filenames |
---|
[3828] | 67 | |
---|
| 68 | meshes_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'meshes'+sep |
---|
| 69 | topographies_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'topographies'+sep |
---|
| 70 | gauges_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'gauges'+sep |
---|
| 71 | polygons_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'polygons'+sep |
---|
[3851] | 72 | boundaries_in_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+boundaries_source+sep |
---|
[3828] | 73 | #outputdir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'output'+sep |
---|
| 74 | tide_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'tide_data'+sep |
---|
| 75 | |
---|
[3627] | 76 | time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
[3851] | 77 | build_time = time+'_build' |
---|
| 78 | run_time = time+'_run' |
---|
[3627] | 79 | |
---|
[3851] | 80 | output_build_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep+build_time+sep |
---|
| 81 | output_run_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep+run_time+sep |
---|
| 82 | topographies_time_dir = topographies_dir+build_time+sep |
---|
| 83 | boundaries_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'boundaries'+sep |
---|
| 84 | boundaries_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'boundaries'+sep+build_time+sep |
---|
[3627] | 85 | |
---|
[3851] | 86 | #ideas |
---|
| 87 | #boundaries_time_dir = boundaries_in_dir+'urs'+sep+boundaries_source+sep |
---|
[3828] | 88 | |
---|
| 89 | |
---|
[3627] | 90 | #gauge_filename = gaugedir + 'gauge_location_broome.csv' |
---|
| 91 | |
---|
[3828] | 92 | onshore_dir_name = topographies_dir + onshore_name |
---|
| 93 | coast_dir_name = topographies_dir + coast_name |
---|
| 94 | islands_dir_name = topographies_dir + islands_name |
---|
| 95 | offshore_dir_name = topographies_dir + offshore_name |
---|
| 96 | offshore_dir_name1 = topographies_dir + offshore_name1 |
---|
| 97 | offshore_dir_name2 = topographies_dir + offshore_name2 |
---|
| 98 | offshore_dir_name3 = topographies_dir + offshore_name3 |
---|
| 99 | offshore_dir_name4 = topographies_dir + offshore_name4 |
---|
| 100 | offshore_dir_name5 = topographies_dir + offshore_name5 |
---|
| 101 | offshore_dir_name6 = topographies_dir + offshore_name6 |
---|
| 102 | offshore_dir_name7 = topographies_dir + offshore_name7 |
---|
| 103 | offshore_dir_name8 = topographies_dir + offshore_name8 |
---|
| 104 | offshore_dir_name9 = topographies_dir + offshore_name9 |
---|
| 105 | offshore_dir_name10 = topographies_dir + offshore_name10 |
---|
| 106 | offshore_dir_name11 = topographies_dir + offshore_name11 |
---|
| 107 | offshore_dir_name12 = topographies_dir + offshore_name12 |
---|
| 108 | offshore_dir_name13 = topographies_dir + offshore_name13 |
---|
| 109 | offshore_dir_name14 = topographies_dir + offshore_name14 |
---|
[3627] | 110 | |
---|
[3851] | 111 | #output dir |
---|
[3828] | 112 | combined_dir_name = topographies_dir + combined_name |
---|
[3851] | 113 | combined_time_dir_name = topographies_time_dir + combined_name |
---|
[3627] | 114 | |
---|
[3851] | 115 | meshes_dir_name = meshes_dir + scenario_name |
---|
[3828] | 116 | |
---|
[3851] | 117 | #output_build_time_dir_name = output_build_time_dir + scenario_name #Used by post processing |
---|
| 118 | output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing |
---|
| 119 | boundaries_in_dir_name = boundaries_in_dir + boundaries_name |
---|
| 120 | boundaries_time_dir_name = boundaries_time_dir + boundaries_name #Used by post processing |
---|
[3828] | 121 | |
---|
[3851] | 122 | |
---|
| 123 | |
---|
| 124 | |
---|
[3627] | 125 | # Regions |
---|
| 126 | |
---|
| 127 | refzone = 50 |
---|
| 128 | south = degminsec2decimal_degrees(-20,55,0) |
---|
[3835] | 129 | north = degminsec2decimal_degrees(-20,15,0) |
---|
[3851] | 130 | #north = degminsec2decimal_degrees(-19,15,0) |
---|
[3627] | 131 | west = degminsec2decimal_degrees(116,17,0) |
---|
[3836] | 132 | east = degminsec2decimal_degrees(117,10,0) |
---|
[3627] | 133 | |
---|
[3828] | 134 | #only used to clip boundary condition |
---|
[3877] | 135 | north_boundary = north + 0.02 |
---|
| 136 | south_boundary = south - 0.02 |
---|
| 137 | west_boundary = west - 0.02 |
---|
| 138 | east_boundary = east + 0.02 |
---|
[3828] | 139 | |
---|
| 140 | |
---|
[3627] | 141 | p0 = [south, degminsec2decimal_degrees(116,32,0)] |
---|
| 142 | p1 = [south, west] |
---|
| 143 | p2 = [degminsec2decimal_degrees(-20,23,0), west] |
---|
| 144 | p3 = [north, degminsec2decimal_degrees(116,45,0)] |
---|
| 145 | p4 = [north, degminsec2decimal_degrees(117,0,0)] |
---|
| 146 | p5 = [p2[0], degminsec2decimal_degrees(117,8,0)] |
---|
| 147 | p6 = [degminsec2decimal_degrees(-20,30,0), east] |
---|
| 148 | p7 = [degminsec2decimal_degrees(-20,38,0), east] |
---|
| 149 | p8 = [south, east] |
---|
| 150 | |
---|
[3716] | 151 | bounding_polygon, zone =\ |
---|
[3744] | 152 | convert_from_latlon_to_utm([p0, p1, p2, p3, p4, |
---|
| 153 | p5, p6, p7, p8]) |
---|
[3627] | 154 | refzone = zone |
---|
| 155 | |
---|
| 156 | |
---|
[3716] | 157 | #Interior regions |
---|
[3744] | 158 | |
---|
| 159 | # CIPMA point of interest |
---|
| 160 | cipma_latitude = -20.588456 |
---|
| 161 | cipma_longitude = 116.771527 |
---|
| 162 | |
---|
| 163 | |
---|
| 164 | k0 = [cipma_latitude-0.02, cipma_longitude-0.02] |
---|
| 165 | k1 = [cipma_latitude-0.02, cipma_longitude+0.02] |
---|
| 166 | k2 = [cipma_latitude+0.02, cipma_longitude+0.02] |
---|
| 167 | k3 = [cipma_latitude+0.02, cipma_longitude-0.02] |
---|
| 168 | |
---|
| 169 | cipma_polygon, zone = convert_from_latlon_to_utm([k0, k1, k2, k3]) |
---|
| 170 | assert zone == refzone |
---|
| 171 | |
---|
[3828] | 172 | e_min_area = 474000 |
---|
| 173 | e_max_area = 480000 |
---|
| 174 | n_min_area = 7719000 |
---|
| 175 | n_max_area = 7725000 |
---|
[3744] | 176 | |
---|
| 177 | #Interior regions |
---|
[3627] | 178 | karratha_south = degminsec2decimal_degrees(-20,44,0) |
---|
| 179 | karratha_north = degminsec2decimal_degrees(-20,42,0) |
---|
| 180 | karratha_west = degminsec2decimal_degrees(116,48,0) |
---|
| 181 | karratha_east = degminsec2decimal_degrees(116,53,30) |
---|
| 182 | |
---|
| 183 | k0 = [karratha_south, karratha_west] |
---|
| 184 | k1 = [karratha_south, karratha_east] |
---|
| 185 | k2 = [karratha_north, karratha_east] |
---|
| 186 | k3 = [karratha_north, karratha_west] |
---|
| 187 | |
---|
[3744] | 188 | karratha_polygon, zone = convert_from_latlon_to_utm([k0, k1, k2, k3]) |
---|
[3716] | 189 | assert zone == refzone |
---|
[3627] | 190 | |
---|
| 191 | |
---|
| 192 | #Interior regions |
---|
| 193 | dampier_south = degminsec2decimal_degrees(-20,40,0) |
---|
| 194 | dampier_north = degminsec2decimal_degrees(-20,38,10) |
---|
| 195 | dampier_west = degminsec2decimal_degrees(116,43,0) |
---|
| 196 | dampier_east = degminsec2decimal_degrees(116,45,0) |
---|
| 197 | |
---|
| 198 | d0 = [dampier_south, dampier_west] |
---|
| 199 | d1 = [dampier_south, dampier_east] |
---|
| 200 | d2 = [dampier_north, dampier_east] |
---|
| 201 | d3 = [dampier_north, dampier_west] |
---|
| 202 | |
---|
[3744] | 203 | dampier_polygon, zone = convert_from_latlon_to_utm([d0, d1, d2, d3]) |
---|
[3716] | 204 | assert zone == refzone |
---|
[3627] | 205 | |
---|
| 206 | |
---|
| 207 | #Interior regions |
---|
| 208 | refinery_south = degminsec2decimal_degrees(-20,37,50) |
---|
| 209 | refinery_north = degminsec2decimal_degrees(-20,36,0) |
---|
| 210 | refinery_west = degminsec2decimal_degrees(116,44,0) |
---|
| 211 | refinery_east = degminsec2decimal_degrees(116,46,10) |
---|
| 212 | |
---|
| 213 | d0 = [refinery_south, refinery_west] |
---|
| 214 | d1 = [refinery_south, refinery_east] |
---|
| 215 | d2 = [refinery_north, refinery_east] |
---|
| 216 | d3 = [refinery_north, refinery_west] |
---|
| 217 | |
---|
[3744] | 218 | refinery_polygon, zone = convert_from_latlon_to_utm([d0, d1, d2, d3]) |
---|
[3716] | 219 | assert zone == refzone |
---|
[3627] | 220 | |
---|
| 221 | |
---|
| 222 | #Interior region around 468899, 7715177: |
---|
| 223 | #lat (-20, 39, 44.93753), lon (116, 42, 5.09106) |
---|
| 224 | |
---|
| 225 | point_south = degminsec2decimal_degrees(-20,39,46) |
---|
| 226 | point_north = degminsec2decimal_degrees(-20,39,42) |
---|
| 227 | point_west = degminsec2decimal_degrees(116,42,0) |
---|
| 228 | point_east = degminsec2decimal_degrees(116,42,10) |
---|
| 229 | |
---|
| 230 | d0 = [point_south, point_west] |
---|
| 231 | d1 = [point_south, point_east] |
---|
| 232 | d2 = [point_north, point_east] |
---|
| 233 | d3 = [point_north, point_west] |
---|
| 234 | |
---|
[3744] | 235 | point_polygon, zone = convert_from_latlon_to_utm([d0, d1, d2, d3]) |
---|
[3716] | 236 | assert zone == refzone |
---|
[3627] | 237 | |
---|
| 238 | |
---|
| 239 | #Neils areas around interesting points |
---|
| 240 | neil1_point1 = [degminsec2decimal_degrees(-20,35,34), |
---|
| 241 | degminsec2decimal_degrees(116,45,18)] |
---|
| 242 | neil1_point2 = [degminsec2decimal_degrees(-20,36,15), |
---|
| 243 | degminsec2decimal_degrees(116,46,18)] |
---|
| 244 | neil1_point3 = [degminsec2decimal_degrees(-20,35,9), |
---|
| 245 | degminsec2decimal_degrees(116,47,17)] |
---|
| 246 | neil1_point4 = [degminsec2decimal_degrees(-20,34,26), |
---|
| 247 | degminsec2decimal_degrees(116,46,17)] |
---|
| 248 | |
---|
[3744] | 249 | neil1_polygon, zone = convert_from_latlon_to_utm([neil1_point1, |
---|
| 250 | neil1_point2, |
---|
| 251 | neil1_point3, |
---|
| 252 | neil1_point4]) |
---|
[3716] | 253 | assert zone == refzone |
---|
[3627] | 254 | |
---|
| 255 | |
---|
| 256 | |
---|
[3716] | 257 | |
---|
[3627] | 258 | neil2_point1 = [degminsec2decimal_degrees(-20,39,36), |
---|
| 259 | degminsec2decimal_degrees(116,41,33)] |
---|
| 260 | neil2_point2 = [degminsec2decimal_degrees(-20,40,10), |
---|
| 261 | degminsec2decimal_degrees(116,42,13)] |
---|
| 262 | neil2_point3 = [degminsec2decimal_degrees(-20,38,39), |
---|
| 263 | degminsec2decimal_degrees(116,43,49)] |
---|
| 264 | neil2_point4 = [degminsec2decimal_degrees(-20,38,5), |
---|
| 265 | degminsec2decimal_degrees(116,43,9)] |
---|
| 266 | |
---|
[3744] | 267 | neil2_polygon, zone = convert_from_latlon_to_utm([neil2_point1, |
---|
| 268 | neil2_point2, |
---|
| 269 | neil2_point3, |
---|
| 270 | neil2_point4]) |
---|
[3716] | 271 | assert zone == refzone |
---|
[3627] | 272 | |
---|
| 273 | |
---|
| 274 | |
---|
| 275 | |
---|
[3716] | 276 | |
---|
[3627] | 277 | #Withnell bay |
---|
| 278 | wb_point1 = [degminsec2decimal_degrees(-20,35,34), |
---|
| 279 | degminsec2decimal_degrees(116,45,18)] |
---|
| 280 | wb_point2 = [degminsec2decimal_degrees(-20,36,15), |
---|
| 281 | degminsec2decimal_degrees(116,46,18)] |
---|
| 282 | wb_point3 = [degminsec2decimal_degrees(-20,35,9), |
---|
| 283 | degminsec2decimal_degrees(116,47,17)] |
---|
| 284 | wb_point4 = [degminsec2decimal_degrees(-20,34,26), |
---|
| 285 | degminsec2decimal_degrees(116,46,17)] |
---|
| 286 | |
---|
[3744] | 287 | wb_polygon, zone = convert_from_latlon_to_utm([wb_point1, wb_point2, |
---|
| 288 | wb_point3, wb_point4]) |
---|
[3716] | 289 | assert zone == refzone |
---|
[3627] | 290 | |
---|
| 291 | |
---|
| 292 | |
---|
| 293 | |
---|
[3716] | 294 | |
---|
[3627] | 295 | #Larger Withnell bay |
---|
| 296 | lwb_point1 = [degminsec2decimal_degrees(-20,35,59), |
---|
| 297 | degminsec2decimal_degrees(116,42,00)] |
---|
| 298 | lwb_point2 = [degminsec2decimal_degrees(-20,36,50), |
---|
| 299 | degminsec2decimal_degrees(116,46,50)] |
---|
| 300 | lwb_point3 = [degminsec2decimal_degrees(-20,34,00), |
---|
| 301 | degminsec2decimal_degrees(116,47,39)] |
---|
| 302 | lwb_point4 = [degminsec2decimal_degrees(-20,33,00), |
---|
| 303 | degminsec2decimal_degrees(116,42,50)] |
---|
| 304 | |
---|
[3744] | 305 | lwb_polygon, zone = convert_from_latlon_to_utm([lwb_point1, lwb_point2, |
---|
| 306 | lwb_point3, lwb_point4]) |
---|
[3716] | 307 | |
---|
| 308 | assert zone == refzone |
---|
[3627] | 309 | |
---|
| 310 | |
---|
| 311 | |
---|
[3716] | 312 | |
---|