In [1]:
%pylab inline
In [2]:
import numpy as np
In [3]:
x=[3280, 3382, 3455]
y=[2331, 1935, 1818]
In [4]:
dx = np.diff(x)
dy = np.diff(y)
print dx
print dy
In [8]:
print (dy * 100) / dx / 1000. # mm/100m * 1m / 1000mm
In [22]:
import matplotlib as mpl
import matplotlib.pyplot as plt
In [23]:
plt.plot(x,y)
plt.xlabel('Elevation (m)')
plt.ylabel('Ablation (mm)')
plt.title('Ablation measurements at Karabatkak Glacier')
Out[23]:
In [24]:
dydx = dy.astype(float)/dx
print dydx # mm / m
In [25]:
plt.savefig('karabatkak_abl_grad.png')
In [25]: