code: def tlog(x, th=1, r=_display_max, d=_l_mmax):
      
      if th <= 0:
          raise ValueError('Threshold value must be positive. %s given.' % th)
      return where(x <= th, log10(th) * 1. * r / d, log10(x) * 1. * r / d)
docs: Truncated log10 transform.
  
      Parameters
      ----------
      x : num | num iterable
          values to be transformed.
      th : num
          values below th are transormed to 0.
          Must be positive.
      r : num (default = 10**4)
          maximal transformed value.
      d : num (default = log10(2**18))
          log10 of maximal possible measured value.
          tlog(10**d) = r
  
      Returns
      -------
      Array of transformed values.