PageRenderTime 27ms CodeModel.GetById 25ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/matlab/CalcMeanMCP2SumCounts.asv

http://github.com/Yniold/liftsrc
Unknown | 19 lines | 18 code | 1 blank | 0 comment | 0 complexity | afaf72ec62a84f72316835eddd687a0f MD5 | raw file
 1%find last 10 s in each etalon position
 2
 3etaOnlinePos=int16(statusData(:,803));
 4etaCurPos=int16(statusData(:,645));
 5online=PMTSumCounts'>2500 & abs(etaCurPos-etaOnlinePos)<20;
 6offline1=PMTSumCounts'<=2500 & (etaCurPos-etaOnlinePos)==-600;
 7offline2=PMTSumCounts'<=2500 & (etaCurPos-etaOnlinePos)==600; 
 8for i=85:size(iZeit,1)
 9if online(iZeit(i))==1
10    MeanMCP2SumCounts(iZeit(i))=mean(MCP2SumCounts(online(iZeit(i-(9*5)):iZeit(i))==1));
11elseif offline1(iZeit(i))==1
12    MeanMCP2SumCounts(iZeit(i))=mean(MCP2SumCounts(offline1(iZeit(i-(19*5)):iZeit(i))==1));
13elseif offline2(iZeit(i))==1
14    MeanMCP2SumCounts(iZeit(i))=mean(MCP2SumCounts(offline2(iZeit(i-(19*5)):iZeit(i))==1));
15else
16    MeanMCP2SumCounts(iZeit(i))=NaN;
17end
18if size(MeanMCP2SumCounts)<i MeanMCP2SumCounts(i)=NaN; end
19end