1 | fname='20140127/data_SPESO_2014-01-27_21-15-31_dec.txt' |
---|
2 | basename='./'; |
---|
3 | |
---|
4 | samplesPerMs=132; |
---|
5 | initialCutPosition=20; |
---|
6 | SecondTriggerPosition=43552; |
---|
7 | rangeSgn1=initialCutPosition:10*samplesPerMs; |
---|
8 | rangeSgn1b=initialCutPosition:50*samplesPerMs; |
---|
9 | rangeBkgd1=50*samplesPerMs:SecondTriggerPosition-100*samplesPerMs; |
---|
10 | rangeSgn2=SecondTriggerPosition+100:SecondTriggerPosition+10*samplesPerMs; |
---|
11 | rangeSgn2b=SecondTriggerPosition+100:SecondTriggerPosition+50*samplesPerMs; |
---|
12 | rangeBkgd2=SecondTriggerPosition+50*samplesPerMs:SecondTriggerPosition+(50+50)*samplesPerMs; |
---|
13 | |
---|
14 | |
---|
15 | filename=[ basename fname ]; |
---|
16 | fid=fopen(filename) |
---|
17 | if (fid==0) |
---|
18 | error( [ 'fid==0: ' filename ]); |
---|
19 | end |
---|
20 | txt=fread(fid); |
---|
21 | while (~feof(fid)) |
---|
22 | txt2=fread(fid); |
---|
23 | txt = [txt txt2]; |
---|
24 | end %while |
---|
25 | fclose(fid); |
---|
26 | |
---|
27 | %char(txt') |
---|
28 | |
---|
29 | signals=zeros(6,20); |
---|
30 | |
---|
31 | data=str2num(char(txt')); |
---|
32 | size(data) |
---|
33 | |
---|
34 | for iloop=[7 8 9 10 12 13 15] |
---|
35 | |
---|
36 | signals(1,iloop)=mean(data(rangeSgn1,iloop)); |
---|
37 | signals(2,iloop)=mean(data(rangeSgn1b,iloop)); |
---|
38 | signals(3,iloop)=mean(data(rangeBkgd1,iloop)); |
---|
39 | signals(4,iloop)=mean(data(rangeSgn2,iloop)); |
---|
40 | signals(5,iloop)=mean(data(rangeSgn2b,iloop)); |
---|
41 | signals(6,iloop)=mean(data(rangeBkgd2,iloop)); |
---|
42 | |
---|
43 | figure(iloop) |
---|
44 | clf |
---|
45 | plot(data(:,iloop)) |
---|
46 | |
---|
47 | figure(1000+iloop) |
---|
48 | clf |
---|
49 | hold on |
---|
50 | for jloop=1:6 |
---|
51 | if (mod(jloop,3)==2) |
---|
52 | symb='s'; |
---|
53 | else |
---|
54 | symb='o'; |
---|
55 | end |
---|
56 | plot(jloop,signals(jloop,iloop), [ symb 'r' ] ); |
---|
57 | end |
---|
58 | hold off |
---|
59 | |
---|
60 | end |
---|
61 | |
---|
62 | |
---|
63 | figure(9012) |
---|
64 | clf |
---|
65 | hold on |
---|
66 | %plot(data(1:10,12)) |
---|
67 | plot(data(43540:43560,12)) |
---|
68 | hold off |
---|
69 | |
---|