source: production/onslow_2006/tides.py @ 3267

Last change on this file since 3267 was 2815, checked in by sexton, 19 years ago

moving files within production directory; scripts for report making and timeseries

File size: 828 bytes
Line 
1"""
2Data supplied by Phil O'Brien on Tuesday 18 April, 2006. Phil received
3data from National Tidal Centre.
4"""
5
6import project
7from pylab import*
8
9def get_data(filename):
10    fid = open(filename)
11    lines = fid.readlines()
12    fid.close()
13    tideheights = []
14    NODATA = 9999.000
15    for line in lines[1:]:
16        fields = line.split(',')
17        info = fields[0]
18        height = float(fields[1])
19        if height <> NODATA: tideheights.append(height)
20       
21    return tideheights, max(tideheights), min(tideheights)
22
23print project.tidal_filename
24
25heights, max_tide, min_tide = get_data(project.tidal_filename)
26
27fid = open(project.tidal_outname,'w')
28s = 'Tide Heights for Onslow: maximum %.6f minimum %.6f ' %(max_tide, min_tide)
29fid.write(s)
30
31#ion()
32#plot(range(len(heights)),heights)
Note: See TracBrowser for help on using the repository browser.