source: anuga_work/production/broome_2006/project_urs.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: 5.6 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
34tide = 0
35#tide = 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'
43
44if setup =='trial':
45    print'trial'
46    res_factor=10
47    time_thinning=48
48    yieldstep=240
49if setup =='basic': 
50    print'basic'
51    res_factor=4
52    time_thinning=12
53    yieldstep=120
54if setup =='final': 
55    print'final'
56    res_factor=1
57    time_thinning=4
58    yieldstep=60
59
60dir_comment='_'+setup+'_'+str(tide)+'_'+str(user)
61
62# onshore data from 30m DTED level 2
63onshore_name = 'Broome_topography_DLI' # original
64# offshore
65offshore_name = 'Broome_Bathymetry'
66offshore_name1 = 'inferred_north'
67offshore_name2 = 'inferred_south'
68coast_name = 'Broome_coastline'
69
70#final topo name
71combined_name ='broome_combined_elevation'
72combined_name1 ='broome_combined_elevation1'
73combined_name_unclipped1 ='broome_combined_elevation_unclipped1'
74combined_small_name = 'broome_combined_elevation_small'
75
76anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
77
78topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep+'Feb07'+sep
79topographies_dir = anuga_dir+'topographies'+sep
80
81# input topo file location
82onshore_in_dir_name = topographies_in_dir + onshore_name
83coast_in_dir_name = topographies_in_dir + coast_name
84offshore_in_dir_name = topographies_in_dir + offshore_name
85offshore_in_dir_name1 = topographies_in_dir + offshore_name1
86offshore_in_dir_name2 = topographies_in_dir + offshore_name2
87
88onshore_dir_name = topographies_dir + onshore_name
89coast_dir_name = topographies_dir + coast_name
90offshore_dir_name = topographies_dir + offshore_name
91offshore_dir_name1 = topographies_dir + offshore_name1
92offshore_dir_name2 = topographies_dir + offshore_name2
93
94#final topo files
95combined_dir_name = topographies_dir + combined_name
96combined_dir_name_unclipped1 = topographies_dir + combined_name_unclipped1
97combined_dir_name1 = topographies_dir + combined_name1
98combined_small_name_dir = 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 = 'broome_3854_17042007'
108
109boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+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 = 'broome_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_broome = gauges_dir + 'community_broome.csv'
127
128buildings_filename = gauges_dir + 'Broome_res_Project.csv'
129buildings_filename_out = 'Broome_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_small.csv')
137#poly_all = read_polygon(polygons_dir+'extent.csv')
138res_poly_all = 150000*res_factor
139
140###############################
141# Interior region definitions
142###############################
143
144poly_0 = read_polygon(polygons_dir+'neg20_coast_contour_pts.csv')
145res_0 = 20000*res_factor
146
147poly_1 = read_polygon(polygons_dir+'broome_north_coast_inside_extent.csv')
148res_1 = 5000*res_factor
149
150poly_2 = read_polygon(polygons_dir+'broome_south_coast_inside_extent.csv')
151res_2 = 5000*res_factor
152
153poly_3 = read_polygon(polygons_dir+'Broome_town_pts.csv')
154res_3 = 2000*res_factor
155
156poly_4 = read_polygon(polygons_dir+'Broome_inner_town_pts.csv')
157res_4 = 500*res_factor
158
159interior_regions = [[poly_0,res_0],[poly_1,res_1],[poly_2,res_2]
160                     ,[poly_3,res_3],[poly_4,res_4]]
161
162trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
163
164print 'min number triangles', trigs_min
165
166poly_mainland = read_polygon(polygons_dir+'Initial_Condition.csv')
167
168###################################################################
169# Clipping regions for export to asc and regions for clipping data
170###################################################################
171
172# exporting asc grid
173e_min_area = 412000.0
174e_max_area = 423000.0
175n_min_area = 8007000.0
176n_max_area = 8022000.0
Note: See TracBrowser for help on using the repository browser.