1 | from pylab import * |
---|
2 | from geospatial_data import * |
---|
3 | from pmesh.create_mesh import convert_points_from_latlon_to_utm |
---|
4 | from coordinate_transforms.redfearn import degminsec2decimal_degrees |
---|
5 | from os import sep |
---|
6 | from utilities.polygon import inside_polygon |
---|
7 | import project |
---|
8 | |
---|
9 | |
---|
10 | datadir = project.datadir |
---|
11 | ion() |
---|
12 | hold(False) |
---|
13 | |
---|
14 | file1 = datadir+'onslow_onshore_30m_dted.pts' |
---|
15 | file2 = datadir+'onslow_offshore_points.xya' |
---|
16 | |
---|
17 | G1 = Geospatial_data(file_name = file1) |
---|
18 | G2 = Geospatial_data(file_name = file2) |
---|
19 | |
---|
20 | pts1 = G1.get_data_points(absolute = True) |
---|
21 | pts2 = G2.get_data_points(absolute = True) |
---|
22 | z1 = G1.get_attributes() |
---|
23 | z2 = G2.get_attributes() |
---|
24 | |
---|
25 | minz1 = min(z1) |
---|
26 | maxz1 = max(z1) |
---|
27 | minz2 = min(z2) |
---|
28 | maxz2 = max(z2) |
---|
29 | |
---|
30 | print '' |
---|
31 | print 'Offshore elevation in range [%.2f %.2f] ' %(minz1, maxz1) |
---|
32 | print 'Onshore elevation in range [%.2f %.2f] ' %(minz2, maxz2) |
---|
33 | print '' |
---|
34 | |
---|
35 | minelev = min(minz1,minz2) |
---|
36 | maxelev = max(maxz1,maxz2) |
---|
37 | |
---|
38 | # bounding polygon for Onslow scenario |
---|
39 | polygon_bound = project.polyAll |
---|
40 | |
---|
41 | x_bound = [] |
---|
42 | y_bound = [] |
---|
43 | n = len(polygon_bound) |
---|
44 | for i in range(n+1): |
---|
45 | if i == n: |
---|
46 | thispt = polygon_bound[0] |
---|
47 | else: |
---|
48 | thispt = polygon_bound[i] |
---|
49 | x_bound.append(thispt[0]) |
---|
50 | y_bound.append(thispt[1]) |
---|
51 | |
---|
52 | # interior regions |
---|
53 | figure(1) |
---|
54 | plot(pts1[:,0],pts1[:,1],'g.', |
---|
55 | pts2[:,0],pts2[:,1],'b.', |
---|
56 | x_bound,y_bound,'r-') |
---|
57 | #title('Offhore (g) and onshore (b) data: Onslow scenario. \n Elevation in range [%.2f %.2f]' %(minelev, maxelev)) |
---|
58 | xlabel('x') |
---|
59 | ylabel('y') |
---|
60 | savefig('onslow_data_extent') |
---|
61 | |
---|
62 | |
---|