def calculate_difference(dsm_array, dtm):
    """Calculate the difference between the dsm and dtm"""
    dtm_array = dtm.read(1, masked = True)
    difference = dsm_array - dtm_array
    difference.data[difference < 0] = 0 # We set to 0 anything that might have been negative
    return difference