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

Last change on this file since 4482 was 4477, checked in by sexton, 17 years ago

update project file to include newly acquired residential building data from EVP

File size: 6.0 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
13codename = '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
19umask(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='trial'
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
57
58dir_comment='_'+setup+'_'+str(tide)+'_'+str(user)
59
60onshore_name = 'DLI' 
61onshore_name1 = 'DTED' 
62# offshore
63offshore_name = 'Exmouth_bathymetry'
64#offshore_name1 = 'inferred_north'
65#offshore_name2 = 'inferred_south'
66coast_name = 'Exmouth_coastline'
67
68#final topo name
69combined_name ='exmouth_combined_elevation'
70#combined_name1 ='exmouth_combined_elevation1'
71#combined_name_unclipped1 ='exmouth_combined_elevation_unclipped1'
72combined_small_name = 'exmouth_combined_elevation_small'
73
74anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
75
76topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
77topographies_dir = anuga_dir+'topographies'+sep
78
79# input topo file location
80onshore_in_dir_name = topographies_in_dir + onshore_name
81onshore1_in_dir_name = topographies_in_dir + onshore_name1
82coast_in_dir_name = topographies_in_dir + coast_name
83offshore_in_dir_name = topographies_in_dir + offshore_name
84#offshore_in_dir_name1 = topographies_in_dir + offshore_name1
85#offshore_in_dir_name2 = topographies_in_dir + offshore_name2
86
87onshore_dir_name = topographies_dir + onshore_name
88onshore1_dir_name = topographies_dir + onshore_name1
89coast_dir_name = topographies_dir + coast_name
90offshore_dir_name = topographies_dir + offshore_name
91#offshore_dir_name1 = topographies_dir + offshore_name1
92#offshore_dir_name2 = topographies_dir + offshore_name2
93
94#final topo files
95combined_dir_name = topographies_dir + combined_name
96#combined_dir_name_unclipped1 = topographies_dir + combined_name_unclipped1
97#combined_dir_name1 = topographies_dir + combined_name1
98combined_small_dir_name = topographies_dir + combined_small_name
99
100meshes_dir = anuga_dir+'meshes'+sep
101meshes_dir_name = meshes_dir + scenario_name
102
103polygons_dir = anuga_dir+'polygons'+sep
104tide_dir = anuga_dir+'tide_data'+sep
105
106#boundaries locations
107boundaries_name = 'exmouth_3854_17042007'
108
109boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep
110boundaries_in_dir_name = boundaries_in_dir + boundaries_name
111boundaries_dir = anuga_dir+'boundaries'+sep
112boundaries_dir_name = boundaries_dir + boundaries_name
113
114#output locations
115output_dir = anuga_dir+'outputs'+sep
116output_build_time_dir = output_dir+build_time+sep
117output_run_time_dir = output_dir +run_time+dir_comment+sep
118output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
119
120#gauges
121gauge_name = 'exmouth_gauges.csv'
122gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
123gauges_dir_name = gauges_dir + gauge_name
124
125community_filename = gauges_dir + 'CHINS_v2.csv'
126community_exmouth = gauges_dir + 'community_exmouth.csv'
127
128buildings_filename = 'Exmouth_res_Project.csv'
129buildings_filename_out = 'Exmouth_res_Project_modified.csv'
130
131###############################
132# Domain definitions
133###############################
134from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
135
136poly_all = read_polygon(polygons_dir+'extent_more_points.csv')
137
138print 'Area of bounding polygon', polygon_area(poly_all)/1000000.0
139
140res_poly_all = 150000*res_factor
141
142###############################
143# Interior region definitions
144###############################
145
146
147poly_coast = read_polygon(polygons_dir+'pts_coast.csv')
148res_coast = 10000*res_factor
149
150poly_coast1 = read_polygon(polygons_dir+'pts_coast1.csv')
151#res_0 = 20000*res_factor
152
153poly_coast2 = read_polygon(polygons_dir+'pts_coast2.csv')
154#res_0 = 20000*res_factor
155
156poly_coast3 = read_polygon(polygons_dir+'pts_coast3.csv')
157#res_0 = 20000*res_factor
158
159poly_exmouth = read_polygon(polygons_dir+'pts_exmouth.csv')
160res_exmouth = 500*res_factor
161
162poly_nth_defence = read_polygon(polygons_dir+'pts_nth_defence.csv')
163res_nth_defence = 5000*res_factor
164
165poly_middle = read_polygon(polygons_dir+'pts_middle.csv')
166res_middle = 30000*res_factor
167
168poly_airport = read_polygon(polygons_dir+'pts_airport.csv')
169res_airport = 5000*res_factor
170
171interior_regions = [[poly_coast,res_coast],[poly_coast1,res_coast],[poly_coast2,res_coast]
172                   ,[poly_coast3,res_coast],[poly_middle,res_middle],[poly_exmouth,res_exmouth]
173                   ,[poly_nth_defence,res_nth_defence],[poly_airport,res_airport]]
174
175trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
176
177print 'min number triangles', trigs_min
178
179poly_mainland = read_polygon(polygons_dir+'Initial_Condition.csv')
180
181###################################################################
182# Clipping regions for export to asc and regions for clipping data
183###################################################################
184
185# exporting asc grid
186eastingmin = 406215.87
187eastingmax = 440208.78
188northingmin = 7983427.73
189northingmax = 8032834.52
Note: See TracBrowser for help on using the repository browser.