source: anuga_work/production/geraldton/project.py @ 5751

Last change on this file since 5751 was 5751, checked in by kristy, 16 years ago
File size: 6.1 KB
Line 
1# -*- coding: cp1252 -*-
2"""Common filenames and locations for topographic data, meshes and outputs.
3"""
4
5from os import sep, environ, getenv, getcwd ,umask
6from os.path import expanduser
7import sys
8from time import localtime, strftime, gmtime
9from anuga.utilities.polygon import read_polygon, plot_polygons, is_inside_polygon, number_mesh_triangles
10#from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_points_from_latlon_to_utm
11from anuga.utilities.system_tools import get_user_name, get_host_name
12from anuga.shallow_water.data_manager import urs2sts,create_sts_boundary
13from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
14
15# file and system info
16#---------------------------------
17
18home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir   
19muxhome = getenv('MUXHOME')
20user = get_user_name()
21host = get_host_name()
22
23# INUNDATIONHOME is the inundation directory, not the data directory.
24
25#time stuff
26time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
27gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
28build_time = time+'_build'
29run_time = time+'_run'
30print 'gtime: ', gtime
31
32#Making assumptions about the location of scenario data
33state = 'western_australia'
34scenario_name = 'geraldton'
35scenario = 'geraldton_tsunami_scenario'
36
37
38tide = 0 #0.75 #??? must check!!!
39
40alpha = 0.1
41friction=0.01
42starttime=0
43finaltime=1000
44export_cellsize=25
45setup='final'
46source='elevation'
47
48
49if setup =='trial':
50    print'trial'
51    res_factor=10
52    time_thinning=48
53    yieldstep=240
54if setup =='basic': 
55    print'basic'
56    res_factor=4
57    time_thinning=12
58    yieldstep=120
59if setup =='final': 
60    print'final'
61    res_factor=1
62    time_thinning=4
63    yieldstep=60
64
65dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+ 'alpha' +str(alpha)+'_'+str(user)
66
67
68# onshore data provided by WA DLI
69onshore_name = 'landgate_dem_clip' # original
70island_name = 'dted_srtm_islands'
71
72# AHO + DPI data
73coast_name = 'XYcoastline_KVP'
74offshore_name = 'Geraldton_bathymetry'
75offshore_name1 = 'DPI_Data'
76offshore_name2 = 'grid250'
77offshore_name3 = 'Top_bathymetry'
78
79
80#final topo name
81combined_name ='geraldton_combined_elevation'
82combined_name_small = 'geraldton_combined_elevation_small'
83
84anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
85
86topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
87topographies_dir = home+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep
88
89##input topo file location
90onshore_in_dir_name = topographies_in_dir + onshore_name
91island_in_dir_name = topographies_in_dir + island_name
92
93coast_in_dir_name = topographies_in_dir + coast_name
94offshore_in_dir_name = topographies_in_dir + offshore_name
95offshore_in_dir_name1 = topographies_in_dir + offshore_name1
96offshore_in_dir_name2 = topographies_in_dir + offshore_name2
97offshore_in_dir_name3 = topographies_in_dir + offshore_name3
98
99##output topo file location
100onshore_dir_name = topographies_dir + onshore_name
101island_dir_name = topographies_dir + island_name
102coast_dir_name = topographies_dir + coast_name
103offshore_dir_name = topographies_dir + offshore_name
104offshore_dir_name1 = topographies_dir + offshore_name1
105offshore_dir_name2 = topographies_dir + offshore_name2
106offshore_dir_name3 = topographies_dir + offshore_name3
107
108#final topo files
109combined_dir_name = topographies_dir + combined_name
110combined_dir_name_small = topographies_dir + combined_name_small
111
112meshes_dir = anuga_dir+'meshes'+sep
113meshes_dir_name = meshes_dir + scenario_name
114
115polygons_dir = anuga_dir+'polygons'+sep
116tide_dir = anuga_dir+'tide_data'+sep
117
118#boundaries_source = '1'
119
120#boundaries locations
121boundaries_dir = anuga_dir+'boundaries'+sep
122boundaries_dir_name = boundaries_dir + scenario_name
123boundaries_dir_mux = muxhome
124
125#output locations
126output_dir = anuga_dir+'outputs'+sep
127output_build_time_dir = anuga_dir+'outputs'+sep+build_time+dir_comment+sep
128output_run_time_dir = anuga_dir+'outputs'+sep+run_time+dir_comment+sep
129output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
130
131vertex_filename = output_run_time_dir + 'mesh_vertex.csv'
132
133#gauges
134gauge_name = '???.csv'
135gauges_dir = home+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
136gauges_dir_name = gauges_dir + gauge_name
137
138buildings_filename = gauges_dir + 'Busselton_res_Project.csv'
139buildings_filename_out = 'Busselton_res_Project_modified.csv'
140
141community_filename = gauges_dir +''
142community_broome = gauges_dir + ''
143
144
145###############################
146# Interior region definitions
147###############################
148
149# bounding polygon for study area
150poly_all = read_polygon(polygons_dir+'poly_all.csv')
151res_poly_all = 100000*res_factor
152
153poly_neg20_pos20 = read_polygon(polygons_dir+'neg20_pos20.csv')
154res_neg20_pos20 = 25000*res_factor
155
156poly_CBD_1km= read_polygon(polygons_dir+'CBD_1km.csv')
157res_CBD_1km = 800*res_factor
158
159poly_cbd = read_polygon(polygons_dir+'CBD_500m.csv')
160res_cbd = 500*res_factor
161
162poly_wallabi = read_polygon(polygons_dir+'island_wallabi_poly.csv')
163res_wallabi = 5000*res_factor
164
165poly_dingiville = read_polygon(polygons_dir+'island_dingiville_poly.csv')
166res_dingiville = 5000*res_factor
167
168poly_pelsaert = read_polygon(polygons_dir+'island_pelsaert_poly.csv')
169res_pelsaert = 5000*res_factor
170
171
172#plot_polygons([polyAll,poly_broome1,poly_broome2,poly_broome3],figname='boundingpoly2',verbose=False)
173
174interior_regions = [[poly_neg20_pos20,res_neg20_pos20],[poly_CBD_1km,res_CBD_1km],
175                    [poly_cbd,res_cbd],[poly_wallabi,res_wallabi],
176                    [poly_dingiville,res_dingiville],[poly_pelsaert, res_pelsaert]]
177
178trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
179print 'min number triangles', trigs_min
180
181##For no input boundary file
182#boundary_tags={'back': [2,3,4,5], 'side': [0,1,6], 'ocean': [7,8,9]}
183
184poly_mainland=read_polygon(topographies_in_dir +'initial_condition.csv')
185
186
187
188###################################################################
189# Clipping regions for export to asc and regions for clipping data
190###################################################################
191
192
193# Geraldton CBD extract ascii grid
194xminCBD = 262700
195xmaxCBD = 267600
196yminCBD = 6811500
197ymaxCBD = 6816400
198
Note: See TracBrowser for help on using the repository browser.