diff options
author | Bryan Newbold <bnewbold@charm.mit.edu> | 2008-02-11 21:40:22 -0500 |
---|---|---|
committer | Bryan Newbold <bnewbold@charm.mit.edu> | 2008-02-11 21:40:22 -0500 |
commit | 81a0c260d321da151e244548188d13a963bf111f (patch) | |
tree | 338d1c747730e1d3f899d7c51a6a848e6098d33d /calib_plots.py | |
download | scipy-jlab-81a0c260d321da151e244548188d13a963bf111f.tar.gz scipy-jlab-81a0c260d321da151e244548188d13a963bf111f.zip |
initialization and import of old files from 8.13 in fall 2006
Diffstat (limited to 'calib_plots.py')
-rw-r--r-- | calib_plots.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/calib_plots.py b/calib_plots.py new file mode 100644 index 0000000..a905d91 --- /dev/null +++ b/calib_plots.py @@ -0,0 +1,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) |