source: anuga_work/production/exmouth_2006/project.py @ 4509

Last change on this file since 4509 was 4509, checked in by nick, 17 years ago

updates to exmouth

File size: 6.1 KB
Line 
1"""Common filenames and locations for topographic data, meshes and outputs.
2Also includes origin for slump scenario.
3"""
4
5from os import sep, environ, getenv, getcwd,umask
6from os.path import expanduser, basename
7from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon, number_mesh_triangles
8import sys
9from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
10from time import localtime, strftime, gmtime
11from anuga.utilities.system_tools import get_user_name, get_host_name
12
13#codename = 'project.py'
14
15home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir   
16user = get_user_name()
17host = get_host_name()
18#needed when running using mpirun, mpirun doesn't inherit umask from .bashrc
19#umask(002)
20
21#Making assumptions about the location of scenario data
22state = 'western_australia'
23scenario_name = 'exmouth'
24scenario = 'exmouth_tsunami_scenario'
25
26#time stuff
27time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
28build_time = time+'_build'
29run_time = time+'_run'
30
31#tide = -1.4
32#tide = 0
33tide = 1.4
34
35#Maybe will try to make project a class to allow these parameters to be passed in.
36alpha = 0.1
37friction=0.01
38starttime=3600
39finaltime=25000
40setup='store'
41
42if setup =='trial':
43    print'trial'
44    res_factor=10
45    time_thinning=48
46    yieldstep=240
47if setup =='basic': 
48    print'basic'
49    res_factor=4
50    time_thinning=12
51    yieldstep=120
52if setup =='final': 
53    print'final'
54    res_factor=1
55    time_thinning=1
56    yieldstep=60
57if setup =='store':
58    print'store'
59    res_factor=10
60    time_thinning=48
61    yieldstep=240   
62
63
64dir_comment='_'+setup+'_'+str(tide)+'_'+str(user)
65
66onshore_name = 'DLI' 
67onshore_name1 = 'DTED' 
68# offshore
69offshore_name = 'Exmouth_bathymetry'
70#offshore_name1 = 'inferred_north'
71#offshore_name2 = 'inferred_south'
72coast_name = 'Exmouth_coastline'
73
74#final topo name
75combined_name ='exmouth_combined_elevation'
76#combined_name1 ='exmouth_combined_elevation1'
77#combined_name_unclipped1 ='exmouth_combined_elevation_unclipped1'
78combined_small_name = 'exmouth_combined_elevation_small'
79
80anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
81
82topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
83topographies_dir = anuga_dir+'topographies'+sep
84
85# input topo file location
86onshore_in_dir_name = topographies_in_dir + onshore_name
87onshore1_in_dir_name = topographies_in_dir + onshore_name1
88coast_in_dir_name = topographies_in_dir + coast_name
89offshore_in_dir_name = topographies_in_dir + offshore_name
90#offshore_in_dir_name1 = topographies_in_dir + offshore_name1
91#offshore_in_dir_name2 = topographies_in_dir + offshore_name2
92
93onshore_dir_name = topographies_dir + onshore_name
94onshore1_dir_name = topographies_dir + onshore_name1
95coast_dir_name = topographies_dir + coast_name
96offshore_dir_name = topographies_dir + offshore_name
97#offshore_dir_name1 = topographies_dir + offshore_name1
98#offshore_dir_name2 = topographies_dir + offshore_name2
99
100#final topo files
101combined_dir_name = topographies_dir + combined_name
102#combined_dir_name_unclipped1 = topographies_dir + combined_name_unclipped1
103#combined_dir_name1 = topographies_dir + combined_name1
104combined_small_dir_name = topographies_dir + combined_small_name
105
106meshes_dir = anuga_dir+'meshes'+sep
107meshes_dir_name = meshes_dir + scenario_name
108
109polygons_dir = anuga_dir+'polygons'+sep
110tide_dir = anuga_dir+'tide_data'+sep
111
112#boundaries locations
113boundaries_name = 'exmouth_3854_17042007'
114
115boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep
116boundaries_in_dir_name = boundaries_in_dir + boundaries_name
117boundaries_dir = anuga_dir+'boundaries'+sep
118boundaries_dir_name = boundaries_dir + boundaries_name
119
120#output locations
121output_dir = anuga_dir+'outputs'+sep
122output_build_time_dir = output_dir+build_time+sep
123output_run_time_dir = output_dir +run_time+dir_comment+sep
124output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
125
126#gauges
127gauge_name = 'exmouth_gauges.csv'
128gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
129gauges_dir_name = gauges_dir + gauge_name
130
131community_filename = gauges_dir + 'CHINS_v2.csv'
132community_exmouth = gauges_dir + 'community_exmouth.csv'
133
134buildings_filename = 'Exmouth_res_Project.csv'
135buildings_filename_out = 'Exmouth_res_Project_modified.csv'
136
137###############################
138# Domain definitions
139###############################
140from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
141
142poly_all = read_polygon(polygons_dir+'extent_more_points.csv')
143
144print 'Area of bounding polygon', polygon_area(poly_all)/1000000.0
145
146res_poly_all = 150000*res_factor
147
148###############################
149# Interior region definitions
150###############################
151
152
153poly_coast = read_polygon(polygons_dir+'pts_coast.csv')
154res_coast = 10000*res_factor
155
156poly_coast1 = read_polygon(polygons_dir+'pts_coast1.csv')
157#res_0 = 20000*res_factor
158
159poly_coast2 = read_polygon(polygons_dir+'pts_coast2.csv')
160#res_0 = 20000*res_factor
161
162poly_coast3 = read_polygon(polygons_dir+'pts_coast3.csv')
163#res_0 = 20000*res_factor
164
165poly_exmouth = read_polygon(polygons_dir+'pts_exmouth.csv')
166res_exmouth = 500*res_factor
167
168poly_nth_defence = read_polygon(polygons_dir+'pts_nth_defence.csv')
169res_nth_defence = 5000*res_factor
170
171poly_middle = read_polygon(polygons_dir+'pts_middle.csv')
172res_middle = 30000*res_factor
173
174poly_airport = read_polygon(polygons_dir+'pts_airport.csv')
175res_airport = 5000*res_factor
176
177interior_regions = [[poly_coast,res_coast],[poly_coast1,res_coast],[poly_coast2,res_coast]
178                   ,[poly_coast3,res_coast],[poly_middle,res_middle],[poly_exmouth,res_exmouth]
179                   ,[poly_nth_defence,res_nth_defence],[poly_airport,res_airport]]
180
181trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
182
183print 'min number triangles', trigs_min
184
185poly_mainland = read_polygon(polygons_dir+'Initial_Condition.csv')
186
187###################################################################
188# Clipping regions for export to asc and regions for clipping data
189###################################################################
190
191# exporting asc grid
192eastingmin = 406215.87
193eastingmax = 440208.78
194northingmin = 7983427.73
195northingmax = 8032834.52
Note: See TracBrowser for help on using the repository browser.