def slope(data, cell_width, cell_height):
    rise = ((data[6] + (2 * data[7]) + data[8]) -
            (data[0] + (2 * data[1]) + data[2])) / \
           (8 * cell_height)
    run =  ((data[2] + (2 * data[5]) + data[8]) -
            (data[0] + (2 * data[3]) + data[6])) / \
           (8 * cell_width)
    dist = np.sqrt(np.square(rise) + np.square(run))
    return np.arctan(dist) * 180 / np.pi

# Read the data as floating point.
Calculates slope using a 3x3 window.
dataset/ETHPy150Open cgarrard/osgeopy-code/Chapter11/listing11_7.py/slope