0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 if nargin<5, phiarray=[0,pi/2]; end;
0015 if nargin==5, phiarray=[0,phi1]; end;
0016 if nargin==6, phiarray=[phi1,phi2]; end;
0017
0018 lambda=stEfarAllP.lambda;
0019 theta=stEfarAllP.theta;
0020 nNbTheta=length(theta);
0021 indPosTheta=1:length(theta);
0022 indNegTheta=length(theta):-1:2;
0023
0024 thetaAll=[-theta(indNegTheta), theta];
0025
0026 sLegend=cell(1,length(lambda0));
0027 MdRadPhi=zeros(length(lambda0),nNbTheta);
0028 MdRadPhippi=zeros(length(lambda0),nNbTheta);
0029
0030 pnorm=sqrt(px^2+pz^2);
0031 pxnorm=px/pnorm;
0032 pznorm=pz/pnorm;
0033
0034
0035 scrsz = get(0,'ScreenSize');
0036 figAspectRatio=2;
0037 figWidth=scrsz(3)-100;
0038 figHeight=figWidth/figAspectRatio;
0039 figure('Name','Radiation profiles', ...
0040 'Position',[(scrsz(3)-figWidth)/2 50 figWidth figHeight]);
0041
0042 plength=0.6;
0043
0044 scol='brgm';
0045
0046
0047 for indphi=1:2
0048 phi=phiarray(indphi);
0049 MdMax=0;
0050 for ll=1:length(lambda0)
0051 ind=find(lambda==lambda0(ll),1);
0052 if isempty(ind)
0053 disp(['DipPlotEfarForP: lambda=' num2str(lambda0(ll)) ...
0054 ' cannot be found. Using lambda=' num2str(lambda(1)) ' instead']);
0055 ind=1;
0056 end
0057 Er2Phi=abs(pxnorm*cos(phi)*stEfarAllP.Ecr(ind,:)+pznorm*stEfarAllP.Em0r(ind,:)).^2;
0058 Et2Phi=abs(pxnorm*cos(phi)*stEfarAllP.Ect(ind,:)+pznorm*stEfarAllP.Em0t(ind,:)).^2;
0059 Ef2Phi=pxnorm^2*sin(phi)^2* abs(stEfarAllP.Esf(ind,:)).^2;
0060 MdRadPhi(ll,:)=(8*pi)/3*(Er2Phi+Et2Phi+Ef2Phi);
0061 MdMax=max(MdMax,max(MdRadPhi(ll,:)));
0062
0063
0064
0065 Er2Phippi=abs(-pxnorm*cos(phi)*stEfarAllP.Ecr(ind,:)+pznorm*stEfarAllP.Em0r(ind,:)).^2;
0066 Et2Phippi=abs(-pxnorm*cos(phi)*stEfarAllP.Ect(ind,:)+pznorm*stEfarAllP.Em0t(ind,:)).^2;
0067 MdRadPhippi(ll,:)=(8*pi)/3*(Er2Phippi+Et2Phippi+Ef2Phi);
0068 MdMax=max(MdMax,max(MdRadPhippi(ll,:)));
0069
0070 MRad=pxnorm^2*stEfarAllP.MRadPara(ind)+pznorm^2*stEfarAllP.MRadPerp(ind);
0071 if indphi==1
0072 sLegend{ll}=['\lambda=' num2str(lambda(ind)) 'nm'];
0073 else
0074 sLegend{ll}=['M_{Rad}=' num2str(MRad)];
0075 end
0076 end
0077
0078 hpl=subplot(1,2,indphi);
0079 set(hpl,'Outerposition',[0.5*(indphi-1),0,0.5,1]);
0080
0081 h = polar([0 2*pi], [0 MdMax]);
0082 delete(h);
0083 hold on;
0084 for ll=1:length(lambda0)
0085
0086
0087 h=polar(thetaAll,[MdRadPhippi(ll,indNegTheta), MdRadPhi(ll,indPosTheta)],scol(1+mod(ll-1,4)));
0088 end
0089 if(phi==0)
0090 curxlim=get(gca,'XLim');
0091 plength2=plength*curxlim(2);
0092 quiver(-pznorm/2*plength2,-pxnorm/2*plength2, ...
0093 pznorm*plength2,pxnorm*plength2,'Color',[0.5;0;0.5],'LineWidth',1.5,'MaxHeadSize',0.8);
0094 end
0095 rectangle('Position',curxlim(2)*[-0.5,-0.1,0.2,0.2],'Curvature',[1,1],...
0096 'FaceColor',[0.8 0.8 0.8]);
0097 hold off;
0098 title(['M^d_{Rad}(\theta,\phi=' num2str(phi) ') px=' num2str(px) ', pz=' num2str(pz)]);
0099
0100 legend(sLegend,'Location','NorthEastOutside');
0101 end