source: anuga_work/production/tonga/project.py @ 5194

Last change on this file since 5194 was 5194, checked in by herve, 16 years ago

run scripts for tonga

  • Property svn:executable set to *
File size: 7.5 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
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
12
13# file and system info
14#---------------------------------
15#codename = 'project.py'
16
17home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent diruser = get_user_name()
18user = get_user_name()
19host = get_host_name()
20
21# INUNDATIONHOME is the inundation directory, not the data directory.
22
23#time stuff
24time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
25gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
26build_time = time+'_build'
27run_time = time+'_run'
28print 'gtime: ', gtime
29
30#Making assumptions about the location of scenario data
31state = 'sw_pacific'
32scenario_name = 'Tonga_slide'
33scenario = 'tonga'
34
35tide = 0
36
37alpha = 0.1
38friction=0.01
39starttime=10000
40midtime=21600
41finaltime=10000
42export_cellsize=50
43setup='trial'
44source='test'
45
46if setup =='trial':
47    print'trial'
48    res_factor=10
49    time_thinning=48
50    yieldstep=240
51if setup =='basic': 
52    print'basic'
53    res_factor=4
54    time_thinning=12
55    yieldstep=120
56if setup =='final': 
57    print'final'
58    res_factor=1
59    time_thinning=4
60    yieldstep=60
61
62dir_comment='_'+setup+'_'+str(tide)+'_'+str(scenario_name)+'_'+str(user)
63
64# onshore data 5m countour
65onshore_name = 'topography_tongatapu' # original'
66
67# AHO + DPI data + colin French coastline
68#coast_name = 'waterline'
69Singlebeam_name = 'Tongatapu_SB_5m grid'
70Multibeam_name = 'Tongatapu_MB_30m grid'
71Chart_name= 'Tongatapu_Chart'
72Derived_bath_name= 'Derived_Bathy'
73added_data_name='joining_eastIsland_toreef'
74
75
76#final topo name
77combined_name ='Tongatapu_combined_elevation'
78combined_smaller_name = 'Tongatapu_combined_elevation_smaller'
79
80anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
81
82topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
83topographies_dir = anuga_dir+'topographies'+sep
84#topographies_time_dir = topographies_dir+build_time+sep
85
86# input topo file location
87onshore_in_dir_name = topographies_in_dir + onshore_name
88
89Singlebeam_in_dir_name = topographies_in_dir + Singlebeam_name
90Multibeam_in_dir_name = topographies_in_dir + Multibeam_name
91Chart_in_dir_name = topographies_in_dir + Chart_name
92Derived_bath_in_dir_name = topographies_in_dir + Derived_bath_name
93added_data_in_dir_name = topographies_in_dir + added_data_name
94
95onshore_dir_name = topographies_dir + onshore_name
96
97Singlebeam_dir_name = topographies_dir + Singlebeam_name
98Multibeam_dir_name = topographies_dir + Multibeam_name
99Chart_dir_name = topographies_dir + Chart_name
100Derived_bath_dir_name = topographies_dir + Derived_bath_name
101added_data_dir_name = topographies_dir + added_data_name
102
103#final topo files
104combined_dir_name = topographies_dir + combined_name
105#combined_time_dir_name = topographies_time_dir + combined_name
106combined_smaller_name_dir = topographies_dir + combined_smaller_name
107#combined_time_dir_final_name = topographies_time_dir + combined_final_name
108
109meshes_dir = anuga_dir+'meshes'+sep
110meshes_dir_name = meshes_dir + scenario_name
111
112polygons_dir = anuga_dir+'polygons'+sep
113tide_dir = anuga_dir+'tide_data'+sep
114
115
116#boundaries_source = '1'
117
118if source =='dampier':
119    boundaries_name = 'broome_3854_17042007' #Dampier gun
120    boundaries_in_dir = anuga_dir+'boundaries'+sep+sep+'dampier'+sep+'1_10000'+sep
121
122if source=='onslow':
123    boundaries_name = 'broome_3859_16052007' #onslow_hedland_broome gun
124    boundaries_in_dir = anuga_dir+'boundaries'+sep+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
125   
126if source=='exmouth':
127    boundaries_name = 'broome_3103_18052007' #exmouth gun
128    boundaries_in_dir = anuga_dir+'boundaries'+sep+sep+'exmouth'+sep+'1_10000'+sep
129
130if source=='test':
131    boundaries_name = 'other' #exmouth gun
132    boundaries_in_dir = anuga_dir+'boundaries'+sep
133
134
135#boundaries locations
136boundaries_in_dir_name = boundaries_in_dir + scenario_name
137boundaries_dir = anuga_dir+'boundaries'+sep
138boundaries_dir_name = boundaries_dir + scenario_name
139#boundaries_time_dir = anuga_dir+'boundaries'+sep+build_time+sep
140#boundaries_time_dir_name = boundaries_time_dir + boundaries_name  #Used by post processing
141
142#output locations
143output_dir = anuga_dir+'outputs'+sep
144output_build_time_dir = anuga_dir+'outputs'+sep+build_time+dir_comment+sep
145output_run_time_dir = anuga_dir+'outputs'+sep+run_time+dir_comment+sep
146output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
147
148#gauges
149#gauge_name = 'perth.csv'
150#gauges_dir = anuga_dir+'gauges'+sep
151#gauges_dir_name = gauges_dir + gauge_name
152
153#buildings_filename = gauges_dir + 'Perth_res_Project.csv'
154#buildings_filename_out = 'Perth_res_Project_modified.csv'
155
156###############################
157# Domain definitions
158###############################
159from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
160
161poly_all = read_polygon(polygons_dir+'extent.txt')
162res_poly_all = 40000*res_factor
163
164#refzone = 50
165
166###############################
167# Interior region definitions
168###############################
169
170poly_tongatapu = read_polygon(polygons_dir+'finres.txt')
171poly_island1 = read_polygon(polygons_dir+'island1.txt')
172poly_island2 = read_polygon(polygons_dir+'island2.txt')
173poly_island3 = read_polygon(polygons_dir+'island3.txt')
174poly_island4 = read_polygon(polygons_dir+'island4.txt')
175poly_island5= read_polygon(polygons_dir+'island5.txt')
176poly_island6= read_polygon(polygons_dir+'island6.txt')
177poly_island7= read_polygon(polygons_dir+'island7.txt')
178poly_island8= read_polygon(polygons_dir+'island8.txt')
179poly_island9= read_polygon(polygons_dir+'island9.txt')
180poly_island10= read_polygon(polygons_dir+'island10.txt')
181poly_island11= read_polygon(polygons_dir+'island11.txt')
182poly_island12= read_polygon(polygons_dir+'island12.txt')
183poly_island13= read_polygon(polygons_dir+'island13.txt')
184
185
186islands_res = 5000
187tongatapu_res = 5000
188interior_regions = [[poly_tongatapu, tongatapu_res],
189                    [poly_island1, islands_res],
190                    [poly_island2, islands_res],
191                    [poly_island3, islands_res],
192                    [poly_island4, islands_res],
193                    [poly_island5, islands_res],
194                    [poly_island6, islands_res],
195                    [poly_island7, islands_res],
196                    [poly_island8, islands_res],
197                    [poly_island9, islands_res],
198                    [poly_island10, islands_res],
199                    [poly_island11, islands_res],
200                    [poly_island12, islands_res],
201                    [poly_island13, islands_res]]
202
203boundary_tags={'ocean_east':[0],
204               'ocean_north':[1],
205               'ocean_west':[2,3],
206               'land':[4,5,6,7,8,9,10,11,12,13,14],
207               'ocean_southeast':[15,16]}
208
209trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
210
211print 'min number triangles', trigs_min
212###################################################################
213# Clipping regions for export to asc and regions for clipping data
214###################################################################
215
216# exporting asc grid
217eastingmin = 670500
218eastingmax = 712750
219northingmin = 7646000
220northingmax = 7677000
221
222
223slide_origin = [701290, 7665750] # move onto the continental shelf, depth = 500
224slide_depth = 207.
225
226
227
228
Note: See TracBrowser for help on using the repository browser.