#Run bedslopephysical.py first then this # #Notice the statistics output from pyvolution.util import file_function f = file_function('bedslope.sww', quantities = ['stage', #Quantities we want to interpolate 'elevation', 'xmomentum', 'ymomentum'], interpolation_points = [ [0.0, 0.0], #Predefined points [0.5, 0.5], [0.8, 0.7]], verbose = True) #Now try to call the function f #This gives all four quantities at time=1.2 and for predefined point #indexed 1 (which is 0.5, 0.5) print f(1.2, 1) #To get e.g. xmomentum one may index the output with its number (2) print f(1.2, 1)[2] #xmomentum at time=1.2 and for point number 1 #To get a timeseries (arbitrary times within the limits) for stage at point #[0.8, 0.7] (index 2) t = 0.0 tmax = 4.0 #From file_function statistics! print print 'Table of interpolated values of stage' print 't f(t, 2)[0]' while t <= tmax: print '%.4f %.4f' %(t, f(t, 2)[0]) t += 0.1234