[5634] | 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 | from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon |
---|
| 10 | |
---|
| 11 | if sys.platform == 'win32': |
---|
| 12 | home = getenv('INUNDATIONHOME') |
---|
| 13 | user = getenv('USERPROFILE') |
---|
| 14 | |
---|
| 15 | else: |
---|
| 16 | home = getenv('INUNDATIONHOME', sep+'d'+sep+'xrd'+sep+'gem'+sep+'2'+sep+'ramp'+sep+'risk_assessment_methods_project'+sep+'inundation') |
---|
| 17 | user = getenv('LOGNAME') |
---|
| 18 | print 'USER:', user |
---|
| 19 | |
---|
| 20 | # INUNDATIONHOME is the inundation directory, not the data directory. |
---|
| 21 | home += sep +'data' |
---|
| 22 | |
---|
| 23 | #Making assumptions about the location of scenario data |
---|
| 24 | state = 'new_south_wales' |
---|
| 25 | scenario_dir_name = 'sydney_tsunami_scenario_2006' |
---|
| 26 | |
---|
| 27 | # onshore data provided by NSW LPI, Krishna merged with existing |
---|
| 28 | # PMD data to make 100m DEM |
---|
| 29 | on_offshore_name25 = 'bathy_dem25' |
---|
| 30 | on_offshore_name100 = 'bathyland100' |
---|
| 31 | nsw100 = 'dem_utm' |
---|
| 32 | |
---|
| 33 | # survey data |
---|
| 34 | offshore_name1 = 'surveyAreaA' |
---|
| 35 | offshore_name2 = 'surveyAreaB' |
---|
| 36 | offshore_name3 = 'surveyAreaC' |
---|
| 37 | |
---|
| 38 | # AHO data |
---|
| 39 | offshore_name4 = '1000003611export' |
---|
| 40 | offshore_name5 = '1000003613export' |
---|
| 41 | offshore_name6 = '1000003614export' |
---|
| 42 | offshore_name7 = '1000003627export' |
---|
| 43 | offshore_name8 = '1000003628export' |
---|
| 44 | offshore_name9 = 'AHDexport' |
---|
| 45 | |
---|
| 46 | #swollen/ all data output |
---|
| 47 | basename = 'source' |
---|
| 48 | codename = 'project_slide.py' |
---|
| 49 | |
---|
| 50 | #Derive subdirectories and filenames |
---|
| 51 | local_time = strftime('%Y%m%d_%H%M%S',gmtime()) |
---|
| 52 | meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep |
---|
| 53 | datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep |
---|
| 54 | gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep |
---|
| 55 | polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep |
---|
| 56 | boundarydir = home+sep+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep |
---|
| 57 | outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep |
---|
| 58 | outputtimedir = outputdir + local_time + sep |
---|
| 59 | polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep |
---|
| 60 | |
---|
| 61 | gauge_filename = gaugedir + 'sydney_slide_gauges.csv' |
---|
| 62 | codedir = getcwd()+sep |
---|
| 63 | codedirname = codedir + 'project_slide.py' |
---|
| 64 | meshname = outputtimedir + 'mesh_' + basename |
---|
| 65 | |
---|
| 66 | # Necessary if using point datasets, rather than grid |
---|
| 67 | on_offshore25_dem_name = datadir + on_offshore_name25 |
---|
| 68 | on_offshore100_dem_name = datadir + on_offshore_name100 |
---|
| 69 | nsw_dem_name = datadir + nsw100 |
---|
| 70 | offshore_dem_name1 = datadir + offshore_name1 |
---|
| 71 | offshore_dem_name2 = datadir + offshore_name2 |
---|
| 72 | offshore_dem_name3 = datadir + offshore_name3 |
---|
| 73 | offshore_dem_name4 = datadir + offshore_name4 |
---|
| 74 | offshore_dem_name5 = datadir + offshore_name5 |
---|
| 75 | offshore_dem_name6 = datadir + offshore_name6 |
---|
| 76 | offshore_dem_name7 = datadir + offshore_name7 |
---|
| 77 | offshore_dem_name8 = datadir + offshore_name8 |
---|
| 78 | offshore_dem_name9 = datadir + offshore_name9 |
---|
| 79 | combined_dem_name = datadir + 'sydney_combined_elevation' |
---|
| 80 | |
---|
| 81 | ############################### |
---|
| 82 | # Domain definitions |
---|
| 83 | ############################### |
---|
| 84 | |
---|
| 85 | # bounding polygon for study area |
---|
| 86 | polyAll = read_polygon(polygondir+'extent3.csv') |
---|
| 87 | |
---|
| 88 | print 'Area of bounding polygon', polygon_area(polyAll)/1000000.0 |
---|
| 89 | |
---|
| 90 | ############################### |
---|
| 91 | # Interior region definitions |
---|
| 92 | ############################### |
---|
| 93 | |
---|
| 94 | # sydney digitized polygons |
---|
| 95 | poly_coast = read_polygon(polygondir+'coast2.csv') |
---|
| 96 | poly_syd1 = read_polygon(polygondir+'local.csv') |
---|
| 97 | |
---|
| 98 | print 'Area of local polygon', polygon_area(poly_syd1)/1000000.0 |
---|
| 99 | print 'Area of coastal polygon', polygon_area(poly_coast)/1000000.0 |
---|
| 100 | |
---|
| 101 | ################################################################### |
---|
| 102 | # Clipping regions for export to asc and regions for clipping data |
---|
| 103 | ################################################################### |
---|
| 104 | |
---|
| 105 | # clipping for 25m grid for conversion |
---|
| 106 | eastingmin25 = 324825 |
---|
| 107 | eastingmax25 = 347650 |
---|
| 108 | northingmin25 = 6231960 |
---|
| 109 | northingmax25 = 6272543 |
---|
| 110 | |
---|
| 111 | poly_25mclip = read_polygon(polygondir+'25mclip.csv') |
---|
| 112 | |
---|
| 113 | # clipping for 100m grid for conversion |
---|
| 114 | eastingmin100 = 315870 |
---|
| 115 | eastingmax100 = 361607 |
---|
| 116 | northingmin100 = 6227588 |
---|
| 117 | northingmax100 = 6285975 |
---|
| 118 | |
---|
| 119 | poly_surveyclip = read_polygon(polygondir+'surveyclip.csv') |
---|
| 120 | |
---|
| 121 | # clipping for nsw grid for conversion |
---|
| 122 | eastingmin_nsw = 315870 |
---|
| 123 | eastingmax_nsw = 390480 |
---|
| 124 | northingmin_nsw = 6161100 |
---|
| 125 | northingmax_nsw = 6330000 |
---|
| 126 | |
---|
| 127 | poly_origsyd = [[eastingmin100,northingmin100],[eastingmax100,northingmin100],\ |
---|
| 128 | [eastingmax100,northingmax100],[eastingmin100,northingmax100]] |
---|
| 129 | |
---|
| 130 | # exporting asc grid |
---|
| 131 | eastingmin = 333000 |
---|
| 132 | eastingmax = 354000 |
---|
| 133 | northingmin = 6244800 |
---|
| 134 | northingmax = 6274550 |
---|
| 135 | |
---|
| 136 | # exporting asc grid |
---|
| 137 | eastingmin = 318922+10000 |
---|
| 138 | eastingmax = 318922+45000 |
---|
| 139 | northingmin = 6231749+7500 |
---|
| 140 | northingmax = 6231749+48000 |
---|
| 141 | |
---|
| 142 | #eastingmin = -40 |
---|
| 143 | #eastingmax = 40 |
---|
| 144 | #northingmin = -20 |
---|
| 145 | #northingmax = 20 |
---|
| 146 | |
---|
| 147 | ################################################################### |
---|
| 148 | # Slide characteristics |
---|
| 149 | ################################################################### |
---|
| 150 | |
---|
| 151 | # historical slides |
---|
| 152 | slide_origin_bulli = [370110,6189489] |
---|
| 153 | slide_origin_shovel = [354753,6187397] |
---|
| 154 | #slide_origin_yacaaba = [463012,6334735] original work was actually Birubi |
---|
| 155 | slide_origin_yacaaba = [476465, 6362424] |
---|
| 156 | slide_origin_birubi = [462267,6335100] |
---|
| 157 | |
---|
| 158 | # potential slides: these correspond approximately to modelled depths |
---|
| 159 | slide_origin_bulli_b = [405617,6249852] |
---|
| 160 | slide_origin_bulli_c0 = [438583,6308510] |
---|
| 161 | slide_origin_bulli_c1 = [465283,6335210] |
---|
| 162 | slide_origin_bulli_c2 = [483783,6358810] |
---|
| 163 | slide_origin_shovel_b = [396262,6252144] |
---|
| 164 | slide_origin_shovel_c0 = [431683,6311110] |
---|
| 165 | slide_origin_shovel_c1 = [458694,6340352] |
---|
| 166 | slide_origin_shovel_c2 = [475589,6363030] |
---|
| 167 | slide_origin_yacaaba_a = [359796,6190943] |
---|
| 168 | slide_origin_yacaaba_b = [397330,6251857] |
---|
| 169 | slide_origin_yacaaba_c0 = [431283,6312110] |
---|
| 170 | slide_origin_yacaaba_c1 = [459983,6339110] |
---|
| 171 | slide_origin_birubi_a = [362811,6191183] |
---|
| 172 | slide_origin_birubi_b = [403573,6250268] |
---|
| 173 | slide_origin_birubi_c0 = [437183,6309410] |
---|
| 174 | slide_origin_birubi_c2 = [483392,6359044] |
---|
| 175 | |
---|
| 176 | #bulli_depth = 2087.0 |
---|
| 177 | bulli_depth = 1470.0 |
---|
| 178 | bulli_length = 16840.0 |
---|
| 179 | bulli_thickness = 424.0 |
---|
| 180 | bulli_width = 8860.0 |
---|
| 181 | bulli_density = 1.46 |
---|
| 182 | bulli_slope = 4.0 |
---|
| 183 | bulli_alpha = 126.0 - 90.0 |
---|
| 184 | |
---|
| 185 | #shovel_depth = 968.0 |
---|
| 186 | shovel_depth = 877.0 |
---|
| 187 | shovel_length = 13500.0 |
---|
| 188 | shovel_thickness = 165.0 |
---|
| 189 | shovel_width = 4350.0 |
---|
| 190 | shovel_density = 1.49 |
---|
| 191 | shovel_slope = 4.0 |
---|
| 192 | shovel_alpha = 118.0 - 90.0 |
---|
| 193 | |
---|
| 194 | #yacaaba_depth = 1119.0 |
---|
| 195 | yacaaba_depth = 938. |
---|
| 196 | yacaaba_length = 4189. |
---|
| 197 | yacaaba_thickness = 53. |
---|
| 198 | yacaaba_width = 2898. |
---|
| 199 | yacaaba_density = 1.48 |
---|
| 200 | yacaaba_slope = 2.3 |
---|
| 201 | yacaaba_alpha = 133.0 - 90.0 |
---|
| 202 | |
---|
| 203 | birubi_depth = 1320. |
---|
| 204 | birubi_length = 9903.0 |
---|
| 205 | birubi_width = 4150. |
---|
| 206 | birubi_density = 1.48 |
---|
| 207 | birubi_slope = 3.7 |
---|
| 208 | birubi_alpha = 133.0 - 90.0 |
---|
| 209 | birubi_thickness = 140. |
---|