Home > atmlab > mie > mie_tetascanall.m

mie_tetascanall

PURPOSE ^

Computation and plot of Mie Power Scattering and diffraction functions

SYNOPSIS ^

function result = Mie_tetascanall(m, x, nsteps, nsmooth, type)

DESCRIPTION ^

 Computation and plot of Mie Power Scattering and diffraction functions 
 for complex refractive-index ratio m=m'+im", size parameters x=k0*a, 
 according to Bohren and Huffman (1983) BEWI:TDD122
 1) polar diagram, linear or in dB scale with respect to minimum, with
 SL in upper semicircle, SR in lower semicircle and 3 cartesian diagrams
 2) same for SL0 and SR0 without diffraction pattern, 
 3) scattered intensity S (lin or log scale), and degree of polarisation
 4) scattered intensity without diffraction peak S0 (lin or log scale),
 5) beam efficiencies of S and S0, diffraction efficiency Qd
 6) gi-factors (coefficients of Legendre Polynomials of Phase Function).
 nsteps: number of scattering angles (for accurate comp. use nsteps=22*x)
 nsmooth: number of values to be averaged in polarisation, S and S0 
 (for 'log' type only)
 type:= 'log' or 'lin' for logarithmic or linear plots
 C. M�zler, April 2004.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

mie_tetascanall.m

SOURCE CODE ^

