code: def dz_fltr(dem_fn, refdem_fn, perc=None, rangelim=(0,30), smooth=False):
      
      try:
          open(refdem_fn)
      except IOError:
          sys.exit('Unable to open reference DEM: %s' % refdem_fn)
  
      from pygeotools.lib import warplib
      dem_ds, refdem_ds = warplib.memwarp_multi_fn([dem_fn, refdem_fn], res='first', extent='first', t_srs='first')
      dem = iolib.ds_getma(dem_ds)
      refdem = iolib.ds_getma(refdem_ds)
      out = dz_fltr_ma(dem, refdem, perc, rangelim, smooth)
      return out
docs: Absolute elevation difference range filter using values from a source raster file and a reference raster file