source: production/onslow_2006/make_gauges.py @ 3158

Last change on this file since 3158 was 3158, checked in by sexton, 18 years ago

including pic to investigate incoming MOST wave

File size: 1.3 KB
Line 
1""" Make a line of gauges from outside boundary to near centre polygon
2for Onslow study to look at MOST wave and compare to ANUGA output
3"""
4import project
5from pylab import plot, xlabel, ylabel, title, ion, axis, savefig, close
6from utilities.polygon import poly_xy
7from Numeric import arange
8
9x_bound, y_bound = poly_xy(project.polyAll)
10
11# nominated point in centre region for Onslow
12x2 = 305000.0
13y2 = 7605000.0
14
15d0 = project.d0
16d1 = project.d1
17d2 = project.d2
18d3 = project.d3
19
20d = [d0, d1, d2, d3]
21ion()
22fid = open(project.gauge_comparison,'w')
23s = 'Easting,Northing,Name \n'
24fid.write(s)
25count = 0
26for i, point in enumerate(d):
27    x = point[0]
28    y = point[1]
29    m = (y-y2)/(x-x2)
30    c = y2-m*x2
31    if m > 0:
32        plotx = arange(240000,340000,1000.0)
33        for j, xpoint in enumerate(plotx):
34            name = 'Point%d' %count
35            count += 1
36            s = '%.2f,%.2f,%s \n' %(xpoint,m*xpoint+c,name)
37            fid.write(s)
38    else:
39        plotx = arange(240000,340000,5000.0)
40        for j, xpoint in enumerate(plotx):
41            name = 'Point%d' %count
42            count += 1
43            s = '%.2f,%.2f,%s \n' %(xpoint,m*xpoint+c,name)
44            fid.write(s)
45    plot(x_bound, y_bound, plotx,m*plotx+c,'+')
46
47axis([240000,340000, 7580000, 7800000])
48savefig('boundarycomparison')
49close('all')
Note: See TracBrowser for help on using the repository browser.