def pinv_diagsvd(s, m, L):
    t = s.dtype.char
    cond = {0: feps * 1e3, 1: eps * 1e6}[_array_precision[t]]
    cutoff = s[0] * cond
    Si = np.zeros((m, L), t)
    for i in range(len(s)):
        if s[i] > cutoff:
            Si[i, i] = 1.0 / np.conj(s[i])
    return Si
Construct the pseudo-inverse of the sigma matrix from singular values
dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/process/proc_lp.py/pinv_diagsvd