source: production/onslow_2006/tides.py @ 2721

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

Working out max and min tide heights for Onslow scenario

File size: 740 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
7
8def get_data(filename):
9    fid = open(filename)
10    lines = fid.readlines()
11    fid.close()
12    tideheights = []
13    NODATA = 9999.000
14    for line in lines[1:]:
15        fields = line.split(',')
16        info = fields[0]
17        height = float(fields[1])
18        if height <> NODATA: tideheights.append(height)
19       
20    return max(tideheights), min(tideheights)
21
22print project.tidal_filename
23
24max_tide, min_tide = get_data(project.tidal_filename)
25
26fid = open(project.tidal_outname,'w')
27s = 'Tide Heights for Onslow: maximum %.6f minimum %.6f ' %(max_tide, min_tide)
28fid.write(s)
Note: See TracBrowser for help on using the repository browser.