summaryrefslogtreecommitdiffstats
path: root/calib_plots.py
blob: a905d91f396c225458daed0622ac0e98a647b95e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

def find_peaks(x,num=8):
    d = x;
    #figure();
    #plot(d);

    peaks = r_[0.:num];
    i = 0;
    mmm = max(d)
    for p in range(0,int(num)):
        while (d[i] < mmm*.2):
            i += 1;
        peaks[p] = 0.;
        for n in range(-1,10):
            peaks[p] += r_[i+n]*d[i+n]
        peaks[p] = peaks[p]/sum(d[i-1:i+9])
        i += 13
    return peaks;


def fit_peaks(p):
    l=lambda a,x:a[0]*x+a[1]
    print p; 
    plotfit(fittodata_linear(r_[0.:size(p)],p,[25.,1.],err=.5*ones(size(p)),ret_all=True));

def plot_mcacalib():
    figure();
    plot(fmca_calib[0:450]);
    txt = text(0.22,.75,"delta-T/",
            horizontalalignment='center',
            verticalalignment='center',
            transform = ax.transAxes)