[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 |
---|
[2954] | 12 | from geospatial_data import * |
---|
[2930] | 13 | |
---|
[2848] | 14 | #Making assumptions about the location of scenario data |
---|
[3271] | 15 | state = 'western_australia' |
---|
[2848] | 16 | scenario_dir_name = 'pt_hedland_tsunami_scenario_2006' |
---|
| 17 | |
---|
| 18 | # onshore data from 30m DTED level 2 |
---|
[3271] | 19 | onshore_name_dted = 'pt_hedland_onshore_30m_dted' # get from Neil/Ingo (DEM or topo data) |
---|
| 20 | onshore_name_dli = 'pt_hedland_onshore_20m_dli' # get from Neil/Ingo (DEM or topo data) |
---|
| 21 | |
---|
[2848] | 22 | # offshore data from GA digitised charts |
---|
[3286] | 23 | offshore_name1 = 'pt_hedland_offshore_points_orig' |
---|
[3271] | 24 | |
---|
[2848] | 25 | # offshore data from AHO fairsheets |
---|
[3286] | 26 | offshore_name2 = 'pt_hedland_offshore_points_fairsheet_orig' |
---|
[3271] | 27 | |
---|
[3281] | 28 | # coastline developed from aerial photography and 1.5m DLI contour |
---|
| 29 | #coast_name = 'pt_hedland_coastline_points_dted2_new' |
---|
| 30 | coast_name = 'coast_with_extracted_z' |
---|
[2848] | 31 | |
---|
[3281] | 32 | |
---|
[2848] | 33 | boundary_basename = 'SU-AU_clip' |
---|
| 34 | |
---|
| 35 | #swollen/ all data output |
---|
| 36 | basename = 'source' |
---|
| 37 | |
---|
| 38 | codename = 'project.py' |
---|
| 39 | |
---|
| 40 | if sys.platform == 'win32': |
---|
[3271] | 41 | home = getenv('INUNDATIONHOME') #Sandpit's parent dir |
---|
[2902] | 42 | # python_home = getenv('PWD') |
---|
[3281] | 43 | user = getenv('USERPROFILE') |
---|
[2947] | 44 | #print 'USER:', user |
---|
[3271] | 45 | else: |
---|
| 46 | # original |
---|
| 47 | #home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation') |
---|
| 48 | # update to perlite 2 |
---|
| 49 | home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'2'+sep+'cit'+sep+'inundation'+sep+'data') |
---|
[2930] | 50 | user = getenv('LOGNAME') |
---|
| 51 | |
---|
[2848] | 52 | #Derive subdirectories and filenames |
---|
| 53 | time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
[3271] | 54 | outputtimedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep+time+sep |
---|
| 55 | |
---|
[2902] | 56 | #print 'outputtimedir', outputtimedir |
---|
[3271] | 57 | #meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep |
---|
| 58 | #datadir = home+sep+scenario_dir_name+sep+'topographies'+sep |
---|
| 59 | #gaugedir = home+sep+scenario_dir_name+sep+'gauges'+sep |
---|
| 60 | #polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep |
---|
| 61 | #boundarydir = home+sep+scenario_dir_name+sep+'boundaries'+sep |
---|
| 62 | #outputdir = home+sep+scenario_dir_name+sep+'outputs'+sep |
---|
| 63 | #tidedir = home+sep+scenario_dir_name+sep+'tide_data'+sep |
---|
[2848] | 64 | |
---|
[3271] | 65 | meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep |
---|
| 66 | datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep |
---|
| 67 | gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep |
---|
| 68 | polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep |
---|
| 69 | boundarydir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep |
---|
| 70 | outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep |
---|
| 71 | tidedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'tide_data'+sep |
---|
[2848] | 72 | |
---|
[2963] | 73 | gauge_filename = gaugedir + 'gauge_location_port_hedland.csv' |
---|
[2944] | 74 | buildings_filename = gaugedir + 'pt_hedland_res.csv' |
---|
[2922] | 75 | community_filename = gaugedir + 'CHINS_v2.csv' |
---|
| 76 | community_scenario = gaugedir + 'community_pt_hedland.csv' |
---|
[2848] | 77 | tidal_filename = tidedir + 'pt_hedland_tide.txt' |
---|
| 78 | |
---|
| 79 | meshname = meshdir + basename |
---|
[3281] | 80 | #onshore_dem_name = datadir + onshore_name_dted |
---|
| 81 | onshore_dem_name = datadir + onshore_name_dli |
---|
[2848] | 82 | offshore_dem_name1 = datadir + offshore_name1 |
---|
| 83 | offshore_dem_name2 = datadir + offshore_name2 |
---|
[3274] | 84 | coast_dem_name = datadir + coast_name |
---|
[2848] | 85 | combined_dem_name = datadir + 'pt_hedland_combined_elevation' |
---|
| 86 | outputname = outputtimedir + basename #Used by post processing |
---|
| 87 | |
---|
| 88 | # clipping region to make DEM (pts file) from onshore data |
---|
| 89 | eastingmin = 594000 |
---|
| 90 | eastingmax = 715000 |
---|
| 91 | northingmin = 7720000 |
---|
| 92 | northingmax = 7880000 |
---|
| 93 | |
---|
| 94 | # for ferret2sww |
---|
[2902] | 95 | south = degminsec2decimal_degrees(-20,30,0) |
---|
| 96 | north = degminsec2decimal_degrees(-17,10,0) |
---|
| 97 | west = degminsec2decimal_degrees(117,00,0) |
---|
| 98 | east = degminsec2decimal_degrees(120,00,0) |
---|
[2848] | 99 | |
---|
| 100 | # region to export (used from export_results.py) |
---|
[3291] | 101 | e_min_area = 648000 |
---|
| 102 | e_max_area = 675000 |
---|
[3289] | 103 | n_min_area = 7745000 |
---|
[3190] | 104 | n_max_area = 7761000 |
---|
[2848] | 105 | |
---|
[3289] | 106 | export_region = [[e_min_area,n_min_area],[e_min_area,n_max_area],[e_max_area,n_max_area],[e_max_area,n_min_area]] |
---|
| 107 | |
---|
[3271] | 108 | refzone = 50 |
---|
[2848] | 109 | |
---|
[3277] | 110 | from coordinate_transforms.redfearn import redfearn |
---|
| 111 | # boundary up to 50 m contour |
---|
| 112 | lat1_50 = degminsec2decimal_degrees(-19,20,0) |
---|
| 113 | lat2_50 = degminsec2decimal_degrees(-19,30,0) |
---|
| 114 | lat3_50 = degminsec2decimal_degrees(-19,45,0) |
---|
| 115 | lon1_50 = degminsec2decimal_degrees(119,05,0) |
---|
| 116 | lon2_50 = degminsec2decimal_degrees(118,20,0) |
---|
| 117 | lon3_50 = degminsec2decimal_degrees(117,45,0) |
---|
| 118 | z, easting, northing = redfearn(lat1_50, lon1_50) |
---|
| 119 | d0_50 = [easting, northing] |
---|
| 120 | z, easting, northing = redfearn(lat2_50, lon2_50) |
---|
| 121 | d1_50 = [easting, northing] |
---|
| 122 | z, easting, northing= redfearn(lat3_50, lon3_50) |
---|
| 123 | d2_50 = [easting, northing] |
---|
[2848] | 124 | |
---|
[3277] | 125 | d4_50 = [285000, 7585000] |
---|
| 126 | d6_50 = [330000, 7605000] |
---|
| 127 | #bounding_poly50 = [p0_50, p1_50, p2_50, d6_50, d5, d4_50] |
---|
| 128 | |
---|
[2930] | 129 | d0 = [763852.0, 7934358.0] |
---|
| 130 | d1 = [710987.0, 7925797.0] |
---|
| 131 | d2 = [658264.0, 7926314.0] |
---|
| 132 | d3 = [552686.0, 7871580.0] |
---|
[2954] | 133 | #d4 = [604415.81, 7733013.56] |
---|
[2955] | 134 | d4 = [638000.0, 7733013.56] |
---|
[2954] | 135 | #d5 = [656561.15, 7732615.11] |
---|
[2955] | 136 | d5 = [662000.0, 7732615.11] |
---|
[2954] | 137 | #d6 = [708940.32, 7750510.33] |
---|
[2955] | 138 | d6 = [690000.0, 7740510.33] |
---|
[3277] | 139 | #polyAll = [d0, d1, d2, d3, d4, d5, d6] |
---|
[3284] | 140 | #polyAll = [d0_50, d1_50, d2_50, d4, d5, d6] |
---|
| 141 | # from Hamish |
---|
| 142 | h0=[629262.17, 7747205.47] |
---|
| 143 | h1=[552686.00, 7871579.99] #d3 |
---|
| 144 | h2=[658264.00, 7926314.00] #d2 |
---|
| 145 | h3=[710986.99, 7925796.99] #d1 |
---|
| 146 | h4=[763851.99, 7934357.99] #d0 |
---|
| 147 | h5=[701485.21, 7770656.86] |
---|
| 148 | h6=[698273.75, 7762227.38] |
---|
| 149 | h7=[698194.23, 7762018.65] |
---|
| 150 | h8=[691627.41, 7744781.98] |
---|
| 151 | h9=[679220.75, 7743604.59] |
---|
| 152 | h10=[653512.59, 7740528.56] |
---|
| 153 | h11=[634777.71, 7738247.17] |
---|
| 154 | h12=[629443.86, 7746910.37] |
---|
| 155 | h13=[629396.84, 7746986.75] |
---|
| 156 | h14=[629352.32, 7747059.06] |
---|
| 157 | h15=[629276.24, 7747182.63] |
---|
| 158 | h16=[629262.17, 7747205.47] #repeat of h0 |
---|
| 159 | # using Hamish's new bounding polygon |
---|
[3287] | 160 | #polyAll = [d0_50, d1_50, d2_50, h16,h15,h14,h13,h12,h11,h10,h9,h8,h7,h6,h5] |
---|
| 161 | polyAll = [d0_50, d1_50, d2_50, h16,h11,h8,h6, h5] |
---|
[2848] | 162 | |
---|
| 163 | #Interior region - Pt Hedland town |
---|
[2902] | 164 | i0 = [668000, 7757000] |
---|
| 165 | i1 = [659000, 7755000] |
---|
| 166 | i2 = [660000, 7749000] |
---|
| 167 | i3 = [667000, 7746000] |
---|
| 168 | i4 = [678000, 7751000] |
---|
[2848] | 169 | |
---|
[2902] | 170 | poly_pt_hedland = [i0, i1, i2, i3, i4] |
---|
[2848] | 171 | |
---|
| 172 | #Are there other significant features? |
---|
[2930] | 173 | j0 = [670000, 7760000] |
---|
[2955] | 174 | j1 = [633000, 7745000] |
---|
[2930] | 175 | j2 = [665000, 7743000] |
---|
| 176 | j3 = [690000, 7755000] |
---|
[2848] | 177 | |
---|
[2902] | 178 | poly_region = [j0, j1, j2, j3] |
---|