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