source: production/pt_hedland_2006/project.py @ 3157

Last change on this file since 3157 was 3094, checked in by sexton, 19 years ago

fix legend and add elevation information to caption in sww2timeseries

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