1 | """Common filenames and locations for topographic data, meshes and outputs. |
---|
2 | """ |
---|
3 | |
---|
4 | from os import sep, environ, getenv, getcwd |
---|
5 | from os.path import expanduser |
---|
6 | import sys |
---|
7 | from time import localtime, strftime, gmtime |
---|
8 | from anuga.utilities.polygon import read_polygon, plot_polygons, \ |
---|
9 | polygon_area, is_inside_polygon |
---|
10 | from anuga.coordinate_transforms.redfearn import convert_from_latlon_to_utm |
---|
11 | from time import localtime, strftime |
---|
12 | |
---|
13 | ############################### |
---|
14 | # Domain definitions |
---|
15 | ############################### |
---|
16 | ''' |
---|
17 | # Bathymetry and topography filenames |
---|
18 | bathymetry = 'phuket_utm47' |
---|
19 | |
---|
20 | # bounding polygon for study area |
---|
21 | bounding_polygon_latlon = read_polygon('phuket_boundary.csv') |
---|
22 | # only works for zone 47 |
---|
23 | south = 1000 |
---|
24 | east = -1000 |
---|
25 | west = 1000 |
---|
26 | north = -1000 |
---|
27 | for points in bounding_polygon_latlon: |
---|
28 | south = min(points[1],south) |
---|
29 | north = max(points[1],north) |
---|
30 | east = max(points[0],east) |
---|
31 | west = min(points[0],west) |
---|
32 | |
---|
33 | print "south, north, east, west", south, north, east, west |
---|
34 | |
---|
35 | time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
36 | #combined_dir_name = 'phuket_bathymetry'+time |
---|
37 | combined_dir_name = 'phuket_bathymetry' |
---|
38 | meshname = 'phuket_mesh'+time |
---|
39 | mesh_elevname = 'phuket_mesh'+time+'_elev' |
---|
40 | bathymetry_points = 'bathymetry_points'+time |
---|
41 | boundary_most_in = 'out' |
---|
42 | boundary_most_out = 'most_boundary_condition' |
---|
43 | ############################### |
---|
44 | # Interior region definitions |
---|
45 | ############################### |
---|
46 | ''' |
---|
47 | # location of polygons developed by John Jakeman April 2008 |
---|
48 | home = getenv('INUNDATIONHOME') + sep +'data'+sep |
---|
49 | anuga_dir = home+'anuga_validation'+sep+'boxing_day_sceanario'+sep+'anuga'+sep |
---|
50 | poly_dir = anuga_dir+'outputs'+sep+'john'+sep |
---|
51 | gauges_dir = anuga_dir+'gauges'+sep |
---|
52 | # interior polygons |
---|
53 | #poly_island1 = read_polygon('island1.csv') |
---|
54 | #poly_north_island = read_polygon('north_island.csv') |
---|
55 | #poly_50m_contour = read_polygon('phuket_50m_contour_small.csv') |
---|
56 | |
---|
57 | # bounding polygon |
---|
58 | poly_all = read_polygon(poly_dir + 'extent.csv')#'domain.csv') |
---|
59 | |
---|
60 | gauge_filename = 'gauges.csv' |
---|