source: anuga_work/production/broome/project_urs.py @ 5001

Last change on this file since 5001 was 5001, checked in by nick, 16 years ago

update broome with new structure

File size: 7.3 KB
Line 
1# -*- coding: cp1252 -*-
2"""Common filenames and locations for topographic data, meshes and outputs.
3Also includes origin for slump scenario.
4"""
5
6from os import sep, environ, getenv, getcwd,umask
7from os.path import expanduser, basename
8from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon, number_mesh_triangles
9import sys
10from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
11from time import localtime, strftime, gmtime
12from anuga.utilities.system_tools import get_user_name, get_host_name
13
14codename = 'project.py'
15
16home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir   
17user = get_user_name()
18host = get_host_name()
19#needed when running using mpirun, mpirun doesn't inherit umask from .bashrc
20umask(002)
21
22
23#Making assumptions about the location of scenario data
24state = 'western_australia'
25scenario_name = 'broome'
26scenario = 'broome_tsunami_scenario_2006'
27
28#time stuff
29time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
30build_time = time+'_build'
31run_time = time+'_run'
32
33#tide = -5.3
34#tide = 0
35tide = 4.9
36
37#Maybe will try to make project a class to allow these parameters to be passed in.
38alpha = 0.1
39friction=0.01
40starttime=3600
41finaltime=25000
42setup='final'
43source='dampier'
44
45if setup =='trial':
46    print'trial'
47    res_factor=10
48    time_thinning=48
49    yieldstep=240
50if setup =='basic': 
51    print'basic'
52    res_factor=4
53    time_thinning=12
54    yieldstep=120
55if setup =='final': 
56    print'final'
57    res_factor=1
58    time_thinning=4
59    yieldstep=60
60
61dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(user)
62
63# onshore data from 30m DTED level 2
64#onshore_name = 'Broome_topography_DLI' # original
65onshore_name = 'town_topo_10m' # original
66onshore_name1 = 'other_topo_250m' # original
67
68# offshore
69offshore_name = 'Broome_Bathymetry'
70#offshore_name1 = 'inferred_north'
71#offshore_name2 = 'inferred_south'
72offshore_name1 = 'north_250m'
73offshore_name2 = 'south_250m'
74offshore_name3 = 'cable_250m'
75coast_name = 'Broome_coastline'
76
77#final topo name
78combined_name ='broome_combined_elevation_z51_reduced'
79combined_name1 ='broome_combined_elevation1'
80combined_name_unclipped1 ='broome_combined_elevation_unclipped1'
81combined_small_name = 'broome_combined_elevation_small'
82
83anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
84
85topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep+'Feb07'+sep
86topographies_dir = anuga_dir+'topographies'+sep
87
88# input topo file location
89onshore_in_dir_name = topographies_in_dir + onshore_name
90onshore_in_dir_name1 = topographies_in_dir + onshore_name1
91coast_in_dir_name = topographies_in_dir + coast_name
92offshore_in_dir_name = topographies_in_dir + offshore_name
93offshore_in_dir_name1 = topographies_in_dir + offshore_name1
94offshore_in_dir_name2 = topographies_in_dir + offshore_name2
95offshore_in_dir_name3 = topographies_in_dir + offshore_name3
96
97onshore_dir_name = topographies_dir + onshore_name
98onshore_dir_name1 = topographies_dir + onshore_name1
99coast_dir_name = topographies_dir + coast_name
100offshore_dir_name = topographies_dir + offshore_name
101offshore_dir_name1 = topographies_dir + offshore_name1
102offshore_dir_name2 = topographies_dir + offshore_name2
103offshore_dir_name3 = topographies_dir + offshore_name3
104
105#final topo files
106combined_dir_name = topographies_dir + combined_name
107combined_dir_name_unclipped1 = topographies_dir + combined_name_unclipped1
108combined_dir_name1 = topographies_dir + combined_name1
109combined_small_name_dir = topographies_dir + combined_small_name
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
117if source =='dampier':
118    boundaries_name = 'broome_3854_17042007' #Dampier gun
119    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep
120
121if source=='onslow':
122    boundaries_name = 'broome_3859_16052007' #onslow_hedland_broome gun
123    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
124   
125if source=='exmouth':
126    boundaries_name = 'broome_3103_18052007' #exmouth gun
127    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
128   
129boundaries_in_dir_name = boundaries_in_dir + boundaries_name
130boundaries_dir = anuga_dir+'boundaries'+sep
131boundaries_dir_name = boundaries_dir + boundaries_name
132
133#output locations
134output_dir = anuga_dir+'outputs'+sep
135output_build_time_dir = output_dir+build_time+'_'+source+sep
136#output_run_time_dir = output_dir +run_time+dir_comment+sep
137output_run_time_dir = output_dir +'20070703_062312_run_final_4.9_dampier_nbartzis'+sep
138output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
139
140#gauges
141gauge_name = 'broome_gauges.csv'
142gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
143gauges_dir_name = gauges_dir + gauge_name
144
145community_filename = gauges_dir + 'CHINS_v2.csv'
146community_broome = gauges_dir + 'community_broome.csv'
147
148buildings_filename = gauges_dir + 'Broome_res_Project.csv'
149buildings_filename_out = output_run_time_dir+'Broome_res_Project_modified.csv'
150
151###############################
152# Domain definitions
153###############################
154from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
155
156poly_all = read_polygon(polygons_dir+'extent_small.csv')
157# to test update of plot_polygons - now allows points and polygon to be
158# plotted together
159#point = read_polygon(polygons_dir+'neg20_coast_contour_pts.csv')
160#p2 = read_polygon(polygons_dir+'broome_north_coast_inside_extent.csv')
161#label=None
162#plot_polygons([poly_all,point,p2],['line','point','outside'],figname='test',label=label)
163#plot_polygons([poly_all,point],figname='test')
164#poly_all = read_polygon(polygons_dir+'extent.csv')
165res_poly_all = 150000*res_factor
166
167###############################
168# Interior region definitions
169###############################
170
171poly_0 = read_polygon(polygons_dir+'neg20_coast_contour_pts.csv')
172res_0 = 20000*res_factor
173
174poly_1 = read_polygon(polygons_dir+'broome_north_coast_inside_extent.csv')
175res_1 = 5000*res_factor
176
177#poly_2 = read_polygon(polygons_dir+'broome_south_coast_inside_extent.csv')
178poly_2 = read_polygon(polygons_dir+'broome_south_coast_not_town_pts_new.csv')
179res_2 = 5000*res_factor
180
181#poly_3 = read_polygon(polygons_dir+'Broome_town_pts.csv')
182poly_3 = read_polygon(polygons_dir+'broome_town_new_ptsa.csv')
183res_3 = 2000*res_factor
184
185#poly_4 = read_polygon(polygons_dir+'Broome_inner_town_pts.csv')
186poly_4 = read_polygon(polygons_dir+'broome_inner_town_new_ptsa.csv')
187res_4 = 500*res_factor
188
189interior_regions = [[poly_0,res_0],[poly_1,res_1],[poly_2,res_2]
190                     ,[poly_3,res_3],[poly_4,res_4]]
191                     
192boundary_tags={'back': [1, 2], 
193               'side': [0,3],
194               'ocean': [4]}
195
196trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
197
198print 'min number triangles', trigs_min
199
200poly_mainland = read_polygon(polygons_dir+'Initial_Condition.csv')
201
202###################################################################
203# Clipping regions for export to asc and regions for clipping data
204###################################################################
205
206# exporting asc grid
207eastingmin = 412000.0
208eastingmax = 423000.0
209northingmin = 8007000.0
210northingmax = 8022000.0
211
212# exporting asc grid for speed
213#eastingmin = 412900.0
214#eastingmax = 422700.0
215#northingmin = 8008555.0
216#northingmax = 8021350.0
Note: See TracBrowser for help on using the repository browser.