source: anuga_work/production/galle_2007/project.py @ 4547

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

add Sri Lanka scenario Galle, this was used by Saman

File size: 5.1 KB
Line 
1# -*- coding: cp1252 -*-
2"""Common filenames and locations for topographic data, meshes and outputs.
3"""
4
5
6from os import sep, environ, getenv, getcwd,umask
7from os.path import expanduser
8import sys
9from time import localtime, strftime, gmtime
10from anuga.utilities.polygon import read_polygon, plot_polygons, is_inside_polygon, \
11                                    number_mesh_triangles, polygon_area
12from anuga.utilities.system_tools import get_user_name
13
14
15# file and system info
16#---------------------------------
17codename = 'project.py' #used in copy_code_files
18
19home = getenv('INUNDATIONHOME') #Sandpit's parent dir   
20user = get_user_name()
21#needed when running using mpirun, mpirun doesn't inherit umask from .bashrc
22umask(002)
23
24print home
25
26# INUNDATIONHOME is the inundation directory, not the data directory.
27home =home + sep +'data'
28
29
30time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
31build_time = time+'_build'
32run_time = time+'_run'
33print 'time: ', time
34
35tide = 0.0
36
37#Making assumptions about the location of scenario data
38state = 'sri_lanka'
39scenario_name = 'galle'
40scenario = 'scenario_galle'
41'''
42# onshore data provided by WA DLI
43onshore_name = 'DLI_DTED_raster_clipped' # original
44
45# AHO + DPI data + colin French coastline
46coast_name = 'coastline_edited_w_DEM'
47offshore_name = 'clipped_bathy'
48offshore1_name = 'elev_501'
49offshore2_name = 'inferrec_e'
50
51#final topo name
52combined_name ='dampier_combined_elevation'
53combined_smaller_name = 'dampier_combined_elevation_small'
54combined_smallest_name = 'dampier_combined_elevation_smallest'
55'''
56anuga_dir = home+sep+state+sep+scenario+sep+'anuga'+sep
57
58#topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+
59topographies_dir = anuga_dir+'topographies'+sep
60
61# Filenames
62#data_dir = 'deliverables' + sep + 'points' + sep
63galle_dem_name = topographies_dir + 'galle'
64hikka_dem_name = topographies_dir +  'hikka'
65coast_name = topographies_dir + 'Coast'
66topo_dem_name = topographies_dir + 'topo'
67bathycoa_dem_name = topographies_dir + 'bathycoa'
68bathyfine_dem_name = topographies_dir + 'bathyfine'
69canal_dem_name = topographies_dir + 'canal'
70fort_dem_name = topographies_dir + 'gallefort'
71
72combined_dem_name = topographies_dir + 'combined'
73combined_canal_dem_name = topographies_dir + 'combined_canal'
74combined_small_dem_name = topographies_dir + 'combined_small'
75combined_canal_fort_dem_name = topographies_dir + 'combined_canal_fort'
76
77
78polygons_dir = anuga_dir+'polygons'+sep
79
80meshes_dir = anuga_dir+'meshes'+sep
81meshes_dir_name = meshes_dir + scenario_name
82
83#boundaries locations
84boundaries_name = 'Sumatra2004_crop'
85
86boundaries_in_dir = anuga_dir+'boundaries'+sep+'most'+sep
87boundaries_in_dir_name = boundaries_in_dir + boundaries_name
88boundaries_dir = anuga_dir+'boundaries'+sep
89boundaries_dir_name = boundaries_dir + boundaries_name
90
91#output locations
92output_dir = anuga_dir+'outputs'+sep
93output_build_time_dir = output_dir+build_time+sep
94output_run_time_dir = output_dir +run_time+sep
95output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
96
97
98###############################
99# Domain definitions
100###############################
101
102# poly_clip is used to remove small part from the large coarse 100m data set,
103# this hole is then filled with the high res 5m data
104print 'poly dir',polygons_dir
105poly_clip  = read_polygon(polygons_dir+ 'poly.csv')
106
107# bounding polygon for study area
108bounding_polygon = read_polygon(polygons_dir+'regional.csv')
109res_factor=1
110regional_res = 100000*res_factor
111print 'Area of bounding polygon', polygon_area(bounding_polygon)/1000000.0
112
113###############################
114# Interior region definitions
115###############################
116
117# interior polygons
118#poly_shallow1 = read_polygon(polygons_dir+'hikkaduwa.csv')
119#poly_shallow2 = read_polygon(polygons_dir+'galle.csv')
120
121poly_intermediate = read_polygon(polygons_dir+'intermediate.csv')
122poly_shallow = read_polygon(polygons_dir+'shallow.csv')
123poly_coast = read_polygon(polygons_dir+'coastmesh.csv')
124poly_canal = read_polygon(polygons_dir+'canalmesh.csv')
125
126intermediate_res = 20000*res_factor
127shallow_res = 2000*res_factor
128coast_res = 250*res_factor
129canal_res = 10*res_factor
130interior_regions = [[poly_intermediate, intermediate_res],
131                    [poly_shallow, shallow_res],
132                    [poly_coast, coast_res],
133                    [poly_canal, canal_res]]
134
135#plot_polygons([bounding_polygon,poly_intermediate,\
136#               poly_shallow,poly_coast,poly_canal],\
137#              'boundingpoly',verbose=False)
138
139trigs_min = number_mesh_triangles(interior_regions, bounding_polygon, regional_res)
140
141print 'min number triangles', trigs_min
142
143poly_mainland = read_polygon(polygons_dir+'Initial_Condition.csv')
144
145
146###################################################################
147# Clipping regions for export to asc and regions for clipping data
148###################################################################
149
150# exporting asc grid
151#eastingmin = 363000
152#eastingmax = 418000
153#northingmin = 8026600
154#northingmax = 8145700
155
156#for clipping (most) boundary file
157#south_source =
158#north_source =
159#west_source =
160#east_source =
161
162
163#gauge_filename = 'gauges.csv'
Note: See TracBrowser for help on using the repository browser.