0001 function plotdata=plotERAperture(lindata,ring,dpp,varargin)
0002
0003
0004
0005
0006
0007
0008
0009 rapind=findcells(ring,'RApertures');
0010 eapind=findcells(ring,'EApertures');
0011
0012 xm=getcellstruct(ring,'RApertures',rapind,1);
0013 ym=getcellstruct(ring,'RApertures',rapind,3);
0014 xp=getcellstruct(ring,'RApertures',rapind,2);
0015 yp=getcellstruct(ring,'RApertures',rapind,4);
0016 eh=getcellstruct(ring,'EApertures',eapind,1);
0017 ev=getcellstruct(ring,'EApertures',eapind,2);
0018
0019 Xp=[nan(size(ring)); nan];
0020 Xm=Xp;
0021 Yp=Xp;
0022 Ym=Xp;
0023 Eh=Xp;
0024 Ev=Xp;
0025
0026 Xp(rapind)=xp;
0027 Xm(rapind)=xm;
0028 Yp(rapind)=yp;
0029 Ym(rapind)=ym;
0030 Eh(eapind)=eh;
0031 Ev(eapind)=ev;
0032
0033
0034 Xp=fixgaps(Xp);
0035 Xm=fixgaps(Xm);
0036 Yp=fixgaps(Yp);
0037 Ym=fixgaps(Ym);
0038 Eh=fixgaps(Eh);
0039 Ev=fixgaps(Ev);
0040
0041 plotdata(1).values=[Xp -Xm Yp -Ym]*1e2;
0042 plotdata(1).labels={'x ','x','y','y'};
0043 plotdata(1).axislabel='rectangular aperture [cm]';
0044
0045 plotdata(2).values=[Eh Ev]*1e2;
0046 plotdata(2).labels={'hor.','ver.'};
0047 plotdata(2).axislabel='elliptic aperture [cm]';
0048
0049
0050 end
0051
0052 function y=fixgaps(x)
0053
0054
0055
0056
0057
0058
0059
0060 y=x;
0061
0062
0063 bd=isnan(x);
0064 gd=find(~bd);
0065
0066 if length(gd)>2
0067
0068 bd([1:(min(gd)-1) (max(gd)+1):end])=0;
0069
0070
0071 y(bd)=interp1(gd,x(gd),find(bd));
0072 end
0073
0074 end