0001
0002 d=read_arcSouth('22-Apr-2013:19:54:59','22-Apr-2013:20:55:01')
0003
0004
0005
0006 nd=d.antenna0.roach1.switchstatus;
0007
0008
0009 Il= mean(d.antenna0.roach1.LL(:,10:50),2);
0010 Ir= mean(d.antenna0.roach1.RR(:,10:50),2);
0011 IlLoad= mean(d.antenna0.roach1.load2(:,10:50),2);
0012 IrLoad= mean(d.antenna0.roach1.load1(:,10:50),2);
0013
0014 dnd=diff(nd);
0015 dndindexpos=find(dnd==1);
0016 nd(dndindexpos)=5;
0017 nd(dndindexpos+1)=5;
0018 nd(dndindexpos-1)=5;
0019 nd(dndindexpos+2)=5;
0020 nd(dndindexpos-2)=5;
0021 Il(dndindexpos)=0;
0022 Il(dndindexpos+1)=0;
0023 Il(dndindexpos-1)=0;
0024 Il(dndindexpos+2)=0;
0025 Il(dndindexpos-2)=0;
0026
0027 dndindexneg=find(dnd==-1);
0028 nd(dndindexneg)=5;
0029 nd(dndindexneg+1)=5;
0030 nd(dndindexneg-1)=5;
0031 nd(dndindexneg+2)=5;
0032 nd(dndindexneg-2)=5;
0033 Il(dndindexneg)=0;
0034 Il(dndindexneg+1)=0;
0035 Il(dndindexneg-1)=0;
0036 Il(dndindexneg+2)=0;
0037 Il(dndindexneg-2)=0;
0038
0039
0040 ndon=find(nd==1);
0041 ndoff=find(nd==0);
0042 nddiff=diff(nd);
0043 subplot(211),plot(dnd(1:100000))
0044 subplot(212),plot(ndon(1:100000),Il(ndon(1:100000)),'.')
0045 hold all
0046 plot(ndoff(1:100000),Il(ndoff(1:100000)),'.')
0047
0048
0049
0050
0051
0052 a=find(nd==1);
0053 b=find(diff(a)>50);
0054 c=a(b);
0055 d=a(b+1);
0056
0057 ndonEdges=[];
0058 for i=1:length(c)
0059 ndonEdges=[ndonEdges c(i) d(i)];
0060 end
0061
0062
0063
0064
0065 a=find(nd==0);
0066 b=find(diff(a)>50);
0067 c=a(b);
0068 d=a(b+1);
0069
0070 ndoffEdges=[];
0071 for i=1:length(c)
0072 ndoffEdges=[ndoffEdges c(i) d(i)];
0073 end
0074
0075
0076
0077 indexOn=[];
0078 indexOff=[];
0079 timeValOn=[];
0080 timeValOff=[];
0081 for i=1:length(ndonEdges)./2-1
0082 indexOn{i}=[ndonEdges(2*i):ndonEdges(2*i+1)];
0083 timeValOn(i)=mean(indexOn{i});
0084 i
0085 end
0086 for i=1:(length(ndoffEdges)./2-1)
0087 indexOff{i}=[ndoffEdges(2*i):ndoffEdges(2*i+1)];
0088 timeValOff(i)=mean(indexOff{i});
0089 end
0090
0091
0092 meanOn=[];
0093 meanOff=[];
0094 stdOn=[];
0095 stdOff=[];
0096
0097 for i=1:length(indexOn)
0098 meanOn(i)=mean(Il(indexOn{i}));
0099 stdOn(i)=std(Il(indexOn{i}));
0100 end
0101
0102 for i=1:length(indexOff)
0103 meanOff(i)=mean(Il(indexOff{i}));
0104 stdOff(i)=std(Il(indexOff{i}));
0105 end
0106
0107
0108 Ilndon=Il(ndon);
0109 Ilndoff=Il(ndoff);
0110
0111 plot(Ilndon)
0112 hold all
0113 plot(Ilndoff)
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123 #
0124 GNd = meanOn-meanOff;
0125 plot(deltaNd)
0126 gndts=timeseries(GNd(1:length(GNd)-1),timeValOn(1:length(GNd)-1));
0127 time=[1:length(Il)];
0128 Ilts=timeseries(Il,time);
0129
0130 gndtsResampled= resample(gndts, time)
0131
0132 gndres=gndtsResampled.Data(1,:);
0133
0134
0135
0136 Ilon=[];
0137 Iloff=[];
0138 for i=1:length(indexOn)
0139 Ilon(indexOn{i})=(Il(indexOn{i}))./GNd(i);
0140 end
0141
0142 for i=1:length(indexOff)
0143 meanOff(i)=mean(Il(indexOff{i}));
0144 end
0145
0146
0147 subplot(211)
0148
0149
0150
0151 plot(ndon./t)
0152 hold all
0153 plot(ndoff./t)
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165 plot(Il(indexOn{1}))
0166 hold all
0167 for i=2:1500
0168 plot(Il(indexOn{i}))
0169 end
0170
0171
0172 plot(Il(indexOff{1}))
0173
0174 for i=2:1500
0175 plot(Il(indexOff{i}))
0176 end
0177
0178
0179 plot(indexCuts,'.')
0180
0181 plot(Il)
0182