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

Last change on this file since 5205 was 5205, checked in by herve, 17 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
36
37alpha = 0.1
38friction=0.01
39starttime=10000
40midtime=21600
41finaltime=10000
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_25m'
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'
76combined_name1 ='Kolonia_combined_elevation1'
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
96combined_dir_name1 = topographies_dir + combined_name1
97#combined_time_dir_name = topographies_time_dir + combined_name
98combined_smaller_name_dir = topographies_dir + combined_smaller_name
99#combined_time_dir_final_name = topographies_time_dir + combined_final_name
100
101meshes_dir = anuga_dir+'meshes'+sep
102meshes_dir_name = meshes_dir + scenario_name
103
104polygons_dir = anuga_dir+'polygons'+sep
105tide_dir = anuga_dir+'tide_data'+sep
106
107
108#boundaries_source = '1'
109
110if source =='dampier':
111    boundaries_name = 'broome_3854_17042007' #Dampier gun
112    boundaries_in_dir = anuga_dir+'boundaries'+sep+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+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+sep+'exmouth'+sep+'1_10000'+sep
121
122if source=='test':
123    boundaries_name = 'other' #exmouth gun
124    boundaries_in_dir = anuga_dir+'boundaries'+sep
125
126
127#boundaries locations
128boundaries_in_dir_name = boundaries_in_dir + scenario_name
129boundaries_dir = anuga_dir+'boundaries'+sep
130boundaries_dir_name = boundaries_dir + scenario_name
131#boundaries_time_dir = anuga_dir+'boundaries'+sep+build_time+sep
132#boundaries_time_dir_name = boundaries_time_dir + boundaries_name  #Used by post processing
133
134#output locations
135output_dir = anuga_dir+'outputs'+sep
136output_build_time_dir = anuga_dir+'outputs'+sep+build_time+dir_comment+sep
137output_run_time_dir = anuga_dir+'outputs'+sep+run_time+dir_comment+sep
138output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
139
140#gauges
141#gauge_name = 'perth.csv'
142#gauges_dir = anuga_dir+'gauges'+sep
143#gauges_dir_name = gauges_dir + gauge_name
144
145#buildings_filename = gauges_dir + 'Perth_res_Project.csv'
146#buildings_filename_out = 'Perth_res_Project_modified.csv'
147
148###############################
149# Domain definitions
150###############################
151from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
152
153poly_all = read_polygon(polygons_dir+'extent.txt')
154res_poly_all = 5000*res_factor
155
156#refzone = 50
157
158###############################
159# Interior region definitions
160###############################
161
162poly_west_reef = read_polygon(polygons_dir+'poly_lidar1.txt')
163poly_west = read_polygon(polygons_dir+'poly_lidar4.txt')
164poly_centerKolonia = read_polygon(polygons_dir+'poly_lidar2.txt')
165poly_east = read_polygon(polygons_dir+'poly_lidar3.txt')
166
167kolonia_res = 5000
168fine_res = 100
169
170interior_regions = [[poly_west_reef, kolonia_res],
171                    [poly_west,kolonia_res],
172                    [poly_centerKolonia,fine_res],
173                    [poly_east,kolonia_res]]
174                   
175
176boundary_tags={'lagoon_west':[0],
177               'Reef_edge':[1,2,3,4,5,6,7,8,9,10,11,12,13,14],
178               'East&land':[15,16,17],
179               'Land':[18,19]}
180
181trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
182
183print 'min number triangles', trigs_min
184###################################################################
185# Clipping regions for export to asc and regions for clipping data
186###################################################################
187
188# exporting asc grid
189eastingmin = 403481
190eastingmax = 415706
191northingmin = 766423
192northingmax = 776418
193
194
195
196
197
Note: See TracBrowser for help on using the repository browser.