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

PweVolProperties

PURPOSE ^

Calculates several properties of the field everywhere up to r=rMax for a single wavelength

SYNOPSIS ^

function CstEmap=PweVolProperties(stM,lambda0,rMax,nNbRout,nNbRin,nNbTheta,stPinTaun)

DESCRIPTION ^

 Calculates several properties of the field everywhere up to r=rMax for a single wavelength

 Parameters:
 - stM:    structure with results of the Mie computation
           can be obtained by calling PweSolveSingleSphere
           or MulPweSolveMultiSphere with sCoeff='coeff'
 - lambda0: wavelength in nm (must obviously be one of the
            wavelengths computed in stM)
 - rMax:    scalar [1 x 1] non-zero
            distance from origin (in nm)
 - nNbRout: integer scalar [1 x 1] 
            number of r considered outside (zero if not required)
 - nNbRin:  if single sphere: integer scalar [1 x 1]
            number of r considered inside (zero if not required)
            if multi sphere: cell of K integer scalars one for each of 
            the K inside regions (from region 0 to region K-1)
 - nNbTheta: integer scalar
             number of theta points used for computations
 - stPinTaun: structure (optional)
              with functions of theta pi_n and tau_n
              if omitted, then the functions are computed from scrath
              it is faster to pass this structure as argument if these
              functions have already been calculated 
 
 Returns: cell (row) of structures of type stEmap (see PweEmap for details)
          for outside and inside computations (if both required)

 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 % find lambda0 and extract relevant coefficients
0002 lambda=stM.lambda;
0003 indLambda=find(lambda==lambda0,1);
0004 if isempty(indLambda)
0005         disp(['PweVolProperties: lambda0=' num2str(lambda0) ...
0006             ' cannot be found. Using lambda=' num2str(lambda(1)) ' instead']);
0007         indLambda=1;
0008 end
0009 
0010 % get theta dependence if not provided
0011 if nargin < 7
0012     theta=linspace(0,pi,nNbTheta); % row [1 x T]
0013     stPinTaun=PwePinTaun(stM.nNmax,transpose(theta)); % fields are [T x nNmax]
0014 end
0015 
0016 % computes outside map:
0017 nNbMap=0;
0018 if (nNbRout~=0)
0019     % extract epsilonM(lambda0)
0020     % the following is a trick to handle both scalar and vector epsilon
0021     epsilonM0=stM.epsilonM(min(length(stM.epsilonM),indLambda));
0022     disp ' ';
0023     disp 'PweVolProperties: computing outside map...';
0024     rVec=transpose(linspace(stM.a,rMax,nNbRout)); % [R x 1]
0025     stMieCcdn1L0.cn1=stM.cn1(indLambda,:); % [1 x N]
0026     stMieCcdn1L0.dn1=stM.dn1(indLambda,:); % [1 x N]
0027     nNbMap=nNbMap+1;
0028     CstEmap{1,nNbMap}=PweEmap(lambda0,epsilonM0,stMieCcdn1L0,rVec,nNbTheta,'Outside',stPinTaun);
0029     clear stMieCcdn1L0;
0030 end
0031 
0032 % computes inside maps:
0033 if ~isfield(stM,'nK') % then stM is for single sphere
0034     if (nNbRin~=0)  % do nothing if nNbRin=0
0035         % extract epsilonIn(lambda0)
0036         epsilonIn0=stM.epsilonIn(min(length(stM.epsilonIn),indLambda));
0037         disp ' ';
0038         disp 'PweVolProperties: computing single sphere inside map...';
0039         rVec=transpose(linspace(0,stM.a,nNbRin)); % [R x 1]
0040         stMieCabn1L0.an1=stM.alphan1(indLambda,:); % [1 x N]
0041         stMieCabn1L0.bn1=stM.betan1(indLambda,:); % [1 x N]
0042         nNbMap=nNbMap+1;
0043         CstEmap{1,nNbMap}=PweEmap(lambda0,epsilonIn0,stMieCabn1L0,rVec,nNbTheta,'Inside',stPinTaun);
0044     end
0045 else % then stM is for sphere multilayer
0046     disp ' ';
0047     disp 'PweVolProperties: computing multilayer sphere inside map...';
0048     nK=stM.nK;
0049     for kk=(nK-1):-1:0
0050         % for region kk
0051         if nNbRin{kk+1}~=0 % do not compute this region otherwise
0052             % extract epsilon_kk(lambda0)
0053             epsilonL0=stM.Cepsilon{kk+1}(min(length(stM.Cepsilon{kk+1}),indLambda));
0054             if kk==0
0055                 sRegion='Inside';
0056                 % r between 0 and a_{1}
0057                 rVec=transpose(linspace(0,stM.Ca{1},nNbRin{1})); % [R x 1]end
0058             else
0059                 sRegion='General';
0060                 % r between a_{kk-1} and a_{kk}
0061                 rVec=transpose(linspace(stM.Ca{kk},stM.Ca{kk+1},nNbRin{kk+1})); % [R x 1]end
0062                 % get corresponding coefficients (but not c and d when inside)
0063                 stMieCabcdn1L0.cn1=stM.Cgammakn1{kk+1}(indLambda,:); % [1 x N]
0064                 stMieCabcdn1L0.dn1=stM.Cdeltakn1{kk+1}(indLambda,:); % [1 x N]
0065             end
0066             stMieCabcdn1L0.an1=stM.Calphakn1{kk+1}(indLambda,:); % [1 x N]
0067             stMieCabcdn1L0.bn1=stM.Cbetakn1{kk+1}(indLambda,:); % [1 x N]
0068             nNbMap=nNbMap+1;
0069             % compute map
0070             CstEmap{1,nNbMap}=PweEmap(lambda0,epsilonL0,stMieCabcdn1L0,rVec,nNbTheta,sRegion,stPinTaun);
0071         end
0072     end
0073 end

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)