source: production/karratha_2005/get_timeseries.py @ 1896

Last change on this file since 1896 was 1896, checked in by ole, 19 years ago

Tried different gauges

File size: 1.7 KB
Line 
1"""Read in sww file, interpolate at specified locations and plot
2"""
3
4import project
5from pyvolution.util import file_function
6from pyvolution.coordinate_transforms.redfearn import degminsec2decimal_degrees, redfearn
7
8#swwfile = project.outputdir + project.basename + '.sww'
9swwfile = project.outputname + '_0.0tide' + '.sww'
10#swwfile = project.outputdir + 'karratha_100m_12m.sww'
11
12#MOST Boundary directly north of Legendre island
13y = project.north
14x = (project.p3[1] + project.p4[1])/2   #?????//
15z, easting, northing  = redfearn(y, x)
16
17
18#From Neil
19gauges = [[easting, northing],
20          [470882, 7717952],
21          [469390, 7715426],
22          [469214, 7714979],
23          [468899, 7715177],
24          [469038, 7715725],
25          [470285, 7717470]]
26         
27
28   
29#gauge_names = ['MOST',
30#               'Gauge_1', 'Gauge_2', 'Gauge_3',
31#               'Gauge_4', 'Gauge_5', 'Gauge_6']
32 
33
34#Read model output
35from caching import cache
36#f = file_function(swwfile,
37#                  quantities = 'stage',
38#                  interpolation_points = gauges,
39#                  verbose = True)
40
41f = cache(file_function, swwfile,
42          {'quantities': 'stage',
43           'interpolation_points': gauges,
44           'verbose': True},
45          compression = False, 
46          dependencies = [swwfile],
47          verbose = True)
48
49print f
50model_time = f.T
51
52
53
54for k, g in enumerate(gauges):
55    model_values = []
56    for i, t in enumerate(f.T):
57        val = f(t, point_id = k)[0]
58        model_values.append(val)
59
60    from pylab import *
61    ion()
62    hold(False)
63    plot(model_time, model_values, '-b')
64    name = 'Gauge_%d: %s' %(k, str(g))
65    title(name)
66   
67    savefig('Gauge_%d' %k)
68
69    raw_input('Next')
70show()
71
Note: See TracBrowser for help on using the repository browser.