Home > atmlab > scattering > mie_arts_scat_data.m

mie_arts_scat_data

PURPOSE ^

MIE_ARTS_SCAT_DATA Creates single scattering properties for spherical

SYNOPSIS ^

function ssp = mie_arts_scat_data(f_grid, T_grid, rfr_ind, theta, r)

DESCRIPTION ^

  MIE_ARTS_SCAT_DATA   Creates single scattering properties for spherical 
                       particles following the ARTS format
 
  As input a matrix containing the refractive indices for the
  freqeuncies and temperatures given in f_grid and T_grid is
  required. 

  The function uses the Mie code by C. Mätzler
     
   FORMAT  ssp = mie_arts_scat_data(f_grid,T_grid,rfr_index,theta,r) 
   
   OUT     ssp      single scattering data
   IN      f_grid   frequency grid [Hz]  (vector)
   IN      T_grid   temperature grid [K] (vector)
   IN      rfr_ind  refractive indices, matrix with dimension
                    [f_grid, T_grid] 
   IN      theta    scattering angle grid [deg]
   IN      r        particle radius [m]

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

mie_arts_scat_data.m

SOURCE CODE ^

0001 %  MIE_ARTS_SCAT_DATA   Creates single scattering properties for spherical
0002 %                       particles following the ARTS format
0003 %
0004 %  As input a matrix containing the refractive indices for the
0005 %  freqeuncies and temperatures given in f_grid and T_grid is
0006 %  required.
0007 %
0008 %  The function uses the Mie code by C. Mätzler
0009 %
0010 %   FORMAT  ssp = mie_arts_scat_data(f_grid,T_grid,rfr_index,theta,r)
0011 %
0012 %   OUT     ssp      single scattering data
0013 %   IN      f_grid   frequency grid [Hz]  (vector)
0014 %   IN      T_grid   temperature grid [K] (vector)
0015 %   IN      rfr_ind  refractive indices, matrix with dimension
0016 %                    [f_grid, T_grid]
0017 %   IN      theta    scattering angle grid [deg]
0018 %   IN      r        particle radius [m]
0019 
0020 %    Created by Claudia Emde.
0021 
0022 
0023 function ssp = mie_arts_scat_data(f_grid, T_grid, rfr_ind, theta, r) 
0024 %                                                                           %&%
0025 rqre_alltypes( f_grid, {@isnumeric,@isvector} );                            %&%
0026 rqre_alltypes( T_grid, {@isnumeric,@isvector} );                            %&%
0027 rqre_datatype( rfr_ind, @istensor2 );                                       %&%
0028 rqre_alltypes( theta, {@isnumeric,@isvector} );                             %&%
0029 rqre_datatype( r, @istensor0 );                                             %&%
0030 if any( imag( rfr_ind ) < 0 )                                               %&%
0031   error( 'Imaginary part of the refractive index must be positive.' );      %&%
0032 end                                                                         %&%
0033 if (size(rfr_ind,1)~=length(f_grid) | size(rfr_ind,2)~=length(T_grid))      %&%
0034    error('Mismatch in size between rfr_ind and f_grid or T_grid.')          %&%
0035 end                                                                         %&%
0036 
0037 % Particle type is 'p20' for spherical particles
0038 ssp.ptype = 20;
0039 
0040 ssp.description = ['Spherical particles, generated using atmlab and ',...
0041                    'the Mie program from C. Mätzler, particle size', ...
0042                    ': ', num2str(r*1e6),' microns.']; 
0043 
0044 ssp.f_grid = f_grid;
0045 
0046 ssp.T_grid = T_grid;
0047 
0048 ssp.za_grid = theta;
0049 
0050 % Set aa grid to be empty (p20)
0051 ssp.aa_grid = [];
0052 
0053 % Now start Mie calculations
0054 
0055 c = constants('SPEED_OF_LIGHT');
0056 
0057 
0058 for i = 1:length(f_grid)
0059   for j = 1:length(T_grid)
0060     % Refractive index
0061     m = rfr_ind(i,j); 
0062     
0063     % Calculate scattering, absorption and extinction cross-sections
0064   
0065     [K,a] = mie_ext( m, c/f_grid(i), r, 1 );
0066 
0067     ssp.ext_mat_data(i, j, 1, 1, 1) = K;
0068     ssp.abs_vec_data(i, j, 1, 1, 1) = a;
0069 
0070     % Calculate the phase matrix
0071 
0072     y = mie_phase_mat( m, c/f_grid(i), r, theta, 4 );
0073 
0074     ssp.pha_mat_data(i, j, :, 1, 1, 1, 1) = y(1,:,1,1);
0075     ssp.pha_mat_data(i, j, :, 1, 1, 1, 2) = y(1,:,2,1);
0076     ssp.pha_mat_data(i, j, :, 1, 1, 1, 3) = y(1,:,1,1);
0077     ssp.pha_mat_data(i, j, :, 1, 1, 1, 4) = y(1,:,3,3);
0078     ssp.pha_mat_data(i, j, :, 1, 1, 1, 5) = y(1,:,3,4);
0079     ssp.pha_mat_data(i, j, :, 1, 1, 1, 6) = y(1,:,3,3);   
0080 
0081    end
0082 end

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