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 | """ |
---|
2 | Data supplied by Phil O'Brien on Tuesday 18 April, 2006. Phil received |
---|
3 | data from National Tidal Centre. |
---|
4 | """ |
---|
5 | |
---|
6 | import project |
---|
7 | from pylab import* |
---|
8 | |
---|
9 | def 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 | |
---|
23 | print project.tidal_filename |
---|
24 | |
---|
25 | heights, max_tide, min_tide = get_data(project.tidal_filename) |
---|
26 | |
---|
27 | fid = open(project.tidal_outname,'w') |
---|
28 | s = 'Tide Heights for Onslow: maximum %.6f minimum %.6f ' %(max_tide, min_tide) |
---|
29 | fid.write(s) |
---|
30 | |
---|
31 | #ion() |
---|
32 | #plot(range(len(heights)),heights) |
---|
Note: See
TracBrowser
for help on using the repository browser.