source: anuga_work/production/busselton/project.py @ 5381

Last change on this file since 5381 was 5381, checked in by kristy, 16 years ago

update scripts

File size: 6.1 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 ,umask
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
16home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir   
17user = get_user_name()
18host = get_host_name()
19# INUNDATIONHOME is the inundation directory, not the data directory.
20
21#needed when running using mpirun, mpirun doesn't inherit umask from .bashrc
22umask(002)
23
24#time stuff
25time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
26build_time = time+'_build'
27run_time = time+'_run'
28
29tide = 0.6
30
31#Making assumptions about the location of scenario data
32state = 'western_australia'
33scenario_name = 'busselton'
34scenario = 'busselton_tsunami_scenario'
35
36#Maybe will try to make project a class to allow these parameters to be passed in.
37alpha = 0.1
38friction=0.01
39starttime=10000
40midtime=21600
41#finaltime=25000
42finaltime=10000
43export_cellsize=50
44setup='trial'
45source='other'
46
47
48if setup =='trial':
49    print'trial'
50    res_factor=10
51    time_thinning=48
52    yieldstep=240
53if setup =='basic': 
54    print'basic'
55    res_factor=4
56    time_thinning=12
57    yieldstep=120
58if setup =='final': 
59    print'final'
60    res_factor=1
61    time_thinning=4
62    yieldstep=60
63
64dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(user)
65
66
67# onshore data provided by WA DLI
68#onshore_name = 'DLI_orthophoto_DEM' # original
69onshore_name = 'dli_dem_clipped' # original
70#islands
71
72# AHO + DPI data
73coast_name = 'coastline_excluding_beach_survey'
74coast_name1 = 'bussleton_beach_data'
75offshore_name = 'Busselton_bathymetry'
76
77#final topo name
78combined_name ='busselton_combined_elevation'
79combined_name_small = 'busselton_combined_elevation_smaller'
80
81anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
82
83topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
84topographies_dir = home+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep
85
86# input topo file location
87onshore_in_dir_name = topographies_in_dir + onshore_name #topo
88
89coast_in_dir_name = topographies_in_dir + coast_name #coastline
90coast_in_dir_name1 = topographies_in_dir + coast_name1 #beach survey
91offshore_in_dir_name = topographies_in_dir + offshore_name #bathymetry
92
93#output to anuga from build file
94onshore_dir_name = topographies_dir + onshore_name
95
96coast_dir_name = topographies_dir + coast_name
97coast_dir_name1 = topographies_dir + coast_name1
98offshore_dir_name = topographies_dir + offshore_name
99
100#final topo files
101combined_dir_name = topographies_dir + combined_name
102combined_dir_name_small = topographies_dir + combined_name_small
103
104meshes_dir = anuga_dir+'meshes'+sep
105meshes_dir_name = meshes_dir + scenario_name
106
107polygons_dir = anuga_dir+'polygons'+sep
108tide_dir = anuga_dir+'tide_data'+sep
109
110if source =='dampier':
111    boundaries_name = 'broome_3854_17042007' #Dampier gun
112    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep
113
114if source=='onslow':
115    boundaries_name = 'broome_3859_16052007' #onslow_hedland_broome gun
116    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
117   
118if source=='exmouth':
119    boundaries_name = 'broome_3103_18052007' #exmouth gun
120    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
121
122if source=='other':
123    boundaries_name = 'test' #exmouth gun
124    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
125
126
127#boundaries locations
128boundaries_in_dir_name = boundaries_in_dir + boundaries_name
129boundaries_dir = anuga_dir+'boundaries'+sep
130boundaries_dir_name = boundaries_dir + scenario_name
131
132#output locations
133output_dir = anuga_dir+'outputs'+sep
134output_build_time_dir = output_dir+build_time+dir_comment+sep
135#output_run_time_dir = output_dir +run_time+dir_comment+sep
136output_run_time_dir = anuga_dir+sep+'outputs'+sep+run_time+dir_comment+sep
137output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
138
139#gauges
140gauge_name = '???.csv'
141gauges_dir = home+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
142gauges_dir_name = gauges_dir + gauge_name
143
144buildings_filename = gauges_dir + 'Busselton_res_Project.csv'
145buildings_filename_out = 'Busselton_res_Project_modified.csv'
146
147community_filename = gauges_dir +''
148community_broome = gauges_dir + ''
149
150
151###############################
152# Domain definitions
153###############################
154
155from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
156
157# bounding polygon for study area
158poly_all = read_polygon(polygons_dir+'poly_all.csv')
159res_poly_all = 100000*res_factor
160
161###################################################################
162# Clipping regions for export to asc and regions for clipping data
163###################################################################
164
165# exporting asc grid
166eastingmin = 340000
167eastingmax = 350000
168northingmin = 6273400
169northingmax = 6277700
170
171###############################
172# Interior region definitions
173###############################
174
175#digitized polygons
176poly_busselton1 = read_polygon(polygons_dir+'neg20_pos10_polygon.csv')
177res_busselton1 = 10000*res_factor
178
179poly_busselton2 = read_polygon(polygons_dir+'neg5_pos5_poly.csv')
180res_busselton2 = 500*res_factor
181
182#plot_polygons([polyAll,poly_broome1,poly_broome2,poly_broome3],figname='boundingpoly2',verbose=False)
183
184interior_regions = [[poly_busselton1,res_busselton1],[poly_busselton2,res_busselton2]]
185print 'Hello',interior_regions
186
187boundary_tags={'back': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14],
188               'side': [10], 'ocean': [11, 12, 13]}
189
190trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
191
192poly_mainland=read_polygon(topographies_in_dir+'initial_condition_south.csv')
193
194print 'min number triangles', trigs_min
195
196
Note: See TracBrowser for help on using the repository browser.