code: def _fast_abs_percentile(map, percentile=80):
      """A fast version of the percentile of the absolute value."""
      if hasattr(map, "mask"):
          map = np.asarray(map[np.logical_not(map.mask)])
      map = np.abs(map)
      map = map.ravel()
      if quantile is not None:
          return quantile(map, 0.01 * percentile)
      map.sort()
      nb = map.size
      return map[int(0.01 * percentile * nb)]
  
imports: import warnings
  import numpy
  from scipy import ndimage, signal
label_desc: Use image node_id 1 for calling a global function with example usage: _fast_abs_percentile(map, percentile) and returns: map, quantile