code: def mad_fltr(dem, n=3):
      
      mad, med = malib.mad(dem, return_med=True)
      print('Excluding values outside of range: {1:0.3f} +/- {0}*{2:0.3f}'.format(n, med, mad))
      rangelim = (med - n*mad, med + n*mad)
      out = range_fltr(dem, rangelim)
      return out
docs: Median absolute deviation * factor filter
  
      Robust outlier removal