def absrange_fltr(dem, rangelim):
    """Absolute range filter 
    """
    out = range_fltr(np.ma.abs(dem), *rangelim)
    #Apply mask to original input
    out = np.ma.array(dem, mask=np.ma.getmaskarray(out))
    out.set_fill_value(dem.fill_value)
    return out
Absolute range filter