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

Last change on this file since 5652 was 5652, checked in by kristy, 16 years ago

updated all Geraldton files to reflex the new boundary file (copied from Perth) and new bathymetry

File size: 6.0 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.75 #??? must check!!!
39
40alpha = 0.1
41friction=0.01
42starttime=0
43finaltime=80000
44export_cellsize=25
45setup='final'
46source='polyline'
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
99onshore_dir_name = topographies_dir + onshore_name
100island_dir_name = topographies_dir + island_name
101coast_dir_name = topographies_dir + coast_name
102offshore_dir_name = topographies_dir + offshore_name
103offshore_dir_name1 = topographies_dir + offshore_name1
104offshore_dir_name2 = topographies_dir + offshore_name2
105offshore_dir_name3 = topographies_dir + offshore_name3
106
107#final topo files
108combined_dir_name = topographies_dir + combined_name
109combined_dir_name_small = topographies_dir + combined_name_small
110
111meshes_dir = anuga_dir+'meshes'+sep
112meshes_dir_name = meshes_dir + scenario_name
113
114polygons_dir = anuga_dir+'polygons'+sep
115tide_dir = anuga_dir+'tide_data'+sep
116
117#boundaries_source = '1'
118
119#boundaries locations
120boundaries_dir = anuga_dir+'boundaries'+sep
121boundaries_dir_name = boundaries_dir + scenario_name
122boundaries_dir_mux = muxhome
123
124#output locations
125output_dir = anuga_dir+'outputs'+sep
126output_build_time_dir = anuga_dir+'outputs'+sep+build_time+dir_comment+sep
127output_run_time_dir = anuga_dir+'outputs'+sep+run_time+dir_comment+sep
128output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
129
130vertex_filename = output_run_time_dir + 'mesh_vertex.csv'
131
132#gauges
133gauge_name = '???.csv'
134gauges_dir = home+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
135gauges_dir_name = gauges_dir + gauge_name
136
137buildings_filename = gauges_dir + 'Busselton_res_Project.csv'
138buildings_filename_out = 'Busselton_res_Project_modified.csv'
139
140community_filename = gauges_dir +''
141community_broome = gauges_dir + ''
142
143
144###############################
145# Interior region definitions
146###############################
147
148# bounding polygon for study area
149poly_all = read_polygon(polygons_dir+'poly_all.csv')
150res_poly_all = 100000*res_factor
151
152poly_neg20_pos20 = read_polygon(polygons_dir+'neg20_pos20.csv')
153res_neg20_pos20 = 20000*res_factor
154
155poly_CBD_1km= read_polygon(polygons_dir+'CBD_1km.csv')
156res_CBD_1km = 800*res_factor
157
158poly_cbd = read_polygon(polygons_dir+'CBD_500m.csv')
159res_cbd = 500*res_factor
160
161poly_wallabi = read_polygon(polygons_dir+'island_wallabi_poly.csv')
162res_wallabi = 1000*res_factor
163
164poly_dingiville = read_polygon(polygons_dir+'island_dingiville_poly.csv')
165res_dingiville = 1000*res_factor
166
167poly_pelsaert = read_polygon(polygons_dir+'island_pelsaert_poly.csv')
168res_pelsaert = 1000*res_factor
169
170
171#plot_polygons([polyAll,poly_broome1,poly_broome2,poly_broome3],figname='boundingpoly2',verbose=False)
172
173interior_regions = [[poly_neg20_pos20,res_neg20_pos20],[poly_CBD_1km,res_CBD_1km],
174                    [poly_cbd,res_cbd],[poly_wallabi,res_wallabi],
175                    [poly_dingiville,res_dingiville],[poly_pelsaert, res_pelsaert]]
176
177trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
178print 'min number triangles', trigs_min
179
180poly_mainland=read_polygon(topographies_in_dir +'initial_condition.csv')
181
182###################################################################
183# Clipping regions for export to asc and regions for clipping data
184###################################################################
185
186
187# Geraldton CBD extract ascii grid
188xminCBD = 262700
189xmaxCBD = 267600
190yminCBD = 6811500
191ymaxCBD = 6816400
192
Note: See TracBrowser for help on using the repository browser.