1 | """Common filenames and locations for topographic data, meshes and outputs. |
---|
2 | Author: John Jakeman, The Australian National University (2008) |
---|
3 | """ |
---|
4 | |
---|
5 | from os import sep, environ, getenv, getcwd |
---|
6 | from os.path import expanduser |
---|
7 | import sys |
---|
8 | from time import localtime, strftime, gmtime |
---|
9 | from anuga.utilities.polygon import read_polygon, plot_polygons, \ |
---|
10 | polygon_area, is_inside_polygon |
---|
11 | from anuga.coordinate_transforms.redfearn import convert_from_latlon_to_utm |
---|
12 | from time import localtime, strftime |
---|
13 | |
---|
14 | def convert_arcgis_latlon_list_to_utm(points): |
---|
15 | #Used because arc gis produced csv files put lat lon in |
---|
16 | #reverse order to those accpeted by convert_latlon_to_utm() |
---|
17 | |
---|
18 | from anuga.coordinate_transforms.geo_reference import Geo_reference |
---|
19 | from anuga.coordinate_transforms.redfearn import redfearn |
---|
20 | old_geo = Geo_reference() |
---|
21 | utm_points = [] |
---|
22 | for point in points: |
---|
23 | zone, easting, northing = redfearn(float(point[1]),float(point[0])) |
---|
24 | new_geo = Geo_reference(zone) |
---|
25 | old_geo.reconcile_zones(new_geo) |
---|
26 | utm_points.append([easting,northing]) |
---|
27 | |
---|
28 | return utm_points, old_geo.get_zone() |
---|
29 | |
---|
30 | ############################### |
---|
31 | # Domain definitions |
---|
32 | ############################### |
---|
33 | |
---|
34 | # Bathymetry and topography filenames |
---|
35 | dir='data' |
---|
36 | |
---|
37 | time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir |
---|
38 | poor_combined_dir_name = dir+sep+'poor_phuket_bathymetry' |
---|
39 | good_combined_dir_name = dir+sep+'good_phuket_bathymetry' |
---|
40 | meshname = 'phuket_mesh' |
---|
41 | mesh_elevname = 'phuket_mesh_elev' |
---|
42 | boundary_most_in = dir+sep+'out' |
---|
43 | boundary_most_out = dir+sep+'most_boundary_condition' |
---|
44 | |
---|
45 | dir='mesh_polygons' |
---|
46 | #extent = 'extent.csv' |
---|
47 | extent = 'boundary_new_pts.csv' |
---|
48 | # bounding polygon for study area |
---|
49 | bounding_polygon = read_polygon(dir+sep+extent) |
---|
50 | patong_bay_polygon = read_polygon(dir+sep+'patong_bay_polygon.csv') |
---|
51 | |
---|
52 | ############################### |
---|
53 | # Interior region definitions |
---|
54 | ############################### |
---|
55 | |
---|
56 | island_south = read_polygon(dir+sep+'south_island.csv') |
---|
57 | island_south2 = read_polygon(dir+sep+'south_island2.csv') |
---|
58 | island_north = read_polygon(dir+sep+'north_island.csv') |
---|
59 | bay = read_polygon(dir+sep+'bay.csv') |
---|
60 | patong = read_polygon(dir+sep+'patong.csv') |
---|
61 | contour20m = read_polygon(dir+sep+'20m.csv') |
---|
62 | |
---|
63 | |
---|
64 | |
---|
65 | #max_extent_of MOST file |
---|
66 | #east = 94.93325 |
---|
67 | #west = 80.0003 |
---|
68 | #north = 10.0000 |
---|
69 | #south = -4.9330 |
---|
70 | |
---|
71 | #max_extent_of MOST file should be |
---|
72 | #east = 104.0 |
---|
73 | #west = 80.0 |
---|
74 | #north = 10.0 |
---|
75 | #south = -5.0 |
---|
76 | |
---|
77 | #max_extent of ol simulation is why does this work and not below |
---|
78 | #7.40911081272 8.71484358635 99.1683687224 97.513856322 |
---|
79 | |
---|
80 | #max extent of clipped MOST file |
---|
81 | east = 100 |
---|
82 | west = 96.0 |
---|
83 | north = 9.0 |
---|
84 | south = 6.0 |
---|
85 | |
---|
86 | |
---|