[2848] | 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 |
---|
[2930] | 6 | from os.path import expanduser, basename |
---|
[2848] | 7 | from utilities.polygon import read_polygon |
---|
| 8 | import sys |
---|
| 9 | from pmesh.create_mesh import convert_points_from_latlon_to_utm |
---|
| 10 | from coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
| 11 | from time import localtime, strftime |
---|
| 12 | |
---|
[2954] | 13 | from geospatial_data import * |
---|
[2930] | 14 | |
---|
| 15 | |
---|
| 16 | |
---|
[2954] | 17 | |
---|
[2848] | 18 | #Making assumptions about the location of scenario data |
---|
| 19 | scenario_dir_name = 'pt_hedland_tsunami_scenario_2006' |
---|
| 20 | |
---|
| 21 | # onshore data from 30m DTED level 2 |
---|
| 22 | onshore_name = 'pt_hedland_onshore_30m_dted' # get from Neil/Ingo (DEM or topo data) |
---|
| 23 | # offshore data from GA digitised charts |
---|
| 24 | offshore_name1 = 'pt_hedland_offshore_points' |
---|
| 25 | # offshore data from AHO fairsheets |
---|
| 26 | offshore_name2 = 'pt_hedland_offshore_points_fairsheet' |
---|
| 27 | # coastline developed from 30m DTED |
---|
[2922] | 28 | coast_name = 'pt_hedland_coastline_points.xya' |
---|
[2848] | 29 | |
---|
| 30 | boundary_basename = 'SU-AU_clip' |
---|
| 31 | |
---|
| 32 | #swollen/ all data output |
---|
| 33 | basename = 'source' |
---|
| 34 | |
---|
| 35 | codename = 'project.py' |
---|
| 36 | |
---|
| 37 | if sys.platform == 'win32': |
---|
[2902] | 38 | home = getenv('INUNDATIONHOME') |
---|
| 39 | # python_home = getenv('PWD') |
---|
| 40 | # home = environ['INUNDATIONHOME'] #Sandpit's parent dir |
---|
[2947] | 41 | #user = basename(getenv('USERPROFILE')) |
---|
| 42 | #print 'USER:', user |
---|
[2848] | 43 | else: |
---|
[2902] | 44 | home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation') |
---|
[2930] | 45 | user = getenv('LOGNAME') |
---|
| 46 | print 'USER:', user |
---|
| 47 | |
---|
[2848] | 48 | #Derive subdirectories and filenames |
---|
| 49 | time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
[2902] | 50 | #print 'home', home |
---|
[2848] | 51 | outputtimedir = home+sep+scenario_dir_name+sep+'output'+sep+time+sep |
---|
[2902] | 52 | #print 'outputtimedir', outputtimedir |
---|
[2848] | 53 | meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep |
---|
| 54 | datadir = home+sep+scenario_dir_name+sep+'topographies'+sep |
---|
| 55 | gaugedir = home+sep+scenario_dir_name+sep+'gauges'+sep |
---|
| 56 | polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep |
---|
| 57 | boundarydir = home+sep+scenario_dir_name+sep+'boundaries'+sep |
---|
| 58 | #output dir without time |
---|
| 59 | outputdir = home+sep+scenario_dir_name+sep+'output'+sep |
---|
| 60 | tidedir = home+sep+scenario_dir_name+sep+'tide_data'+sep |
---|
| 61 | |
---|
[2902] | 62 | #print'bound', boundarydir |
---|
[2848] | 63 | |
---|
| 64 | #gauge_filename = gaugedir + 'onslow_gauges.xya' |
---|
| 65 | #for MOST |
---|
[2963] | 66 | #gauge_filename = gaugedir + 'pt_hedland_gauges.xya' |
---|
| 67 | gauge_filename = gaugedir + 'gauge_location_port_hedland.csv' |
---|
[2944] | 68 | buildings_filename = gaugedir + 'pt_hedland_res.csv' |
---|
[2922] | 69 | community_filename = gaugedir + 'CHINS_v2.csv' |
---|
| 70 | community_scenario = gaugedir + 'community_pt_hedland.csv' |
---|
[2848] | 71 | tidal_filename = tidedir + 'pt_hedland_tide.txt' |
---|
[2922] | 72 | coast_filename = datadir + coast_name |
---|
[2848] | 73 | |
---|
| 74 | # boundary source data |
---|
| 75 | #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 |
---|
| 76 | |
---|
[2902] | 77 | #print 'name', __name__ |
---|
| 78 | #print 'path', __file__ |
---|
| 79 | #codedir = getcwd()+sep |
---|
[2848] | 80 | |
---|
[2902] | 81 | #project_code_name = __name__ |
---|
| 82 | |
---|
| 83 | #project_code_dir_name = __file__ |
---|
| 84 | |
---|
[2848] | 85 | meshname = meshdir + basename |
---|
| 86 | |
---|
| 87 | onshore_dem_name = datadir + onshore_name |
---|
| 88 | |
---|
| 89 | offshore_dem_name1 = datadir + offshore_name1 |
---|
| 90 | offshore_dem_name2 = datadir + offshore_name2 |
---|
| 91 | |
---|
| 92 | combined_dem_name = datadir + 'pt_hedland_combined_elevation' |
---|
| 93 | |
---|
| 94 | outputname = outputtimedir + basename #Used by post processing |
---|
| 95 | |
---|
| 96 | # clipping region to make DEM (pts file) from onshore data |
---|
| 97 | eastingmin = 594000 |
---|
| 98 | eastingmax = 715000 |
---|
| 99 | northingmin = 7720000 |
---|
| 100 | northingmax = 7880000 |
---|
| 101 | |
---|
| 102 | # for ferret2sww |
---|
[2902] | 103 | south = degminsec2decimal_degrees(-20,30,0) |
---|
| 104 | north = degminsec2decimal_degrees(-17,10,0) |
---|
| 105 | west = degminsec2decimal_degrees(117,00,0) |
---|
| 106 | east = degminsec2decimal_degrees(120,00,0) |
---|
[2848] | 107 | |
---|
| 108 | # region to export (used from export_results.py) |
---|
| 109 | |
---|
[3094] | 110 | e_min_area = 659000#633000 |
---|
| 111 | e_max_area = 678000#690000 |
---|
| 112 | n_min_area = 7746000#7740000 |
---|
| 113 | n_max_area = 7757000#7761000 |
---|
[2848] | 114 | |
---|
| 115 | refzone = 50 # confirm with Hamish |
---|
| 116 | |
---|
| 117 | # bounding polygon provided by Hamish |
---|
[2902] | 118 | #d0 = [818732.55, 8062768.27] |
---|
[2930] | 119 | """ |
---|
| 120 | old |
---|
[2902] | 121 | d0 = [755000.0, 8025000.0] |
---|
[2848] | 122 | d1 = [708940.32, 7750510.33] |
---|
| 123 | d2 = [656561.15, 7732615.11] |
---|
| 124 | d3 = [604415.81, 7733013.56] |
---|
| 125 | d4 = [517682.34, 7899310.22] |
---|
[2930] | 126 | """ |
---|
[2848] | 127 | |
---|
[2930] | 128 | d0 = [763852.0, 7934358.0] |
---|
| 129 | d1 = [710987.0, 7925797.0] |
---|
| 130 | d2 = [658264.0, 7926314.0] |
---|
| 131 | d3 = [552686.0, 7871580.0] |
---|
[2954] | 132 | #d4 = [604415.81, 7733013.56] |
---|
[2955] | 133 | d4 = [638000.0, 7733013.56] |
---|
[2954] | 134 | #d5 = [656561.15, 7732615.11] |
---|
[2955] | 135 | d5 = [662000.0, 7732615.11] |
---|
[2954] | 136 | #d6 = [708940.32, 7750510.33] |
---|
[2955] | 137 | d6 = [690000.0, 7740510.33] |
---|
[2848] | 138 | |
---|
[2930] | 139 | polyAll = [d0, d1, d2, d3, d4, d5, d6] |
---|
| 140 | |
---|
[2848] | 141 | #Interior region - Pt Hedland town |
---|
[2902] | 142 | i0 = [668000, 7757000] |
---|
| 143 | i1 = [659000, 7755000] |
---|
| 144 | i2 = [660000, 7749000] |
---|
| 145 | i3 = [667000, 7746000] |
---|
| 146 | i4 = [678000, 7751000] |
---|
[2848] | 147 | |
---|
[2902] | 148 | poly_pt_hedland = [i0, i1, i2, i3, i4] |
---|
[2848] | 149 | |
---|
| 150 | #Are there other significant features? |
---|
[2930] | 151 | j0 = [670000, 7760000] |
---|
[2955] | 152 | j1 = [633000, 7745000] |
---|
[2930] | 153 | j2 = [665000, 7743000] |
---|
| 154 | j3 = [690000, 7755000] |
---|
[2848] | 155 | |
---|
[2902] | 156 | poly_region = [j0, j1, j2, j3] |
---|
[2848] | 157 | |
---|
[2955] | 158 | coast_buffer_file = datadir+'pts2ascii_test.xya' |
---|
[2954] | 159 | G = Geospatial_data(file_name=coast_buffer_file,delimiter=' ') |
---|
[2955] | 160 | poly_coast = list(G.get_data_points()) |
---|
[2954] | 161 | #print 'get_data_points()',G.get_data_points() |
---|
[2955] | 162 | #print 'get_',poly_region |
---|
[2954] | 163 | |
---|
| 164 | |
---|
[2955] | 165 | |
---|