[2616] | 1 | """Common filenames and locations for topographic data, meshes and outputs. |
---|
| 2 | Also includes origin for slump scenario. |
---|
| 3 | """ |
---|
| 4 | |
---|
[2902] | 5 | from os import sep, environ, getenv, getcwd |
---|
[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 | |
---|
| 16 | |
---|
| 17 | #Making assumptions about the location of scenario data |
---|
| 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 |
---|
| 24 | onshore_name = 'onslow_onshore_30m_dted' # get from Neil/Ingo (DEM or topo data) |
---|
| 25 | |
---|
| 26 | offshore_name = 'onslow_offshore_points' |
---|
| 27 | |
---|
[2645] | 28 | boundary_basename = 'SU-AU_clip' |
---|
[2616] | 29 | |
---|
| 30 | #swollen/ all data output |
---|
| 31 | basename = 'source' |
---|
| 32 | |
---|
| 33 | codename = 'project.py' |
---|
| 34 | |
---|
| 35 | if sys.platform == 'win32': |
---|
| 36 | home = environ['INUNDATIONHOME'] #Sandpit's parent dir |
---|
[2902] | 37 | # home = environ['INUNDATIONHOME'] #Sandpit's parent dir |
---|
[2616] | 38 | else: |
---|
[2902] | 39 | home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation') |
---|
[2616] | 40 | |
---|
| 41 | #Derive subdirectories and filenames |
---|
[2682] | 42 | time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
| 43 | outputtimedir = home+sep+scenario_dir_name+sep+'output'+sep+time+sep |
---|
[2616] | 44 | meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep |
---|
| 45 | datadir = home+sep+scenario_dir_name+sep+'topographies'+sep |
---|
[2682] | 46 | gaugedir = home+sep+scenario_dir_name+sep+'gauges'+sep |
---|
[2616] | 47 | polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep |
---|
| 48 | boundarydir = home+sep+scenario_dir_name+sep+'boundaries'+sep |
---|
[2682] | 49 | #output dir without time |
---|
| 50 | outputdir = home+sep+scenario_dir_name+sep+'output'+sep |
---|
[2721] | 51 | tidedir = home+sep+scenario_dir_name+sep+'tide_data'+sep |
---|
[2682] | 52 | |
---|
[2624] | 53 | print'bound', boundarydir |
---|
[2616] | 54 | |
---|
[2773] | 55 | #gauge_filename = gaugedir + 'onslow_gauges.xya' |
---|
| 56 | #for MOST |
---|
[2863] | 57 | gauge_filename = gaugedir + 'onslow_gauges1.xya' |
---|
[2682] | 58 | |
---|
[2773] | 59 | |
---|
[2682] | 60 | gaugetimeseries = gaugedir + 'onslow' |
---|
| 61 | |
---|
[2721] | 62 | tidal_filename = tidedir + 'onsl.txt' |
---|
| 63 | tidal_outname = tidedir + 'max_min.txt' |
---|
| 64 | |
---|
[2624] | 65 | # boundary source data |
---|
[2645] | 66 | #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] | 67 | |
---|
[2616] | 68 | codedir = getcwd()+sep |
---|
| 69 | |
---|
| 70 | codedirname = codedir + 'project.py' |
---|
| 71 | |
---|
| 72 | meshname = meshdir + basename |
---|
| 73 | |
---|
| 74 | coarsedemname = datadir + coarsename |
---|
| 75 | |
---|
| 76 | onshore_dem_name = datadir + onshore_name |
---|
| 77 | |
---|
| 78 | offshore_dem_name = datadir + offshore_name |
---|
| 79 | |
---|
| 80 | combined_dem_name = datadir + 'onslow_combined_elevation' |
---|
| 81 | |
---|
[2682] | 82 | outputname = outputtimedir + basename #Used by post processing |
---|
[2616] | 83 | |
---|
| 84 | #!gauge_filename = outputdir + 'onslow_gauges.xya' |
---|
| 85 | #!gauge_outname = outputdir + 'gauges_max_output.xya' |
---|
| 86 | |
---|
[2682] | 87 | # clipping region to make DEM (pts file) from fine elevation data |
---|
| 88 | eastingmin = 240000 |
---|
| 89 | eastingmax = 340000 |
---|
[2616] | 90 | northingmin = 7580000 |
---|
[2682] | 91 | northingmax = 7700000 |
---|
[2616] | 92 | |
---|
[2773] | 93 | south = degminsec2decimal_degrees(-22,15,0) |
---|
[2683] | 94 | north = degminsec2decimal_degrees(-20,30,0) |
---|
[2773] | 95 | west = degminsec2decimal_degrees(114,15,0) |
---|
[2683] | 96 | east = degminsec2decimal_degrees(115,50,0) |
---|
[2682] | 97 | ''' |
---|
[2616] | 98 | # region for visualisation |
---|
| 99 | eminviz = 260000 |
---|
| 100 | emaxviz = 320000 |
---|
| 101 | nminviz = 7590000 |
---|
| 102 | nmaxviz = 7630000 |
---|
[2682] | 103 | ''' |
---|
| 104 | # region to export |
---|
[2616] | 105 | |
---|
[2773] | 106 | e_min_area = 300000 |
---|
[2682] | 107 | e_max_area = 310000 |
---|
[2773] | 108 | n_min_area = 7600000 |
---|
| 109 | n_max_area = 7610000 |
---|
[2682] | 110 | |
---|
[2616] | 111 | #Georeferencing |
---|
| 112 | from coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
| 113 | |
---|
| 114 | refzone = 50 |
---|
| 115 | |
---|
[2682] | 116 | #Updated Main Domain of Onslow: first run NB 6/4/06 |
---|
| 117 | d0 = [310000, 7690000] |
---|
| 118 | d1 = [280000, 7690000] |
---|
| 119 | d2 = [270000, 7645000] |
---|
| 120 | d3 = [240000, 7625000] |
---|
| 121 | d4 = [270000, 7580000] |
---|
| 122 | d5 = [300000, 7590000] |
---|
| 123 | d6 = [340000, 7610000] |
---|
[2616] | 124 | |
---|
[2645] | 125 | polyAll = [d0, d1, d2, d3, d4, d5, d6] |
---|
[2616] | 126 | |
---|
| 127 | #Interior region - Onslow town |
---|
| 128 | |
---|
[2773] | 129 | #i0 = [304000, 7608000] |
---|
| 130 | i0 = [304000, 7607000] |
---|
[2616] | 131 | i1 = [302000, 7605000] |
---|
[2773] | 132 | #i2 = [303000, 7602000] |
---|
| 133 | i2 = [304000, 7603000] |
---|
| 134 | #i3 = [305000, 7601000] |
---|
| 135 | i3 = [307000, 7602000] |
---|
[2616] | 136 | i4 = [309000, 7603000] |
---|
[2773] | 137 | #i5 = [307000, 7606500] |
---|
| 138 | i5 = [307000, 7606000] |
---|
[2616] | 139 | |
---|
| 140 | poly_onslow = [i0, i1, i2, i3, i4, i5] |
---|
| 141 | |
---|
| 142 | #Thevenard Island |
---|
| 143 | j0 = [294000, 7629000] |
---|
| 144 | j1 = [285000, 7625000] |
---|
| 145 | j2 = [294000, 7621000] |
---|
| 146 | j3 = [299000, 7625000] |
---|
| 147 | |
---|
| 148 | poly_thevenard = [j0, j1, j2, j3] |
---|
[2706] | 149 | |
---|
[2773] | 150 | ''' |
---|
[2616] | 151 | # Direction Is |
---|
| 152 | k0 = [309000, 7619000] |
---|
| 153 | k1 = [304000, 7619000] |
---|
| 154 | k2 = [304000, 7616500] |
---|
| 155 | k3 = [309000, 7616500] |
---|
| 156 | |
---|
| 157 | poly_direction = [k0, k1, k2, k3] |
---|
[2682] | 158 | ''' |
---|
[2773] | 159 | |
---|
| 160 | #med res around onslow |
---|
| 161 | l0 = [300000, 7610000] |
---|
| 162 | l1 = [285000, 7600000] |
---|
| 163 | l2 = [300000, 7597500] |
---|
| 164 | l3 = [310000, 7600000] |
---|
| 165 | l4 = [315000, 7610000] |
---|
| 166 | #l5 = [310000, 7612500] |
---|
| 167 | |
---|
| 168 | #poly_coast = [l0, l1, l2, l3, l4, l5] |
---|
| 169 | poly_coast = [l0, l1, l2, l3, l4] |
---|
| 170 | |
---|
| 171 | #general coast and local area to onslow region |
---|
| 172 | m0 = [270000, 7581000] |
---|
| 173 | m1 = [300000, 7591000] |
---|
| 174 | m2 = [339000, 7610000] |
---|
| 175 | m3 = [330000, 7630000] |
---|
| 176 | m4 = [290000, 7640000] |
---|
| 177 | m5 = [260000, 7600000] |
---|
| 178 | |
---|
| 179 | poly_region = [m0, m1, m2, m3, m4, m5] |
---|