[2616] | 1 | """Common filenames and locations for topographic data, meshes and outputs. |
---|
| 2 | Also includes origin for slump scenario. |
---|
| 3 | """ |
---|
| 4 | |
---|
[3136] | 5 | from os import sep, environ |
---|
[2616] | 6 | from os.path import expanduser |
---|
| 7 | from utilities.polygon import read_polygon |
---|
| 8 | import sys |
---|
| 9 | |
---|
| 10 | from pmesh.create_mesh import convert_points_from_latlon_to_utm |
---|
| 11 | |
---|
| 12 | from coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
| 13 | |
---|
| 14 | from time import localtime, strftime |
---|
| 15 | |
---|
[3136] | 16 | from os import getcwd |
---|
[2616] | 17 | |
---|
| 18 | #Making assumptions about the location of scenario data |
---|
| 19 | scenario_dir_name = 'onslow_tsunami_scenario_2006' |
---|
| 20 | |
---|
| 21 | # 250m data to be provided |
---|
| 22 | coarsename = 'onsl_bathydem250' # get from Neil/Ingo (DEM or topo data) |
---|
| 23 | |
---|
| 24 | # 30m data to be provided |
---|
| 25 | onshore_name = 'onslow_onshore_30m_dted' # get from Neil/Ingo (DEM or topo data) |
---|
| 26 | |
---|
| 27 | offshore_name = 'onslow_offshore_points' |
---|
| 28 | |
---|
[2645] | 29 | boundary_basename = 'SU-AU_clip' |
---|
[2616] | 30 | |
---|
| 31 | #swollen/ all data output |
---|
| 32 | basename = 'source' |
---|
| 33 | |
---|
| 34 | codename = 'project.py' |
---|
| 35 | |
---|
| 36 | if sys.platform == 'win32': |
---|
| 37 | home = environ['INUNDATIONHOME'] #Sandpit's parent dir |
---|
[3136] | 38 | comparehome = environ['ANUGAHOME'] |
---|
[2616] | 39 | else: |
---|
[3136] | 40 | home = environ['INUNDATIONHOME'] #Sandpit's parent dir |
---|
| 41 | # home = expanduser('~') |
---|
[2616] | 42 | |
---|
| 43 | #Derive subdirectories and filenames |
---|
[2682] | 44 | time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
| 45 | outputtimedir = home+sep+scenario_dir_name+sep+'output'+sep+time+sep |
---|
[2616] | 46 | meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep |
---|
| 47 | datadir = home+sep+scenario_dir_name+sep+'topographies'+sep |
---|
[2682] | 48 | gaugedir = home+sep+scenario_dir_name+sep+'gauges'+sep |
---|
[2616] | 49 | polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep |
---|
| 50 | boundarydir = home+sep+scenario_dir_name+sep+'boundaries'+sep |
---|
[2682] | 51 | #output dir without time |
---|
| 52 | outputdir = home+sep+scenario_dir_name+sep+'output'+sep |
---|
[2721] | 53 | tidedir = home+sep+scenario_dir_name+sep+'tide_data'+sep |
---|
[3150] | 54 | comparereportdir = comparehome+sep+'documentation'+sep+'experimentation'+sep+'boundary_ANUGA_MOST'+sep+'report' |
---|
| 55 | comparereportfigdir = comparehome+sep+'documentation'+sep+'experimentation'+sep+'boundary_ANUGA_MOST'+sep+'report_figures' |
---|
[2624] | 56 | print'bound', boundarydir |
---|
[2616] | 57 | |
---|
[2773] | 58 | #gauge_filename = gaugedir + 'onslow_gauges.xya' |
---|
| 59 | #for MOST |
---|
[2958] | 60 | gauge_filename = gaugedir + 'gauge_location_onslow.csv' |
---|
[3136] | 61 | gauges50 = gaugedir + '50_gauges.xya' |
---|
[3158] | 62 | gauge_comparison = gaugedir + 'MOST_comparison_gauges.xya' |
---|
[3136] | 63 | community_filename = gaugedir + 'CHINS_v2.csv' |
---|
| 64 | community_scenario = gaugedir + 'community_onslow.csv' |
---|
[2944] | 65 | buildings_filename = gaugedir + 'onslow_res.csv' |
---|
[2922] | 66 | community_filename = gaugedir + 'CHINS_v2.csv' |
---|
| 67 | community_scenario = gaugedir + 'community_onslow.csv' |
---|
[3136] | 68 | |
---|
| 69 | |
---|
[2682] | 70 | gaugetimeseries = gaugedir + 'onslow' |
---|
| 71 | |
---|
[2721] | 72 | tidal_filename = tidedir + 'onsl.txt' |
---|
| 73 | tidal_outname = tidedir + 'max_min.txt' |
---|
| 74 | |
---|
[2624] | 75 | # boundary source data |
---|
[2645] | 76 | #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 |
---|
[2624] | 77 | |
---|
[2616] | 78 | codedir = getcwd()+sep |
---|
| 79 | |
---|
| 80 | codedirname = codedir + 'project.py' |
---|
| 81 | |
---|
| 82 | meshname = meshdir + basename |
---|
| 83 | |
---|
| 84 | coarsedemname = datadir + coarsename |
---|
| 85 | |
---|
| 86 | onshore_dem_name = datadir + onshore_name |
---|
| 87 | |
---|
| 88 | offshore_dem_name = datadir + offshore_name |
---|
| 89 | |
---|
| 90 | combined_dem_name = datadir + 'onslow_combined_elevation' |
---|
| 91 | |
---|
[2682] | 92 | outputname = outputtimedir + basename #Used by post processing |
---|
[2616] | 93 | |
---|
| 94 | #!gauge_filename = outputdir + 'onslow_gauges.xya' |
---|
| 95 | #!gauge_outname = outputdir + 'gauges_max_output.xya' |
---|
| 96 | |
---|
[2682] | 97 | # clipping region to make DEM (pts file) from fine elevation data |
---|
| 98 | eastingmin = 240000 |
---|
| 99 | eastingmax = 340000 |
---|
[2616] | 100 | northingmin = 7580000 |
---|
[2682] | 101 | northingmax = 7700000 |
---|
[2616] | 102 | |
---|
[2773] | 103 | south = degminsec2decimal_degrees(-22,15,0) |
---|
[2683] | 104 | north = degminsec2decimal_degrees(-20,30,0) |
---|
[2773] | 105 | west = degminsec2decimal_degrees(114,15,0) |
---|
[2683] | 106 | east = degminsec2decimal_degrees(115,50,0) |
---|
[2682] | 107 | ''' |
---|
[2616] | 108 | # region for visualisation |
---|
| 109 | eminviz = 260000 |
---|
| 110 | emaxviz = 320000 |
---|
| 111 | nminviz = 7590000 |
---|
| 112 | nmaxviz = 7630000 |
---|
[2682] | 113 | ''' |
---|
| 114 | # region to export |
---|
[2616] | 115 | |
---|
[2773] | 116 | e_min_area = 300000 |
---|
[2682] | 117 | e_max_area = 310000 |
---|
[2773] | 118 | n_min_area = 7600000 |
---|
| 119 | n_max_area = 7610000 |
---|
[2682] | 120 | |
---|
[2616] | 121 | #Georeferencing |
---|
| 122 | from coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
| 123 | |
---|
| 124 | refzone = 50 |
---|
| 125 | |
---|
[2682] | 126 | #Updated Main Domain of Onslow: first run NB 6/4/06 |
---|
| 127 | d0 = [310000, 7690000] |
---|
| 128 | d1 = [280000, 7690000] |
---|
| 129 | d2 = [270000, 7645000] |
---|
| 130 | d3 = [240000, 7625000] |
---|
| 131 | d4 = [270000, 7580000] |
---|
| 132 | d5 = [300000, 7590000] |
---|
| 133 | d6 = [340000, 7610000] |
---|
[2616] | 134 | |
---|
[2645] | 135 | polyAll = [d0, d1, d2, d3, d4, d5, d6] |
---|
[2616] | 136 | |
---|
| 137 | #Interior region - Onslow town |
---|
| 138 | |
---|
[2773] | 139 | #i0 = [304000, 7608000] |
---|
| 140 | i0 = [304000, 7607000] |
---|
[2616] | 141 | i1 = [302000, 7605000] |
---|
[2773] | 142 | #i2 = [303000, 7602000] |
---|
| 143 | i2 = [304000, 7603000] |
---|
| 144 | #i3 = [305000, 7601000] |
---|
| 145 | i3 = [307000, 7602000] |
---|
[2616] | 146 | i4 = [309000, 7603000] |
---|
[2773] | 147 | #i5 = [307000, 7606500] |
---|
| 148 | i5 = [307000, 7606000] |
---|
[2616] | 149 | |
---|
| 150 | poly_onslow = [i0, i1, i2, i3, i4, i5] |
---|
| 151 | |
---|
| 152 | #Thevenard Island |
---|
| 153 | j0 = [294000, 7629000] |
---|
| 154 | j1 = [285000, 7625000] |
---|
| 155 | j2 = [294000, 7621000] |
---|
| 156 | j3 = [299000, 7625000] |
---|
| 157 | |
---|
| 158 | poly_thevenard = [j0, j1, j2, j3] |
---|
[2706] | 159 | |
---|
[2773] | 160 | ''' |
---|
[2616] | 161 | # Direction Is |
---|
| 162 | k0 = [309000, 7619000] |
---|
| 163 | k1 = [304000, 7619000] |
---|
| 164 | k2 = [304000, 7616500] |
---|
| 165 | k3 = [309000, 7616500] |
---|
| 166 | |
---|
| 167 | poly_direction = [k0, k1, k2, k3] |
---|
[2682] | 168 | ''' |
---|
[2773] | 169 | |
---|
| 170 | #med res around onslow |
---|
| 171 | l0 = [300000, 7610000] |
---|
| 172 | l1 = [285000, 7600000] |
---|
| 173 | l2 = [300000, 7597500] |
---|
| 174 | l3 = [310000, 7600000] |
---|
| 175 | l4 = [315000, 7610000] |
---|
| 176 | #l5 = [310000, 7612500] |
---|
| 177 | |
---|
| 178 | #poly_coast = [l0, l1, l2, l3, l4, l5] |
---|
| 179 | poly_coast = [l0, l1, l2, l3, l4] |
---|
| 180 | |
---|
| 181 | #general coast and local area to onslow region |
---|
| 182 | m0 = [270000, 7581000] |
---|
| 183 | m1 = [300000, 7591000] |
---|
| 184 | m2 = [339000, 7610000] |
---|
| 185 | m3 = [330000, 7630000] |
---|
| 186 | m4 = [290000, 7640000] |
---|
| 187 | m5 = [260000, 7600000] |
---|
| 188 | |
---|
| 189 | poly_region = [m0, m1, m2, m3, m4, m5] |
---|
[3136] | 190 | |
---|
| 191 | from coordinate_transforms.redfearn import redfearn |
---|
| 192 | # boundary up to 50 m contour |
---|
| 193 | lat1_50 = degminsec2decimal_degrees(-21,30,0) |
---|
| 194 | lat2_50 = degminsec2decimal_degrees(-21,25,0) |
---|
| 195 | lat3_50 = degminsec2decimal_degrees(-21,12,0) |
---|
| 196 | lat4_50 = degminsec2decimal_degrees(-21,0,0) |
---|
| 197 | lon1_50 = degminsec2decimal_degrees(114,40,0) |
---|
| 198 | lon2_50 = degminsec2decimal_degrees(114,49,0) |
---|
| 199 | lon3_50 = degminsec2decimal_degrees(115,1,0) |
---|
| 200 | lon4_50 = degminsec2decimal_degrees(115,9,0) |
---|
| 201 | z, easting, northing = redfearn(lat1_50, lon1_50) |
---|
| 202 | p0_50 = [easting, northing] |
---|
| 203 | z, easting, northing = redfearn(lat2_50, lon2_50) |
---|
| 204 | p1_50 = [easting, northing] |
---|
| 205 | z, easting, northing= redfearn(lat3_50, lon3_50) |
---|
| 206 | p2_50 = [easting, northing] |
---|
| 207 | z, easting, northing = redfearn(lat4_50, lon4_50) |
---|
| 208 | p3_50 = [easting, northing] |
---|
| 209 | |
---|
| 210 | d4_50 = [285000, 7585000] |
---|
| 211 | d6_50 = [330000, 7605000] |
---|
| 212 | bounding_poly50 = [p0_50, p1_50, p2_50, p3_50, d6_50, d5, d4_50] |
---|
| 213 | |
---|
| 214 | # boundary up to 25 m contour |
---|
| 215 | lat1_25 = degminsec2decimal_degrees(-21,30,0) |
---|
| 216 | lat2_25 = degminsec2decimal_degrees(-21,24,0) |
---|
| 217 | lat3_25 = degminsec2decimal_degrees(-21,3,0) |
---|
| 218 | lon1_25 = degminsec2decimal_degrees(114,46,0) |
---|
| 219 | lon2_25 = degminsec2decimal_degrees(114,53,0) |
---|
| 220 | lon3_25 = degminsec2decimal_degrees(115,9,0) |
---|
| 221 | z, easting, northing = redfearn(lat1_25, lon1_25) |
---|
| 222 | p0_25 = [easting, northing] |
---|
| 223 | z, easting, northing = redfearn(lat2_25, lon2_25) |
---|
| 224 | p1_25 = [easting, northing] |
---|
| 225 | z, easting, northing = redfearn(lat3_25, lon3_25) |
---|
| 226 | p2_25 = [easting, northing] |
---|
| 227 | bounding_poly25 = [p0_25, p1_25, p2_25, d6, d5, d4] |
---|