<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tlog(x, th=1, r=_display_max, d=_l_mmax):
 """ 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. """

    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)