""" Data supplied by Phil O'Brien on Tuesday 18 April, 2006. Phil received data from National Tidal Centre. """ import project from pylab import* def get_data(filename): fid = open(filename) lines = fid.readlines() fid.close() tideheights = [] NODATA = 9999.000 for line in lines[1:]: fields = line.split(',') info = fields[0] height = float(fields[1]) if height <> NODATA: tideheights.append(height) return tideheights, max(tideheights), min(tideheights) print project.tidal_filename heights, max_tide, min_tide = get_data(project.tidal_filename) fid = open(project.tidal_outname,'w') s = 'Tide Heights for Onslow: maximum %.6f minimum %.6f ' %(max_tide, min_tide) fid.write(s) #ion() #plot(range(len(heights)),heights)