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

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

more rev_numbers

File size: 7.1 KB
RevLine 
[5000]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#---------------------------------
[5415]15#codename = 'project.py'
[5000]16
17home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir   
18user = get_user_name()
19host = get_host_name()
[5415]20
[5000]21# INUNDATIONHOME is the inundation directory, not the data directory.
22
23#time stuff
24time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
[5415]25gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
[5000]26build_time = time+'_build'
27run_time = time+'_run'
[5415]28print 'gtime: ', gtime
[5000]29
30#Making assumptions about the location of scenario data
31state = 'western_australia'
32scenario_name = 'busselton'
[5149]33scenario = 'busselton_tsunami_scenario'
[5000]34
[5415]35tide = 0.6
36
[5444]37alpha = 0.1 #changed for testing purposes
[5000]38friction=0.01
[5408]39starttime=0
[5448]40finaltime=50000 # changed for rev_number trial
[5408]41export_cellsize=25
[5448]42setup='trial'
[5387]43source='exmouth'
[5000]44
45
46if setup =='trial':
47    print'trial'
48    res_factor=10
49    time_thinning=48
50    yieldstep=240
51if setup =='basic': 
52    print'basic'
53    res_factor=4
54    time_thinning=12
55    yieldstep=120
56if setup =='final': 
57    print'final'
58    res_factor=1
59    time_thinning=4
60    yieldstep=60
61
[5457]62#rev_num = '5449'
[5448]63#rev_num = '4695' # 2nd Sept 2007
64#rev_num = '4743' # 3nd Oct 2007
65#rev_num = '4777' # 1st Nov 2007
66#rev_num = '4874' # 3rd Dec 2007
67#rev_num = '4901' # 3rd Jan 2007
68#rev_num = '4990' # 5th Feb 2007
69#rev_num = '5103' # 3rd March 2007
[5472]70#rev_num = '5120' # 5th March 2007
71#rev_num = '5140' # 7th March 2007
72#rev_num = '5160' # 11th March 2007
[5448]73#rev_num = '5185' # 1st April 2007
[5457]74rev_num = '5273' # 2nd May 2007
[5000]75
76
[5444]77dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(rev_num)+'_'+str(user)
[5000]78
[5415]79
80# onshore data provided by WA DLI - provided by Hamish on the 17th June 2008
81
82onshore_name = 'busselton_v2_gda94_mga50' # original
83
[5000]84# AHO + DPI data
[5415]85coast_name = 'Contour_0' # provided by hamish, represent better coastline than the 100km as compared to charts
86coast_name1 = 'beach_survey_final'
87offshore_name = 'Bathymetry_final'
88offshore_name1 = 'Busselton_Chart'
89offshore_name2 = 'Busselton_Digitised'
[5000]90
91#final topo name
[5149]92combined_name ='busselton_combined_elevation'
93combined_name_small = 'busselton_combined_elevation_smaller'
[5000]94
95anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
96
[5149]97topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
[5415]98topographies_dir = anuga_dir+'topographies'+sep
[5000]99
[5381]100# input topo file location
101onshore_in_dir_name = topographies_in_dir + onshore_name #topo
[5000]102
[5381]103coast_in_dir_name = topographies_in_dir + coast_name #coastline
104coast_in_dir_name1 = topographies_in_dir + coast_name1 #beach survey
[5415]105
[5381]106offshore_in_dir_name = topographies_in_dir + offshore_name #bathymetry
[5415]107offshore_in_dir_name1 = topographies_in_dir + offshore_name1 #bathymetry Charts
108offshore_in_dir_name2 = topographies_in_dir + offshore_name2 #Digitised Fairsheet
[5000]109
[5381]110#output to anuga from build file
[5000]111onshore_dir_name = topographies_dir + onshore_name
[5381]112
[5000]113coast_dir_name = topographies_dir + coast_name
[5149]114coast_dir_name1 = topographies_dir + coast_name1
[5415]115
[5000]116offshore_dir_name = topographies_dir + offshore_name
[5415]117offshore_dir_name1 = topographies_dir + offshore_name1
118offshore_dir_name2 = topographies_dir + offshore_name2
[5000]119
120#final topo files
121combined_dir_name = topographies_dir + combined_name
[5149]122combined_dir_name_small = topographies_dir + combined_name_small
[5000]123
124meshes_dir = anuga_dir+'meshes'+sep
125meshes_dir_name = meshes_dir + scenario_name
126
127polygons_dir = anuga_dir+'polygons'+sep
128tide_dir = anuga_dir+'tide_data'+sep
129
[5415]130#boundaries_source = '1'
131
[5000]132if source=='exmouth':
[5387]133    boundaries_name = 'busselton_3103_30052008' #exmouth gun
[5000]134    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
135
[5387]136if source=='test':
137    boundaries_name = 'other' #exmouth gun
[5415]138    boundaries_in_dir = anuga_dir+'boundaries'+sep
[5000]139
140
141#boundaries locations
142boundaries_in_dir_name = boundaries_in_dir + boundaries_name
143boundaries_dir = anuga_dir+'boundaries'+sep
144boundaries_dir_name = boundaries_dir + scenario_name
145
146#output locations
147output_dir = anuga_dir+'outputs'+sep
[5415]148output_build_time_dir = output_dir +'test'+sep + build_time + dir_comment + sep
[5000]149#output_run_time_dir = output_dir +run_time+dir_comment+sep
[5415]150output_run_time_dir = output_dir +'test'+sep + run_time + dir_comment +sep # take test out
[5000]151output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
152
153#gauges
[5415]154gauge_name = 'busselton.csv'
[5149]155gauges_dir = home+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
[5000]156gauges_dir_name = gauges_dir + gauge_name
157
158buildings_filename = gauges_dir + 'Busselton_res_Project.csv'
159buildings_filename_out = 'Busselton_res_Project_modified.csv'
160
161community_filename = gauges_dir +''
162community_broome = gauges_dir + ''
163
164
165###############################
166# Domain definitions
167###############################
168
169from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
170
171# bounding polygon for study area
172poly_all = read_polygon(polygons_dir+'poly_all.csv')
173res_poly_all = 100000*res_factor
174
175
176###############################
177# Interior region definitions
178###############################
179
180#digitized polygons
[5415]181poly_large = read_polygon(polygons_dir+'coast_5km_d20m.csv')
[5444]182res_large = 40000*res_factor
[5149]183
[5415]184poly_busselton = read_polygon(polygons_dir+'busselton_1km.csv')
185res_busselton = 500*res_factor
[5000]186
[5415]187poly_bunbury = read_polygon(polygons_dir+'bunbury_1km.csv')
188res_bunbury = 500*res_factor
[5000]189
[5430]190poly_dunsborough = read_polygon(polygons_dir+'dunsborough_1km.csv')
191res_dunsborough = 500*res_factor
[5000]192
[5430]193poly_busselton2 = read_polygon(polygons_dir+'busselton_2km.csv')
194res_busselton2 = 10000*res_factor
[5000]195
[5444]196poly_bunbury2 = read_polygon(polygons_dir+'bunbury_2km.csv')
197res_bunbury2 = 10000*res_factor
[5415]198
[5430]199
200interior_regions = [[poly_large,res_large],[poly_busselton,res_busselton],[poly_bunbury,res_bunbury]
[5444]201                    ,[poly_dunsborough,res_dunsborough],[poly_busselton2,res_busselton2]
202                    ,[poly_bunbury2,res_bunbury2]]
[5430]203
204
[5415]205boundary_tags={'back': [0, 1, 2, 3, 4, 9],
206               'side': [5], 'ocean': [6, 7, 8]}
207
[5000]208trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
209
[5387]210poly_mainland=read_polygon(polygons_dir+'initial_condition.csv')
[5000]211
212print 'min number triangles', trigs_min
213
214
[5415]215###################################################################
216# Clipping regions for export to asc and regions for clipping data
217###################################################################
218
219# exporting asc grid for Busselton
[5444]220xminBusselton = 340000
221xmaxBusselton = 352000
222yminBusselton = 6271500
223ymaxBusselton = 6280000
[5415]224
[5444]225# exporting asc grid for Bunbury
226xminBunbury = 369000
227xmaxBunbury = 381000
228yminBunbury = 6308000
229ymaxBunbury = 6308000
230
231# exporting asc grid for Dunsborough
232xminDunsborough = 321000
233xmaxDunsborough = 327500
234yminDunsborough = 6277000
235ymaxDunsborough = 6282000
236
Note: See TracBrowser for help on using the repository browser.