Calculates the Mie extinction, scattering and absorption coefficients for PWE from the Mie susceptibilities. The relevant formulae are given in Eqs. H.76, H.77, H.78. Parameters: - x: column vector [L x 1] wavelength-dependent x=kM*a (Eq. H.45) - stGD: structure with two fields, Gamma and Delta each a matrix [L x nNmax] with suceptibilities Gamma_n and Delta_n can be obtained from function GenSuscepGDAB Returns: structure stQ with three fields each a matrix [L x 1] - stQ.Qext: [L x 1] wavelength-dependent extinction coefficient - stQ.Qsca: [L x 1] wavelength-dependent scattering coefficient - stQ.Qabs: [L x 1] wavelength-dependent absorption coefficient This file is part of the SPlaC v1.0 package (copyright 2008) Check the README file for further information
0001 nNmax=size(stGD.Gamma,2); 0002 0003 n=transpose(1:nNmax); % [nNmax x 1] 0004 cc = 2.*n+1; % [nNmax x 1] 0005 0006 % From Eq. H.76 0007 Gamma2=abs(stGD.Gamma).^2; 0008 Delta2=abs(stGD.Delta).^2; 0009 scamat= Gamma2 + Delta2; % [L x nNmax] 0010 stQ.Qsca= 2./((x).^2) .* (scamat * cc); % [L x 1] 0011 % no checksum required since this is a sum of positive numbers 0012 0013 % Calculation of Qext 0014 % This may result in loss-of-precission warnings for non-absorbing sphere, 0015 % for which real(\Delta)=-|\Delta|^2 exactly 0016 % These are not an issue since in this case Qext=Qsca, and only 0017 % the calculation of Qsca should therefore be trusted. 0018 0019 % take real part and check for loss of precision 0020 GammaR=GenCheckSumReal(stGD.Gamma,'GammaR','PweQcoeff'); % [L x nNmax] 0021 DeltaR=GenCheckSumReal(stGD.Delta,'DeltaR','PweQcoeff'); % [L x nNmax] 0022 % From Eq. H.77 0023 stQ.Qext= - 2./((x).^2) .* ((GammaR+DeltaR) * cc); % [L x 1] 0024 % sum is on negative numbers only, no loss of precision 0025 0026 % From Eq. H.78 0027 stQ.Qabs = stQ.Qext - stQ.Qsca; % [L x 1] 0028