def __lambda ( t, c, w = 10000, space=10, tc_ratio = 1.0, bg=0.00001):
    l = len(t[0])
    
    ret = array(FBYTE4,[])
    reta = ret.append

    for p in t[0]:
        s = max(0,p-w/2)
        e = p+w/2
        ss = max(0,p-50)
        se = p+50
        
        try:
            values = c.pp2v(s,e)
            ave = max(bg,sum(values)/w*space*tc_ratio)
        except:
            ave = bg
        try:
            values = c.pp2v(ss,se)
            ave = max(ave,sum(values)/100*space*tc_ratio)
        except:
            pass
        reta(ave)
    return ret
Calculate local lambdas
dataset/ETHPy150Open taoliu/taolib/Scripts/wig_call_peaks2.py/__lambda