[2616] | 1 | """Common filenames and locations for topographic data, meshes and outputs. |
---|
| 2 | Also includes origin for slump scenario. |
---|
| 3 | """ |
---|
| 4 | |
---|
[3249] | 5 | from os import sep, environ, getenv, getcwd |
---|
[2616] | 6 | from os.path import expanduser |
---|
[3514] | 7 | #from anuga.utilities.polygon import read_polygon |
---|
[2616] | 8 | import sys |
---|
| 9 | |
---|
[3650] | 10 | from anuga.coordinate_transforms.redfearn import convert_points_from_latlon_to_utm |
---|
[2616] | 11 | |
---|
[3535] | 12 | from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
[2616] | 13 | |
---|
[3249] | 14 | from time import localtime, strftime, gmtime |
---|
[2616] | 15 | |
---|
| 16 | #Making assumptions about the location of scenario data |
---|
[3270] | 17 | state = 'western_australia' |
---|
[2616] | 18 | scenario_dir_name = 'onslow_tsunami_scenario_2006' |
---|
| 19 | |
---|
| 20 | # 250m data to be provided |
---|
| 21 | coarsename = 'onsl_bathydem250' # get from Neil/Ingo (DEM or topo data) |
---|
| 22 | |
---|
| 23 | # 30m data to be provided |
---|
[3261] | 24 | onshore_name_dted = 'onslow_onshore_30m_dted2' # get from Neil/Ingo (DEM or topo data) |
---|
[2616] | 25 | |
---|
[3261] | 26 | # 20m data to be provided |
---|
| 27 | onshore_name_dli = 'onslow_onshore_20m_dli' # get from Neil/Ingo (DEM or topo data) |
---|
| 28 | |
---|
| 29 | coast_name = 'onslow_coast' |
---|
| 30 | islands_name = 'onslow_islands_dted2' |
---|
[2616] | 31 | offshore_name = 'onslow_offshore_points' |
---|
| 32 | |
---|
[2645] | 33 | boundary_basename = 'SU-AU_clip' |
---|
[2616] | 34 | |
---|
| 35 | #swollen/ all data output |
---|
| 36 | basename = 'source' |
---|
| 37 | |
---|
| 38 | codename = 'project.py' |
---|
| 39 | |
---|
| 40 | if sys.platform == 'win32': |
---|
[3249] | 41 | home = getenv('INUNDATIONHOME') |
---|
| 42 | # python_home = getenv('PWD') |
---|
| 43 | # home = environ['INUNDATIONHOME'] #Sandpit's parent dir |
---|
| 44 | user = getenv('USERPROFILE') |
---|
| 45 | # user = basename(user_path) |
---|
| 46 | |
---|
[2616] | 47 | else: |
---|
[3249] | 48 | home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation') |
---|
| 49 | user = getenv('LOGNAME') |
---|
| 50 | print 'USER:', user |
---|
[2616] | 51 | |
---|
[3669] | 52 | # INUNDATIONHOME is the inundation directory, not the data directory. |
---|
| 53 | home += sep +'data' |
---|
| 54 | |
---|
[2616] | 55 | #Derive subdirectories and filenames |
---|
[3249] | 56 | #time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
| 57 | local_time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir |
---|
| 58 | |
---|
[3270] | 59 | meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep |
---|
| 60 | datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep |
---|
| 61 | gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep |
---|
| 62 | polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep |
---|
| 63 | boundarydir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep |
---|
[2682] | 64 | #output dir without time |
---|
[3270] | 65 | outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep |
---|
| 66 | tidedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'tide_data'+sep |
---|
[3276] | 67 | comparereportdir = '..'+sep+'..'+sep+'documentation'+sep+'experimentation'+sep+'boundary_ANUGA_MOST'+sep+'report' |
---|
[3249] | 68 | |
---|
| 69 | outputtimedir = outputdir + local_time + sep |
---|
| 70 | |
---|
[2624] | 71 | print'bound', boundarydir |
---|
[2616] | 72 | |
---|
[2773] | 73 | #gauge_filename = gaugedir + 'onslow_gauges.xya' |
---|
| 74 | #for MOST |
---|
[2958] | 75 | gauge_filename = gaugedir + 'gauge_location_onslow.csv' |
---|
[3136] | 76 | gauges50 = gaugedir + '50_gauges.xya' |
---|
[3158] | 77 | gauge_comparison = gaugedir + 'MOST_comparison_gauges.xya' |
---|
[3188] | 78 | gauge_comparison_3d = gaugedir + 'MOST_comparison_gauges_3d.xya' |
---|
[3136] | 79 | community_filename = gaugedir + 'CHINS_v2.csv' |
---|
| 80 | community_scenario = gaugedir + 'community_onslow.csv' |
---|
[3391] | 81 | #buildings_filename = gaugedir + 'onslow_res.csv' |
---|
| 82 | buildings_filename = gaugedir + 'extra_points_nbed.csv' |
---|
| 83 | #buildings_filename_out = gaugedir + 'onslow_res_modified.csv' |
---|
[3396] | 84 | buildings_filename_damage_out = 'extra_points_nbed_modified.csv' |
---|
[3136] | 85 | |
---|
[2682] | 86 | gaugetimeseries = gaugedir + 'onslow' |
---|
| 87 | |
---|
[2721] | 88 | tidal_filename = tidedir + 'onsl.txt' |
---|
| 89 | tidal_outname = tidedir + 'max_min.txt' |
---|
| 90 | |
---|
[2624] | 91 | # boundary source data |
---|
[2645] | 92 | #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] | 93 | |
---|
[2616] | 94 | codedir = getcwd()+sep |
---|
| 95 | |
---|
| 96 | codedirname = codedir + 'project.py' |
---|
| 97 | |
---|
[3249] | 98 | #meshname = meshdir + basename |
---|
| 99 | meshname = outputtimedir + 'mesh_' + basename |
---|
| 100 | print 'meshname',meshname |
---|
[2616] | 101 | coarsedemname = datadir + coarsename |
---|
| 102 | |
---|
[3261] | 103 | onshore_dem_name = datadir + onshore_name_dli |
---|
[2616] | 104 | |
---|
| 105 | offshore_dem_name = datadir + offshore_name |
---|
[3261] | 106 | coast_dem_name = datadir + coast_name |
---|
| 107 | islands_dem_name = datadir + islands_name |
---|
[2616] | 108 | combined_dem_name = datadir + 'onslow_combined_elevation' |
---|
| 109 | |
---|
[2682] | 110 | outputname = outputtimedir + basename #Used by post processing |
---|
[2616] | 111 | |
---|
| 112 | #!gauge_filename = outputdir + 'onslow_gauges.xya' |
---|
| 113 | #!gauge_outname = outputdir + 'gauges_max_output.xya' |
---|
| 114 | |
---|
[2682] | 115 | # clipping region to make DEM (pts file) from fine elevation data |
---|
| 116 | eastingmin = 240000 |
---|
| 117 | eastingmax = 340000 |
---|
[2616] | 118 | northingmin = 7580000 |
---|
[2682] | 119 | northingmax = 7700000 |
---|
[2616] | 120 | |
---|
[2773] | 121 | south = degminsec2decimal_degrees(-22,15,0) |
---|
[2683] | 122 | north = degminsec2decimal_degrees(-20,30,0) |
---|
[2773] | 123 | west = degminsec2decimal_degrees(114,15,0) |
---|
[2683] | 124 | east = degminsec2decimal_degrees(115,50,0) |
---|
[2682] | 125 | ''' |
---|
[2616] | 126 | # region for visualisation |
---|
| 127 | eminviz = 260000 |
---|
| 128 | emaxviz = 320000 |
---|
| 129 | nminviz = 7590000 |
---|
| 130 | nmaxviz = 7630000 |
---|
[2682] | 131 | ''' |
---|
| 132 | # region to export |
---|
[2616] | 133 | |
---|
[2773] | 134 | e_min_area = 300000 |
---|
[2682] | 135 | e_max_area = 310000 |
---|
[2773] | 136 | n_min_area = 7600000 |
---|
| 137 | n_max_area = 7610000 |
---|
[2682] | 138 | |
---|
[3669] | 139 | # region to export to make elevation map: JS 22/9/06 - NOTE, this won't |
---|
| 140 | # work as region needs to be inside bounding box (polyAll)!! |
---|
[3650] | 141 | |
---|
| 142 | e_min_area = 240000 |
---|
| 143 | e_max_area = 340000 |
---|
| 144 | n_min_area = 7580000 |
---|
| 145 | n_max_area = 7690000 |
---|
[3669] | 146 | export_region = [[e_min_area, n_min_area], |
---|
| 147 | [e_min_area, n_max_area], |
---|
| 148 | [e_max_area, n_max_area], |
---|
| 149 | [e_max_area, n_min_area]] |
---|
[2616] | 150 | #Georeferencing |
---|
[3535] | 151 | from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
[2616] | 152 | |
---|
| 153 | refzone = 50 |
---|
| 154 | |
---|
[2682] | 155 | #Updated Main Domain of Onslow: first run NB 6/4/06 |
---|
| 156 | d0 = [310000, 7690000] |
---|
| 157 | d1 = [280000, 7690000] |
---|
| 158 | d2 = [270000, 7645000] |
---|
| 159 | d3 = [240000, 7625000] |
---|
| 160 | d4 = [270000, 7580000] |
---|
| 161 | d5 = [300000, 7590000] |
---|
| 162 | d6 = [340000, 7610000] |
---|
[2616] | 163 | |
---|
[2645] | 164 | polyAll = [d0, d1, d2, d3, d4, d5, d6] |
---|
[2616] | 165 | |
---|
[3669] | 166 | polygons = [polyAll, export_region] |
---|
| 167 | figname = 'checking.png' |
---|
| 168 | from anuga.utilities.polygon import plot_polygons |
---|
| 169 | plot_polygons(polygons, figname, verbose = False) |
---|
| 170 | print figname |
---|
[2616] | 171 | #Interior region - Onslow town |
---|
| 172 | |
---|
[3249] | 173 | #first run! |
---|
[2773] | 174 | #i0 = [304000, 7608000] |
---|
[3249] | 175 | #i1 = [302000, 7605000] |
---|
[2773] | 176 | #i2 = [303000, 7602000] |
---|
[3249] | 177 | #i3 = [305000, 7601000] |
---|
| 178 | #i4 = [309000, 7603000] |
---|
| 179 | #i5 = [307000, 7606500] |
---|
| 180 | |
---|
| 181 | #refined run |
---|
| 182 | #i0 = [304000, 7607000] |
---|
| 183 | #i1 = [302000, 7605000] |
---|
| 184 | #i2 = [304000, 7603000] |
---|
| 185 | #i3 = [307000, 7602000] |
---|
| 186 | #i4 = [309000, 7603000] |
---|
| 187 | #i5 = [307000, 7606000] |
---|
| 188 | |
---|
| 189 | #for visualisation |
---|
[3265] | 190 | #i0 = [304000, 7609000] |
---|
| 191 | #i1 = [301500, 7605000] |
---|
| 192 | #i2 = [304000, 7603000] |
---|
| 193 | #i3 = [307000, 7602000] |
---|
| 194 | #i4 = [309000, 7603000] |
---|
| 195 | #i5 = [311000, 7607000] |
---|
| 196 | |
---|
| 197 | #i0 = [304000, 7608000] |
---|
| 198 | i0 = [304000, 7607000] |
---|
| 199 | i1 = [302000, 7605000] |
---|
| 200 | #i2 = [303000, 7602000] |
---|
[2773] | 201 | i2 = [304000, 7603000] |
---|
[3265] | 202 | #i3 = [305000, 7601000] |
---|
[2773] | 203 | i3 = [307000, 7602000] |
---|
[2616] | 204 | i4 = [309000, 7603000] |
---|
[3265] | 205 | #i5 = [307000, 7606500] |
---|
| 206 | i5 = [307000, 7606000] |
---|
[2616] | 207 | |
---|
[3249] | 208 | |
---|
[2616] | 209 | poly_onslow = [i0, i1, i2, i3, i4, i5] |
---|
| 210 | |
---|
| 211 | #Thevenard Island |
---|
| 212 | j0 = [294000, 7629000] |
---|
| 213 | j1 = [285000, 7625000] |
---|
| 214 | j2 = [294000, 7621000] |
---|
| 215 | j3 = [299000, 7625000] |
---|
| 216 | |
---|
| 217 | poly_thevenard = [j0, j1, j2, j3] |
---|
[2706] | 218 | |
---|
[2773] | 219 | ''' |
---|
[2616] | 220 | # Direction Is |
---|
| 221 | k0 = [309000, 7619000] |
---|
| 222 | k1 = [304000, 7619000] |
---|
| 223 | k2 = [304000, 7616500] |
---|
| 224 | k3 = [309000, 7616500] |
---|
| 225 | |
---|
| 226 | poly_direction = [k0, k1, k2, k3] |
---|
[2682] | 227 | ''' |
---|
[2773] | 228 | |
---|
| 229 | #med res around onslow |
---|
| 230 | l0 = [300000, 7610000] |
---|
| 231 | l1 = [285000, 7600000] |
---|
| 232 | l2 = [300000, 7597500] |
---|
| 233 | l3 = [310000, 7600000] |
---|
| 234 | l4 = [315000, 7610000] |
---|
| 235 | #l5 = [310000, 7612500] |
---|
| 236 | |
---|
| 237 | #poly_coast = [l0, l1, l2, l3, l4, l5] |
---|
| 238 | poly_coast = [l0, l1, l2, l3, l4] |
---|
| 239 | |
---|
| 240 | #general coast and local area to onslow region |
---|
| 241 | m0 = [270000, 7581000] |
---|
| 242 | m1 = [300000, 7591000] |
---|
| 243 | m2 = [339000, 7610000] |
---|
| 244 | m3 = [330000, 7630000] |
---|
| 245 | m4 = [290000, 7640000] |
---|
| 246 | m5 = [260000, 7600000] |
---|
| 247 | |
---|
| 248 | poly_region = [m0, m1, m2, m3, m4, m5] |
---|