[5648] | 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 | |
---|
[5676] | 23 | # Bridgette to vary this parameter from 1 to 25 in steps of ? |
---|
[5677] | 24 | scale = 2.0 # None |
---|
[5676] | 25 | |
---|
[5648] | 26 | #Making assumptions about the location of scenario data |
---|
| 27 | state = 'new_south_wales' |
---|
| 28 | scenario_dir_name = 'wollongong_tsunami_scenario_2006' |
---|
| 29 | |
---|
| 30 | # onshore data provided by NSW LPI, Krishna merged with existing |
---|
| 31 | # PMD data to make 100m DEM |
---|
| 32 | on_offshore10_name = 'wollongong_10' |
---|
| 33 | nsw100 = 'dem_utm' |
---|
| 34 | |
---|
| 35 | # survey data |
---|
| 36 | offshore_name1 = 'surveyAreaA' |
---|
| 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 |
---|
[5676] | 58 | dir_comment = '_scale_' + str(scale) |
---|
| 59 | outputtimedir = outputdir + local_time + dir_comment + sep |
---|
[5648] | 60 | polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep |
---|
| 61 | |
---|
| 62 | #gauge_filename = gaugedir + 'gong_gauges.csv' |
---|
| 63 | gauge_filename = gaugedir + 'gauges.csv' |
---|
| 64 | codedir = getcwd()+sep |
---|
| 65 | codedirname = codedir + 'project_slide.py' |
---|
| 66 | meshname = outputtimedir + 'mesh_' + basename |
---|
| 67 | |
---|
| 68 | # Necessary if using point datasets, rather than grid |
---|
| 69 | on_offshore10_dem_name = datadir + on_offshore10_name |
---|
| 70 | nsw_dem_name = datadir + nsw100 |
---|
| 71 | offshore_dem_name1 = datadir + offshore_name1 |
---|
| 72 | offshore_dem_name4 = datadir + offshore_name4 |
---|
| 73 | offshore_dem_name5 = datadir + offshore_name5 |
---|
| 74 | offshore_dem_name6 = datadir + offshore_name6 |
---|
| 75 | offshore_dem_name7 = datadir + offshore_name7 |
---|
| 76 | offshore_dem_name8 = datadir + offshore_name8 |
---|
| 77 | offshore_dem_name9 = datadir + offshore_name9 |
---|
| 78 | combined_dem_name = datadir + 'gong_combined_elevation' |
---|
| 79 | |
---|
| 80 | ############################### |
---|
| 81 | # Domain definitions |
---|
| 82 | ############################### |
---|
| 83 | |
---|
| 84 | # bounding polygon for study area |
---|
| 85 | polyAll = read_polygon(polygondir+'extentA_up.csv') |
---|
| 86 | |
---|
| 87 | print 'Area of bounding polygon', polygon_area(polyAll)/1000000.0 |
---|
| 88 | |
---|
| 89 | ############################### |
---|
| 90 | # Interior region definitions |
---|
| 91 | ############################### |
---|
| 92 | |
---|
| 93 | # areaA digitized polygons |
---|
| 94 | poly_local = read_polygon(polygondir+'local2.csv') |
---|
| 95 | poly_gong = read_polygon(polygondir+'gong3.csv') |
---|
| 96 | poly_southgong = read_polygon(polygondir+'south_gong.csv') |
---|
| 97 | |
---|
| 98 | print 'Area of local polygon', polygon_area(poly_local)/1000000.0 |
---|
| 99 | |
---|
| 100 | ################################################################### |
---|
| 101 | # Clipping regions for export to asc and regions for clipping data |
---|
| 102 | ################################################################### |
---|
| 103 | |
---|
| 104 | poly_10mclip = read_polygon(polygondir+'10mclip.csv') |
---|
| 105 | poly_surveyclip = read_polygon(polygondir+'surveyclip.csv') |
---|
| 106 | |
---|
| 107 | # clipping for nsw grid for conversion |
---|
| 108 | eastingmin_nsw = 272900 |
---|
| 109 | eastingmax_nsw = 463550 |
---|
| 110 | northingmin_nsw = 6112950 |
---|
| 111 | northingmax_nsw = 6269750 |
---|
| 112 | |
---|
| 113 | # exporting asc grid |
---|
| 114 | ##eastingmin = 300000 |
---|
| 115 | ##eastingmax = 314000 |
---|
| 116 | ##northingmin = 6167680 |
---|
| 117 | ##northingmax = 6202130 |
---|
| 118 | |
---|
| 119 | eastingmin = 300000 |
---|
| 120 | eastingmax = 314000 |
---|
| 121 | northingmin = 6167680 |
---|
| 122 | northingmax = 6202130 |
---|
| 123 | |
---|
| 124 | # exporting asc grid for Amy |
---|
| 125 | ##eastingmin = 282000 |
---|
| 126 | ##eastingmax = 306500 |
---|
| 127 | ##northingmin = 6131750 |
---|
| 128 | ##northingmax = 6170850 |
---|
| 129 | |
---|
| 130 | ################################################################### |
---|
| 131 | # Slide characteristics |
---|
| 132 | ################################################################### |
---|
| 133 | |
---|
| 134 | # historical slides |
---|
| 135 | slide_origin_bulli = [370110,6189489] |
---|
| 136 | slide_origin_shovel = [354753,6187397] |
---|
| 137 | #slide_origin_yacaaba = [463012,6334735] original work was actually Birubi |
---|
| 138 | slide_origin_yacaaba = [476465, 6362424] |
---|
| 139 | slide_origin_birubi = [462267,6335100] |
---|
| 140 | |
---|
| 141 | # potential slides: these correspond approximately to modelled depths |
---|
| 142 | slide_origin_bulli_b = [405617,6249852] |
---|
| 143 | slide_origin_bulli_c0 = [438583,6308510] |
---|
| 144 | slide_origin_bulli_c1 = [465283,6335210] |
---|
| 145 | slide_origin_bulli_c2 = [483783,6358810] |
---|
| 146 | slide_origin_shovel_b = [396262,6252144] |
---|
| 147 | slide_origin_shovel_c0 = [431683,6311110] |
---|
| 148 | slide_origin_shovel_c1 = [458694,6340352] |
---|
| 149 | slide_origin_shovel_c2 = [475589,6363030] |
---|
| 150 | slide_origin_yacaaba_a = [359796,6190943] |
---|
| 151 | slide_origin_yacaaba_b = [397330,6251857] |
---|
| 152 | slide_origin_yacaaba_c0 = [431283,6312110] |
---|
| 153 | slide_origin_yacaaba_c1 = [459983,6339110] |
---|
| 154 | slide_origin_birubi_a = [362811,6191183] |
---|
| 155 | slide_origin_birubi_b = [403573,6250268] |
---|
| 156 | slide_origin_birubi_c0 = [437183,6309410] |
---|
| 157 | slide_origin_birubi_c2 = [483392,6359044] |
---|
| 158 | |
---|
| 159 | #bulli_depth = 2087.0 |
---|
| 160 | bulli_depth = 1470.0 |
---|
| 161 | bulli_length = 16840.0 |
---|
| 162 | bulli_thickness = 424.0 |
---|
| 163 | bulli_width = 8860.0 |
---|
| 164 | bulli_density = 1.46 |
---|
| 165 | bulli_slope = 4.0 |
---|
| 166 | bulli_alpha = 126.0 - 90.0 |
---|
| 167 | |
---|
| 168 | #shovel_depth = 968.0 |
---|
| 169 | shovel_depth = 877.0 |
---|
| 170 | shovel_length = 13500.0 |
---|
| 171 | shovel_thickness = 165.0 |
---|
| 172 | shovel_width = 4350.0 |
---|
| 173 | shovel_density = 1.49 |
---|
| 174 | shovel_slope = 4.0 |
---|
| 175 | shovel_alpha = 118.0 - 90.0 |
---|
| 176 | |
---|
| 177 | #yacaaba_depth = 1119.0 |
---|
| 178 | yacaaba_depth = 938. |
---|
| 179 | yacaaba_length = 4189. |
---|
| 180 | yacaaba_thickness = 53. |
---|
| 181 | yacaaba_width = 2898. |
---|
| 182 | yacaaba_density = 1.48 |
---|
| 183 | yacaaba_slope = 2.3 |
---|
| 184 | yacaaba_alpha = 133.0 - 90.0 |
---|
| 185 | |
---|
| 186 | birubi_depth = 1320. |
---|
| 187 | birubi_length = 9903.0 |
---|
| 188 | birubi_width = 4150. |
---|
| 189 | birubi_density = 1.48 |
---|
| 190 | birubi_slope = 3.7 |
---|
| 191 | birubi_alpha = 133.0 - 90.0 |
---|
| 192 | birubi_thickness = 140. |
---|