source: production/pt_hedland_2006/project.py @ 3271

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

update pt hedland scripts to write output results to perlite 2 - note, must change INUNDATIONHOME path variable to \perlite\cit\2\cit\data

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
[2954]12from geospatial_data import *
[2930]13
[2848]14#Making assumptions about the location of scenario data
[3271]15state = 'western_australia'
[2848]16scenario_dir_name = 'pt_hedland_tsunami_scenario_2006'
17
18# onshore data from 30m DTED level 2
[3271]19onshore_name_dted = 'pt_hedland_onshore_30m_dted' # get from Neil/Ingo (DEM or topo data)
20onshore_name_dli = 'pt_hedland_onshore_20m_dli' # get from Neil/Ingo (DEM or topo data)
21
[2848]22# offshore data from GA digitised charts
23offshore_name1 = 'pt_hedland_offshore_points'
[3271]24
[2848]25# offshore data from AHO fairsheets
26offshore_name2 = 'pt_hedland_offshore_points_fairsheet'
[3271]27
[2848]28# coastline developed from 30m DTED
[2922]29coast_name = 'pt_hedland_coastline_points.xya'
[2848]30
31boundary_basename = 'SU-AU_clip'
32
33#swollen/ all data output
34basename = 'source'
35
36codename = 'project.py'
37
38if 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]43else:
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
52time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
[3271]53outputtimedir = 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]64meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep
65datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep
66gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep
67polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep
68boundarydir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep
69outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep
70tidedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'tide_data'+sep
[2848]71
[2963]72gauge_filename = gaugedir + 'gauge_location_port_hedland.csv'
[2944]73buildings_filename = gaugedir + 'pt_hedland_res.csv'
[2922]74community_filename = gaugedir + 'CHINS_v2.csv'
75community_scenario = gaugedir + 'community_pt_hedland.csv'
[2848]76tidal_filename = tidedir + 'pt_hedland_tide.txt'
[2922]77coast_filename = datadir + coast_name
[2848]78
79meshname = meshdir + basename
[3271]80onshore_dem_name = datadir + onshore_name_dted
[2848]81offshore_dem_name1 = datadir + offshore_name1
82offshore_dem_name2 = datadir + offshore_name2
83combined_dem_name = datadir + 'pt_hedland_combined_elevation'
84outputname = outputtimedir + basename  #Used by post processing
85
86# clipping region to make DEM (pts file) from onshore data
87eastingmin = 594000
88eastingmax = 715000
89northingmin = 7720000
90northingmax = 7880000
91
92# for ferret2sww
[2902]93south = degminsec2decimal_degrees(-20,30,0)
94north = degminsec2decimal_degrees(-17,10,0)
95west = degminsec2decimal_degrees(117,00,0)
96east = degminsec2decimal_degrees(120,00,0)
[2848]97
98# region to export (used from export_results.py)
[3190]99e_min_area = 633000
100e_max_area = 690000
101n_min_area = 7740000
102n_max_area = 7761000
[2848]103
[3271]104refzone = 50 
[2848]105
106# bounding polygon provided by Hamish
[2902]107#d0 = [818732.55, 8062768.27]
[2930]108"""
109old
[2902]110d0 = [755000.0, 8025000.0]
[2848]111d1 = [708940.32, 7750510.33]
112d2 = [656561.15, 7732615.11]
113d3 = [604415.81, 7733013.56]
114d4 = [517682.34, 7899310.22]
[2930]115"""
[2848]116
[2930]117d0 = [763852.0, 7934358.0]
118d1 = [710987.0, 7925797.0]
119d2 = [658264.0, 7926314.0]
120d3 = [552686.0, 7871580.0]
[2954]121#d4 = [604415.81, 7733013.56]
[2955]122d4 = [638000.0, 7733013.56]
[2954]123#d5 = [656561.15, 7732615.11]
[2955]124d5 = [662000.0, 7732615.11]
[2954]125#d6 = [708940.32, 7750510.33]
[2955]126d6 = [690000.0, 7740510.33]
[2848]127
[2930]128polyAll = [d0, d1, d2, d3, d4, d5, d6]
129
[2848]130#Interior region - Pt Hedland town
[2902]131i0 = [668000, 7757000]
132i1 = [659000, 7755000]
133i2 = [660000, 7749000]
134i3 = [667000, 7746000]
135i4 = [678000, 7751000]
[2848]136
[2902]137poly_pt_hedland = [i0, i1, i2, i3, i4]
[2848]138
139#Are there other significant features?
[2930]140j0 = [670000, 7760000]
[2955]141j1 = [633000, 7745000]
[2930]142j2 = [665000, 7743000]
143j3 = [690000, 7755000]
[2848]144
[2902]145poly_region = [j0, j1, j2, j3]
Note: See TracBrowser for help on using the repository browser.