0001 function result = Mie_tetascanall(m, x, nsteps, nsmooth, type)
0002 
0003 % Computation and plot of Mie Power Scattering and diffraction functions
0004 % for complex refractive-index ratio m=m'+im", size parameters x=k0*a,
0005 % according to Bohren and Huffman (1983) BEWI:TDD122
0006 % 1) polar diagram, linear or in dB scale with respect to minimum, with
0007 % SL in upper semicircle, SR in lower semicircle and 3 cartesian diagrams
0008 % 2) same for SL0 and SR0 without diffraction pattern,
0009 % 3) scattered intensity S (lin or log scale), and degree of polarisation
0010 % 4) scattered intensity without diffraction peak S0 (lin or log scale),
0011 % 5) beam efficiencies of S and S0, diffraction efficiency Qd
0012 % 6) gi-factors (coefficients of Legendre Polynomials of Phase Function).
0013 % nsteps: number of scattering angles (for accurate comp. use nsteps=22*x)
0014 % nsmooth: number of values to be averaged in polarisation, S and S0
0015 % (for 'log' type only)
0016 % type:= 'log' or 'lin' for logarithmic or linear plots
0017 % C. M�zler, April 2004.
0018 
0019 nstart=round(min(0.5*nsteps,nsteps*pi/x+nsmooth));
0020 m1=real(m); m2=imag(m);
0021 nx=(1:nsteps); dteta=pi/nsteps;
0022 Q=mie(m,x);  Qext=Q(1); Qsca=Q(2); Qabs=Q(3); Qb=Q(4); asy=Q(5);
0023 nmax=round(2+x+4*x^(1/3));
0024 ab=mie_ab(m,x); an=ab(1,:); bn=ab(2,:);
0025 teta=(nx-0.5).*dteta; tetad=teta*180/pi;
0026 u=cos(teta); s=sin(teta);
0027 px=pi*x^2;
0028 st=pi*s*dteta/Qsca;
0029 for j = 1:nsteps, 
0030     pt=mie_pt(u(j),nmax);
0031     pin =pt(1,:);
0032     tin =pt(2,:);
0033     n=(1:nmax);
0034     n2=(2*n+1)./(n.*(n+1));
0035     pin=n2.*pin; tin=n2.*tin;
0036     S1=(an*pin'+bn*tin'); 
0037     S2=(an*tin'+bn*pin');
0038     xs=x.*s(j);
0039     if abs(xs)<0.00002         % Diffraction pattern according to BH, p. 110
0040         S3=x.*x*0.25.*(1+u(j));    % avoiding division by zero
0041     else
0042         S3=x.*x*0.5.*(1+u(j)).*besselj(1,xs)./xs;    
0043     end;
0044     S4=S1-S3;
0045     S5=S2-S3;
0046     SR(j)= real(S1'*S1)/px;
0047     SL(j)= real(S2'*S2)/px;
0048     SD(j)= real(S3'*S3)/px;        
0049     SR0(j)=real(S4'*S4)/px;        
0050     SL0(j)=real(S5'*S5)/px;        
0051 end;
0052 z=st.*(SL+SR);
0053 z0=st.*(SL0+SR0);
0054 
0055 nj=11;             % Phase fct decomposition in Legendre Polynomials
0056 for jj=1:nj,
0057     xa=legendre(jj-1,u);
0058     x0=xa(1,:);
0059     gi(jj)=x0*z';    % beam efficiency, asymm. factor and higher gi's
0060     g0i(jj)=x0*z0';  % same as gi's, but diffraction signal removed
0061 end;
0062 etab=gi(1);     gi=gi/etab;     gi=gi(2:nj);
0063 etab0=g0i(1);   g0i=g0i/etab0;  g0i=g0i(2:nj);
0064 Qd=Qsca*(1-etab0);           % Qd = diffraction efficiency
0065 z=cumsum(z);                 % Beam Efficiency vs. tetalim
0066 z0=cumsum(z0);
0067 
0068 S=(SL+SR); S0=(SL0+SR0);     % Intensity
0069 Ss=smooth(S,nsmooth); S0s=smooth(S0,nsmooth);
0070 dS=(SR-SL)./S;          % Degree of polarisation
0071 dSs=smooth(dS,nsmooth);
0072 
0073 figure;
0074 if type=='lin'                   % linear plots
0075     y=[teta teta+pi;SR SL(nsteps:-1:1)]'; 
0076     polar(y(:,1),y(:,2)),
0077     title(sprintf('Mie Scattering Diagram: m=%g+%gi, x=%g',m1,m2,x)),
0078     xlabel('Scattering Angle'),
0079 figure;
0080 subplot(2,1,1);
0081     plot(tetad,S,'k-')
0082     title(sprintf('Mie Angular Scattering: m=%g+%gi, x=%g',m1,m2,x)),
0083     xlabel('Scattering Angle'),
0084     ylabel('S');
0085 subplot(2,1,2);
0086     plot(tetad,dS,'k-')
0087     xlabel('Scattering Angle'),
0088     ylabel('Polarisation Degree ');
0089 elseif type=='log',              % logar. plots
0090     y=[teta teta+pi;10*log10(SR) 10*log10(SL(nsteps:-1:1))]';
0091     ymin=min(y(:,2));            % Minimum for normalisation of log-polar plot
0092     y(:,2)=y(:,2)-ymin;                  
0093     polar(y(:,1),y(:,2)),
0094     title(sprintf('Mie Scattering Diagram: m=%g+%gi, x=%g, min(dB)= %g',m1,m2,x,ymin)),
0095     xlabel('Scattering Angle (deg)');
0096     y=[teta teta+pi;10*log10(SR0) 10*log10(SL0(nsteps:-1:1))]';
0097     ymin=min(y(:,2));            % Minimum for normalisation of log-polar plot
0098     y(:,2)=y(:,2)-ymin;                  
0099 figure;
0100     polar(y(:,1),y(:,2)),
0101     title(sprintf('No-Peak Scattering Diagram: m=%g+%gi, x=%g, min(dB)= %g',m1,m2,x,ymin)),
0102     xlabel('Scattering Angle (deg)');
0103 figure;
0104 subplot(2,1,1);
0105     semilogy(tetad,Ss,'k-'),    
0106     title(sprintf('Mie Angular Scattering: m=%g+%gi, x=%g',m1,m2,x)),
0107     xlabel('Scattering Angle'),
0108     ylabel('S');
0109 subplot(2,1,2);
0110     plot(tetad,dSs,'k-'),
0111     xlabel('Scattering Angle'),
0112     ylabel('Polarisation Degree ');
0113 figure;
0114     semilogy(tetad(nstart:nsteps),Ss(nstart:nsteps),'r:',tetad,S0s,'k-'),    
0115     title(sprintf('No-Peak Angular Scattering: m=%g+%gi, x=%g',m1,m2,x)),
0116     xlabel('Scattering Angle'),
0117     ylabel('S0');
0118 figure;
0119     xmin=min(tetad/180);
0120     semilogx(tetad/180,z,'r-',tetad/180,z0,'k--',tetad/180,z-z0,'b:'),
0121     xlabel('Maximum Scattering Angle/180�'),
0122     axis([xmin, 1, 0, 1.1]);
0123 end;
0124 result.s=[tetad',SR',SL',SR0',SL0',SD',dS',z',z0']; 
0125 result.Q=[Qext,Qsca,Qabs,Qb,Qd,asy];
0126 result.gi=gi;
0127 result.g0i=g0i;

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005