source: anuga_work/production/FSM/project.py @ 5205

Last change on this file since 5205 was 5205, checked in by herve, 16 years ago
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
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#codename = 'project.py'
16
17home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent diruser = get_user_name()
18user = get_user_name()
19host = get_host_name()
20
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
25gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
26build_time = time+'_build'
27run_time = time+'_run'
28print 'gtime: ', gtime
29
30#Making assumptions about the location of scenario data
31state = 'sw_pacific'
32scenario_name = 'Kolonia_fixed_wave'
33scenario = 'FSM'
34
35tide =0.2.
36
37alpha = 0.1
38friction=0.01
39starttime=10000
40midtime=21600
41finaltime=500
42export_cellsize=50
43setup='final'
44source='test'
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
62dir_comment='_'+setup+'_'+str(tide)+'_'+str(scenario_name)+'_'+str(user)
63
64# onshore data 5m countour
65onshore_name = 'lidar_data_5m' # original'
66onshore_name1 = 'topo_25mcell'
67# AHO + DPI data + colin French coastline
68#coast_name = 'waterline'
69Multibeam_name = 'multibeam'
70added_data_name='sandedge'
71
72
73#final topo name
74combined_name ='Kolonia_combined_elevation'
75combined_smaller_name = 'Kolonia_combined_elevation_smaller'
76
77anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
78
79topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
80topographies_dir = anuga_dir+'topographies'+sep
81#topographies_time_dir = topographies_dir+build_time+sep
82
83# input topo file location
84onshore_in_dir_name = topographies_in_dir + onshore_name
85onshore_in_dir_name1 = topographies_in_dir + onshore_name1
86Multibeam_in_dir_name = topographies_in_dir + Multibeam_name
87added_data_in_dir_name = topographies_in_dir + added_data_name
88
89onshore_dir_name = topographies_dir + onshore_name
90onshore_dir_name1 = topographies_dir + onshore_name1
91Multibeam_dir_name = topographies_dir + Multibeam_name
92added_data_dir_name = topographies_dir + added_data_name
93
94#final topo files
95combined_dir_name = topographies_dir + combined_name
96#combined_time_dir_name = topographies_time_dir + combined_name
97combined_smaller_name_dir = topographies_dir + combined_smaller_name
98#combined_time_dir_final_name = topographies_time_dir + combined_final_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
107#boundaries_source = '1'
108
109if source =='dampier':
110    boundaries_name = 'broome_3854_17042007' #Dampier gun
111    boundaries_in_dir = anuga_dir+'boundaries'+sep+sep+'dampier'+sep+'1_10000'+sep
112
113if source=='onslow':
114    boundaries_name = 'broome_3859_16052007' #onslow_hedland_broome gun
115    boundaries_in_dir = anuga_dir+'boundaries'+sep+sep+'onslow_hedland_broome'+sep+'1_10000'+sep
116   
117if source=='exmouth':
118    boundaries_name = 'broome_3103_18052007' #exmouth gun
119    boundaries_in_dir = anuga_dir+'boundaries'+sep+sep+'exmouth'+sep+'1_10000'+sep
120
121if source=='test':
122    boundaries_name = 'other' #exmouth gun
123    boundaries_in_dir = anuga_dir+'boundaries'+sep
124
125
126#boundaries locations
127boundaries_in_dir_name = boundaries_in_dir + scenario_name
128boundaries_dir = anuga_dir+'boundaries'+sep
129boundaries_dir_name = boundaries_dir + scenario_name
130#boundaries_time_dir = anuga_dir+'boundaries'+sep+build_time+sep
131#boundaries_time_dir_name = boundaries_time_dir + boundaries_name  #Used by post processing
132
133#output locations
134output_dir = anuga_dir+'outputs'+sep
135output_build_time_dir = anuga_dir+'outputs'+sep+build_time+dir_comment+sep
136output_run_time_dir = anuga_dir+'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
140#gauge_name = 'perth.csv'
141#gauges_dir = anuga_dir+'gauges'+sep
142#gauges_dir_name = gauges_dir + gauge_name
143
144#buildings_filename = gauges_dir + 'Perth_res_Project.csv'
145#buildings_filename_out = 'Perth_res_Project_modified.csv'
146
147###############################
148# Domain definitions
149###############################
150from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
151
152poly_all = read_polygon(polygons_dir+'extent.txt')
153res_poly_all = 5000*res_factor
154
155#refzone = 50
156
157###############################
158# Interior region definitions
159###############################
160poly_topo=read_polygon(polygons_dir+'poly_topo.txt')
161poly_west_reef = read_polygon(polygons_dir+'poly_lidar1.txt')
162poly_west = read_polygon(polygons_dir+'poly_lidar4.txt')
163poly_centerKolonia = read_polygon(polygons_dir+'poly_lidar2.txt')
164poly_east = read_polygon(polygons_dir+'poly_lidar3.txt')
165
166kolonia_res = 5000
167fine_res = 100
168
169interior_regions = [[poly_west_reef, kolonia_res],
170                    [poly_west,kolonia_res],
171                    [poly_centerKolonia,fine_res],
172                    [poly_east,kolonia_res]]
173                   
174
175boundary_tags={'lagoon_west':[0],
176               'Reef_edge':[1,2,3,4,5,6,7,8,9,10,11,12,13,14],
177               'East&land':[15,16,17],
178               'Land':[18,19]}
179
180trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
181
182print 'min number triangles', trigs_min
183###################################################################
184# Clipping regions for export to asc and regions for clipping data
185###################################################################
186
187# exporting asc grid
188eastingmin = 403481
189eastingmax = 415706
190northingmin = 766423
191northingmax = 776418
192
193
194
195
196
Note: See TracBrowser for help on using the repository browser.