[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 |
---|
| 23 | offshore_name1 = 'pt_hedland_offshore_points' |
---|
[3271] | 24 | |
---|
[2848] | 25 | # offshore data from AHO fairsheets |
---|
| 26 | offshore_name2 = 'pt_hedland_offshore_points_fairsheet' |
---|
[3271] | 27 | |
---|
[2848] | 28 | # coastline developed from 30m DTED |
---|
[2922] | 29 | coast_name = 'pt_hedland_coastline_points.xya' |
---|
[2848] | 30 | |
---|
| 31 | boundary_basename = 'SU-AU_clip' |
---|
| 32 | |
---|
| 33 | #swollen/ all data output |
---|
| 34 | basename = 'source' |
---|
| 35 | |
---|
| 36 | codename = 'project.py' |
---|
| 37 | |
---|
| 38 | if sys.platform == 'win32': |
---|
[3271] | 39 | home = getenv('INUNDATIONHOME') #Sandpit's parent dir |
---|
[2902] | 40 | # python_home = getenv('PWD') |
---|
[2947] | 41 | #user = basename(getenv('USERPROFILE')) |
---|
| 42 | #print 'USER:', user |
---|
[3271] | 43 | else: |
---|
| 44 | # original |
---|
| 45 | #home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation') |
---|
| 46 | # update to perlite 2 |
---|
| 47 | home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'2'+sep+'cit'+sep+'inundation'+sep+'data') |
---|
[2930] | 48 | user = getenv('LOGNAME') |
---|
| 49 | print 'USER:', user |
---|
| 50 | |
---|
[2848] | 51 | #Derive subdirectories and filenames |
---|
| 52 | time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
[3271] | 53 | outputtimedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep+time+sep |
---|
| 54 | |
---|
[2902] | 55 | #print 'outputtimedir', outputtimedir |
---|
[3271] | 56 | #meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep |
---|
| 57 | #datadir = home+sep+scenario_dir_name+sep+'topographies'+sep |
---|
| 58 | #gaugedir = home+sep+scenario_dir_name+sep+'gauges'+sep |
---|
| 59 | #polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep |
---|
| 60 | #boundarydir = home+sep+scenario_dir_name+sep+'boundaries'+sep |
---|
| 61 | #outputdir = home+sep+scenario_dir_name+sep+'outputs'+sep |
---|
| 62 | #tidedir = home+sep+scenario_dir_name+sep+'tide_data'+sep |
---|
[2848] | 63 | |
---|
[3271] | 64 | meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep |
---|
| 65 | datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep |
---|
| 66 | gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep |
---|
| 67 | polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep |
---|
| 68 | boundarydir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep |
---|
| 69 | outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep |
---|
| 70 | tidedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'tide_data'+sep |
---|
[2848] | 71 | |
---|
[2963] | 72 | gauge_filename = gaugedir + 'gauge_location_port_hedland.csv' |
---|
[2944] | 73 | buildings_filename = gaugedir + 'pt_hedland_res.csv' |
---|
[2922] | 74 | community_filename = gaugedir + 'CHINS_v2.csv' |
---|
| 75 | community_scenario = gaugedir + 'community_pt_hedland.csv' |
---|
[2848] | 76 | tidal_filename = tidedir + 'pt_hedland_tide.txt' |
---|
[2922] | 77 | coast_filename = datadir + coast_name |
---|
[2848] | 78 | |
---|
| 79 | meshname = meshdir + basename |
---|
[3271] | 80 | onshore_dem_name = datadir + onshore_name_dted |
---|
[2848] | 81 | offshore_dem_name1 = datadir + offshore_name1 |
---|
| 82 | offshore_dem_name2 = datadir + offshore_name2 |
---|
| 83 | combined_dem_name = datadir + 'pt_hedland_combined_elevation' |
---|
| 84 | outputname = outputtimedir + basename #Used by post processing |
---|
| 85 | |
---|
| 86 | # clipping region to make DEM (pts file) from onshore data |
---|
| 87 | eastingmin = 594000 |
---|
| 88 | eastingmax = 715000 |
---|
| 89 | northingmin = 7720000 |
---|
| 90 | northingmax = 7880000 |
---|
| 91 | |
---|
| 92 | # for ferret2sww |
---|
[2902] | 93 | south = degminsec2decimal_degrees(-20,30,0) |
---|
| 94 | north = degminsec2decimal_degrees(-17,10,0) |
---|
| 95 | west = degminsec2decimal_degrees(117,00,0) |
---|
| 96 | east = degminsec2decimal_degrees(120,00,0) |
---|
[2848] | 97 | |
---|
| 98 | # region to export (used from export_results.py) |
---|
[3190] | 99 | e_min_area = 633000 |
---|
| 100 | e_max_area = 690000 |
---|
| 101 | n_min_area = 7740000 |
---|
| 102 | n_max_area = 7761000 |
---|
[2848] | 103 | |
---|
[3271] | 104 | refzone = 50 |
---|
[2848] | 105 | |
---|
| 106 | # bounding polygon provided by Hamish |
---|
[2902] | 107 | #d0 = [818732.55, 8062768.27] |
---|
[2930] | 108 | """ |
---|
| 109 | old |
---|
[2902] | 110 | d0 = [755000.0, 8025000.0] |
---|
[2848] | 111 | d1 = [708940.32, 7750510.33] |
---|
| 112 | d2 = [656561.15, 7732615.11] |
---|
| 113 | d3 = [604415.81, 7733013.56] |
---|
| 114 | d4 = [517682.34, 7899310.22] |
---|
[2930] | 115 | """ |
---|
[2848] | 116 | |
---|
[2930] | 117 | d0 = [763852.0, 7934358.0] |
---|
| 118 | d1 = [710987.0, 7925797.0] |
---|
| 119 | d2 = [658264.0, 7926314.0] |
---|
| 120 | d3 = [552686.0, 7871580.0] |
---|
[2954] | 121 | #d4 = [604415.81, 7733013.56] |
---|
[2955] | 122 | d4 = [638000.0, 7733013.56] |
---|
[2954] | 123 | #d5 = [656561.15, 7732615.11] |
---|
[2955] | 124 | d5 = [662000.0, 7732615.11] |
---|
[2954] | 125 | #d6 = [708940.32, 7750510.33] |
---|
[2955] | 126 | d6 = [690000.0, 7740510.33] |
---|
[2848] | 127 | |
---|
[2930] | 128 | polyAll = [d0, d1, d2, d3, d4, d5, d6] |
---|
| 129 | |
---|
[2848] | 130 | #Interior region - Pt Hedland town |
---|
[2902] | 131 | i0 = [668000, 7757000] |
---|
| 132 | i1 = [659000, 7755000] |
---|
| 133 | i2 = [660000, 7749000] |
---|
| 134 | i3 = [667000, 7746000] |
---|
| 135 | i4 = [678000, 7751000] |
---|
[2848] | 136 | |
---|
[2902] | 137 | poly_pt_hedland = [i0, i1, i2, i3, i4] |
---|
[2848] | 138 | |
---|
| 139 | #Are there other significant features? |
---|
[2930] | 140 | j0 = [670000, 7760000] |
---|
[2955] | 141 | j1 = [633000, 7745000] |
---|
[2930] | 142 | j2 = [665000, 7743000] |
---|
| 143 | j3 = [690000, 7755000] |
---|
[2848] | 144 | |
---|
[2902] | 145 | poly_region = [j0, j1, j2, j3] |
---|