Home > SPlaC v1_0 > Mie > PWE > PwePlotEmap.m

PwePlotEmap

PURPOSE ^

Plots the results of PweEmap or PweVolProperties in terms of spatial distribution of EFs

SYNOPSIS ^

function PwePlotEmap(CstEmap,sLinLog,sHalf)

DESCRIPTION ^

 Plots the results of PweEmap or PweVolProperties in terms of spatial distribution of EFs
 Either the SERS EF or LFIEF or field EF can be plotted.
 Two plots are produced, for phi=0 and phi=90 degrees.

 Parameters:
 - CstEmap: Cell of stEmap structures
            or simply a stEmap structure if only one.
 - sLinLog: string optional
            determines the type of plot
            'Elinear', (F)^{1/4} is plotted on linear scale
            'Elog', (F)^{1/4} is plotted on log10 scale
            'Mlinear', (F)^{1/2} is plotted on linear scale
            'Mlog', (F)^{1/2} is plotted on log10 scale
            'Flinear', (F) is plotted on linear scale
            'Flog', (F) is plotted on log10 scale
            Default is 'Flog': the log10 of the SERS EFs are plotted.
 - sHalf:   string optional
            if sHalf='half' then plots are only on theta positive

 This file is part of the SPlaC v1.0 package (copyright 2008)
 Check the README file for further information

EXAMPLE OF OUTPUT ^

Example figure output

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 if nargin<3
0002     sHalf='full';
0003 end
0004 
0005 if nargin<2
0006     sLinLog='Flog';
0007 end
0008 
0009 nNbMap=length(CstEmap);
0010 
0011 % create, position, and resize figure
0012 scrsz = get(0,'ScreenSize'); % scrsz(3) contains screen width
0013 figAspectRatio=2;
0014 figWidth=scrsz(3);
0015 figure('Name','SERS EF maps', ...
0016     'Position',[(scrsz(3)-figWidth)/2 scrsz(4)-150-figWidth/figAspectRatio figWidth figWidth/figAspectRatio]);
0017 hax1=subplot(1,2,1); hold on;
0018 hax2=subplot(1,2,2); hold on;
0019 set(hax1,'Outerposition',[0,0,0.5,1.0])
0020 set(hax2,'Outerposition',[0.5,0,0.5,1.0])
0021 
0022 % loop through CstEmap and plot maps
0023 rMax=0;
0024 for nn=1:nNbMap
0025     if isstruct(CstEmap) % if single structure stEmap as argument
0026         F0E4phi0map=(abs(CstEmap.Ecr).^2+abs(CstEmap.Ect).^2).^2;
0027         F0E4phi90map=abs(CstEmap.Esf).^4;
0028         theta=CstEmap.theta;
0029         rVec=CstEmap.r;
0030         lambda0=CstEmap.lambda0;
0031     else % if cell of structure stEmap as arguments
0032         F0E4phi0map=(abs(CstEmap{nn}.Ecr).^2+abs(CstEmap{nn}.Ect).^2).^2;
0033         F0E4phi90map=abs(CstEmap{nn}.Esf).^4;
0034         theta=CstEmap{nn}.theta;
0035         rVec=CstEmap{nn}.r;
0036         lambda0=CstEmap{1}.lambda0; % same lambda0 for all in principle
0037         % lambda0 is used only for figure legend anyway
0038     end
0039 
0040     rMax=max(rMax,max(rVec)); % update rMax for axis scales
0041     
0042     % exclude r=0 (causes problem for contourf plotting)
0043     indr0=find(rVec==0);
0044     if ~isempty(indr0)
0045         indcor=[1:(indr0-1) (indr0+1):length(rVec)];
0046         rVec=rVec(indcor);
0047         F0E4phi0map=F0E4phi0map(indcor,:);
0048         F0E4phi90map=F0E4phi90map(indcor,:);
0049     end
0050 
0051     % computes what needs to be plotted
0052     switch lower(sLinLog)
0053         case 'elinear'
0054             F0E4phi0map=(F0E4phi0map).^(0.25);
0055             F0E4phi90map=(F0E4phi90map).^(0.25);
0056         case 'elog'
0057             F0E4phi0map=0.25*log10(F0E4phi0map);
0058             F0E4phi90map=0.25*log10(F0E4phi90map);
0059         case 'mlinear'
0060             F0E4phi0map=sqrt(F0E4phi0map);
0061             F0E4phi90map=sqrt(F0E4phi90map);
0062         case 'mlog'
0063             F0E4phi0map=0.5*log10(F0E4phi0map);
0064             F0E4phi90map=0.5*log10(F0E4phi90map);
0065         case 'flinear'
0066             % nothing already ok
0067         otherwise % assume 'Flog' as default
0068             F0E4phi0map=log10(F0E4phi0map);
0069             F0E4phi90map=log10(F0E4phi90map);
0070     end
0071 
0072     
0073     xymat = rVec * sin(theta); %  [R x T]
0074     zmat =  rVec * cos(theta); % [R x T]
0075     if strcmpi(sHalf,'half')
0076         % Half-contour-plot of log10(F0_E4)
0077         axes(hax1);
0078         contourf(xymat,zmat,F0E4phi0map);
0079         % Half-contour-plot of log10(F0_E4)
0080         axes(hax2);
0081         contourf(xymat,zmat,F0E4phi90map);
0082     else
0083         % Full-contour-plot of log10(F0_E4)
0084         indNegTheta=length(theta):-1:2;
0085         indAllTheta=[indNegTheta,1:length(theta)];
0086         axes(hax1);
0087         contourf([-xymat(:,indNegTheta), xymat],zmat(:,indAllTheta),F0E4phi0map(:,indAllTheta) );
0088         axes(hax2);
0089         contourf([-xymat(:,indNegTheta), xymat],zmat(:,indAllTheta),F0E4phi90map(:,indAllTheta) );
0090     end
0091 end
0092 
0093 switch lower(sLinLog)
0094     case 'elinear'
0095         sTitle='|E/E_0|';
0096     case 'elog'
0097         sTitle='log10 |E/E_0|';
0098     case 'mlinear'
0099         sTitle='M_{Loc}';
0100     case 'mlog'
0101         sTitle='log10 M_{Loc}';
0102     case 'flinear'
0103         sTitle='F_{E4}^0';
0104     otherwise % assume 'Flog' as default
0105         sTitle='log10 F_{E4}^0';
0106 end
0107 
0108 
0109 axes(hax1);
0110 axis equal;
0111 if strcmpi(sHalf,'half')
0112     axis([0 rMax -rMax rMax]);
0113 else
0114     axis([-rMax rMax -rMax rMax]);
0115 end
0116 hold off;
0117 caxis(get(gca,'CLim'))
0118 colorbar('peer',gca);
0119 xlabel('x [nm]');
0120 ylabel('z [nm]');
0121 title([sTitle '(\phi=0) at \lambda=' num2str(lambda0) 'nm']);
0122 
0123 axes(hax2);
0124 axis equal;
0125 if strcmpi(sHalf,'half')
0126     axis([0 rMax -rMax rMax]);
0127 else
0128     axis([-rMax rMax -rMax rMax]);
0129 end
0130 hold off;
0131 caxis(get(gca,'CLim'))
0132 colorbar('peer',gca);
0133 xlabel('y [nm]');
0134 ylabel('z [nm]');
0135 title([sTitle '(\phi=90^\circ) at \lambda=' num2str(lambda0) 'nm']);

This web page is part of the SPlaC package © 2008. Contact: Eric Le Ru
Generated on Wed 03-Dec-2008 11:10:14 by m2html © 2003 (adapted)