source: anuga_work/production/perth_2006/project.py @ 4133

Last change on this file since 4133 was 4133, checked in by nick, 17 years ago

updated

File size: 5.5 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
12
13# file and system info
14#---------------------------------
15codename = 'project.py'
16
17home = getenv('INUNDATIONHOME') #Sandpit's parent dir   
18user = get_user_name()
19
20# INUNDATIONHOME is the inundation directory, not the data directory.
21home += sep +'data'
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
30tide = 0.6
31
32#Making assumptions about the location of scenario data
33state = 'western_australia'
34scenario_name = 'perth'
35scenario = 'perth_tsunami_scenario_2006'
36
37# onshore data provided by WA DLI
38onshore_name = 'perth_dli_ext' # original
39#island
40island_name = 'rott_dli_ext' # original
41island_name1 = 'gard_dli_ext'
42island_name2 = 'carnac_island_dted'
43island_name3 = 'penguin_dted'
44
45# AHO + DPI data
46coast_name = 'waterline'
47offshore_name = 'perth_bathymetry'
48offshore1_name = 'missing_fairsheets'
49
50#final topo name
51combined_name ='perth_combined_elevation'
52combined_smaller_name = 'perth_combined_elevation_smaller'
53
54
55topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
56topographies_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep
57topographies_time_dir = topographies_dir+build_time+sep
58
59#input topo file location
60onshore_in_dir_name = topographies_in_dir + onshore_name
61island_in_dir_name = topographies_in_dir + island_name
62island_in_dir_name1 = topographies_in_dir + island_name1
63island_in_dir_name2 = topographies_in_dir + island_name2
64island_in_dir_name3 = topographies_in_dir + island_name3
65
66coast_in_dir_name = topographies_in_dir + coast_name
67offshore_in_dir_name = topographies_in_dir + offshore_name
68offshore1_in_dir_name = topographies_in_dir + offshore1_name
69
70onshore_dir_name = topographies_dir + onshore_name
71island_dir_name = topographies_dir + island_name
72island_dir_name1 = topographies_dir + island_name1
73island_dir_name2 = topographies_dir + island_name2
74island_dir_name3 = topographies_dir + island_name3
75
76coast_dir_name = topographies_dir + coast_name
77offshore_dir_name = topographies_dir + offshore_name
78
79#final topo files
80combined_dir_name = topographies_dir + combined_name
81combined_time_dir_name = topographies_time_dir + combined_name
82combined_smaller_name_dir = topographies_dir + combined_smaller_name
83#combined_time_dir_final_name = topographies_time_dir + combined_final_name
84
85
86
87meshes_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'meshes'+sep
88meshes_dir_name = meshes_dir + scenario_name
89
90polygons_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'polygons'+sep
91tide_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'tide_data'+sep
92
93
94boundaries_source = '????'
95#boundaries locations
96boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+boundaries_source+sep
97boundaries_in_dir_name = boundaries_in_dir + scenario_name
98boundaries_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep
99boundaries_dir_name = boundaries_dir + scenario_name
100#boundaries_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+build_time+sep
101#boundaries_time_dir_name = boundaries_time_dir + boundaries_name  #Used by post processing
102
103#output locations
104output_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep
105output_build_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep+build_time+sep
106output_run_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep+run_time+sep
107output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
108
109#gauges
110gauge_name = 'perth.csv'
111gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
112gauges_dir_name = gauges_dir + gauge_name
113
114
115###############################
116# Domain definitions
117###############################
118from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
119
120poly_all = read_polygon(polygons_dir+'bounding_poly.csv')
121res_poly_all = 100000
122
123refzone = 50 
124
125
126###############################
127# Interior region definitions
128###############################
129
130#poly_pos20_neg20 = read_polygon(polygons_dir+'pos20_neg20pts.csv')
131poly_pos20_neg20 = read_polygon(polygons_dir+'pos20_neg20_new_pts.csv')
132res_pos20_neg20 = 20000
133
134#poly_cbd = read_polygon(polygons_dir+'cbd_pts.csv')
135poly_cbd = read_polygon(polygons_dir+'cbd_new_pts.csv')
136res_cbd = 1000
137
138poly_penguin = read_polygon(polygons_dir+'penguin_pts.csv')
139res_penguin = 1000
140#assert zone == refzone
141
142interior_regions = [[poly_pos20_neg20,res_pos20_neg20],[poly_cbd,res_cbd]
143                     ,[poly_penguin,res_penguin]]
144
145trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
146
147print 'min number triangles', trigs_min
148
149###################################################################
150# Clipping regions for export to asc and regions for clipping data
151###################################################################
152
153# exporting asc grid
154eastingmin = 406215.87
155eastingmax = 440208.78
156northingmin = 7983427.73
157northingmax = 8032834.52
158
159
160
Note: See TracBrowser for help on using the repository browser.