source: anuga_work/production/shark_bay_2007/project.py @ 4552

Last change on this file since 4552 was 4552, checked in by ole, 18 years ago

Got the shark bay scenario to build

File size: 5.2 KB
Line 
1"""Common filenames and locations for topographic data, meshes and outputs.
2Also includes origin for slump scenario.
3
4All filenames are given without extension
5"""
6
7from os import sep, environ, getenv, getcwd, umask
8from os.path import expanduser, basename, join
9from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon, number_mesh_triangles
10import sys
11from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
12from time import localtime, strftime, gmtime
13from anuga.utilities.system_tools import get_user_name, get_host_name
14
15codename = 'project.py' # FIXME can be obtained automatically as __file__
16
17home = join(getenv('INUNDATIONHOME'), 'data') # Location of Data   
18user = get_user_name()
19host = get_host_name()
20#needed when running using mpirun, mpirun doesn't inherit umask from .bashrc
21umask(002)
22
23#Making assumptions about the location of scenario data
24state = 'western_australia'
25scenario_name = 'shark_bay'
26scenario = 'shark_bay_tsunami_scenario'
27
28#time stuff
29time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
30build_time = time+'_build'
31run_time = time+'_run'
32
33#tide = -3.9
34#tide = 0.0
35tide = 3.6
36
37#Maybe will try to make project a class to allow these parameters to be passed in.
38alpha = 0.1
39friction=0.01
40finaltime=25000
41starttime=3600
42setup='final'
43source='shark_bay'
44
45if setup =='trial':
46    print'trial'
47    res_factor=10
48    time_thinning=48
49    yieldstep=240
50if setup =='basic': 
51    print'basic'
52    res_factor=4
53    time_thinning=12
54    yieldstep=120
55if setup =='final': 
56    print'final'
57    res_factor=1.1
58    time_thinning=4
59    yieldstep=60
60
61
62dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(user)
63
64# elevation data filenames
65ascii_grid_filenames = ['10m_dem_without_survey', '50m_dem_without_10m_dem']
66point_filenames = ['field_survey_north', 'field_survey_south',
67                   'clipped_bathymetry_final', 'coast_points_final']
68
69#final topo name
70combined_name ='shark_bay_combined_elevation'
71combined_small_name = 'shark_bay_combined_elevation_small'
72
73
74anuga_dir = join(home, state, scenario, 'anuga')
75
76topographies_in_dir = join(home, state, scenario, 'elevation_final', 'test_area')
77topographies_dir = join(anuga_dir, 'topographies') # Output dir for ANUGA
78
79# Convert topo file locations into absolute pathnames
80for filename_list in [ascii_grid_filenames, point_filenames]:
81    for i, filename in enumerate(filename_list):
82        filename_list[i] = join(topographies_in_dir, filename)
83
84#final topo files
85combined_dir_name = join(topographies_dir, combined_name)
86combined_small_dir_name = join(topographies_dir, combined_small_name)
87
88
89meshes_dir = join(anuga_dir, 'meshes')
90meshes_dir_name = join(meshes_dir, scenario_name)
91
92
93polygons_dir = join(anuga_dir, 'polygons') # Created with ArcGIS (csv files)
94tide_dir = join(anuga_dir, 'tide_data')
95
96
97# locations for boundary conditions
98if source=='shark_bay':
99    boundaries_file_name = 'shark_bay_3867_18052007'
100    boundaries_dir = join(anuga_dir, 'boundaries', 'shark_bay', '1_10000')
101
102boundaries_name = join(boundaries_dir, boundaries_file_name)
103
104#output locations
105output_dir = join(anuga_dir, 'outputs')
106output_build_time_dir = output_dir+build_time+sep
107output_run_time_dir = output_dir +run_time+dir_comment+sep
108output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
109
110#gauges
111#gauge_name = 'gauge_location_port_hedland.csv'
112#gauge_name_test = 'gauge_checking_test.csv'
113#gauges_dir = anuga_dir+'gauges'+sep
114#gauges_dir_name = gauges_dir + gauge_name
115#gauges_dir_name_test = gauges_dir + gauge_name_test
116
117#tide_dir = anuga_dir+'tide_data'+sep
118
119#buildings_filename = gauges_dir + 'pt_hedland_res.csv'
120#buildings_filename_out = 'pt_hedland_res_modified.csv'
121#buildings_filename_damage_out = 'pt_hedland_res_modified_damage.csv'
122#tidal_filename = tide_dir + 'pt_hedland_tide.txt'
123#community_filename = gauges_dir + 'CHINS_v2.csv'
124#community_scenario = gauges_dir + 'community_pt_hedland.csv'
125
126# clipping region to make DEM (pts file) from onshore data
127#eastingmin = 594000
128#eastingmax = 715000
129#northingmin = 7720000
130#northingmax = 7880000
131
132# for ferret2sww
133south = degminsec2decimal_degrees(-20,30,0)
134north = degminsec2decimal_degrees(-17,10,0)
135west = degminsec2decimal_degrees(117,00,0)
136east = degminsec2decimal_degrees(120,00,0)
137
138# region to export (used from export_results.py)
139#e_min_area = 648000   # Eastings min
140#e_max_area = 675000
141#n_min_area = 7745000
142#n_max_area = 7761000
143
144#export_region = [[e_min_area,n_min_area],[e_min_area,n_max_area],
145#                 [e_max_area,n_max_area],[e_max_area,n_min_area]]
146                 
147
148#from anuga.coordinate_transforms.redfearn import redfearn
149poly_all = read_polygon(join(polygons_dir, 'boundary_extent.csv'))
150res_poly_all = 250000*res_factor
151
152#Interior regions
153poly_inundated_area = read_polygon(join(polygons_dir, 'inundated_area.csv'))
154res_inundated_area = 50000*res_factor
155
156poly_bay_area = read_polygon(join(polygons_dir, 'bay_area.csv'))                                   
157res_bay_area = 100000*res_factor                                   
158
159interior_regions = [[poly_bay_area, res_bay_area], [poly_inundated_area, res_inundated_area]]
160
161trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
162
163print 'min number triangles', trigs_min
164
165
Note: See TracBrowser for help on using the repository browser.