Home > atmlab > forwardmodel > lorentz_lshape.m

lorentz_lshape

PURPOSE ^

LORENTZ_LSHAPE Different versions of pressure broadened line shape

SYNOPSIS ^

function l = lorentz_lshape( f, f0, dp, varargin )

DESCRIPTION ^

 LORENTZ_LSHAPE   Different versions of pressure broadened line shape

    Calculates different versions of the pressure induced line shape. The 
    most basic version is denoted as the Lorentz line shape.

    The line shape can be expressed as
      l = 1/pi * (f/f0)^prefac * ( dp/((f-f0)^2+dp^2) + dp/((f+f0)^2+dp^2) )
    where the second term (including f+f0) is considered only if *mirror*
    is set.

    Default values correspond to the basic Lorentz shape. The van
    Vleck-Weisskopf line shape is obtained with prefac=2 and mirror=true.

 FORMAT   l = lorentz_lshape( f, f0, dp [, prefac, mirror ] )
        
 OUT   l       Line shape. Dimensions [f,dp]. 
 IN    f       Frequency vector.
       f0      Centre frequency. Only scalar input allowed.
       dp      Pressure broadened line width. Following standard definition,
               which corresponds to FWHM/2. Can be a vector. 
 OPT   prefac  Exponent for (f/f0) term. Default is 0.
       mirror  To consider the mirror transition at -f0. Default is false.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

lorentz_lshape.m

SOURCE CODE ^

0001 % LORENTZ_LSHAPE   Different versions of pressure broadened line shape
0002 %
0003 %    Calculates different versions of the pressure induced line shape. The
0004 %    most basic version is denoted as the Lorentz line shape.
0005 %
0006 %    The line shape can be expressed as
0007 %      l = 1/pi * (f/f0)^prefac * ( dp/((f-f0)^2+dp^2) + dp/((f+f0)^2+dp^2) )
0008 %    where the second term (including f+f0) is considered only if *mirror*
0009 %    is set.
0010 %
0011 %    Default values correspond to the basic Lorentz shape. The van
0012 %    Vleck-Weisskopf line shape is obtained with prefac=2 and mirror=true.
0013 %
0014 % FORMAT   l = lorentz_lshape( f, f0, dp [, prefac, mirror ] )
0015 %
0016 % OUT   l       Line shape. Dimensions [f,dp].
0017 % IN    f       Frequency vector.
0018 %       f0      Centre frequency. Only scalar input allowed.
0019 %       dp      Pressure broadened line width. Following standard definition,
0020 %               which corresponds to FWHM/2. Can be a vector.
0021 % OPT   prefac  Exponent for (f/f0) term. Default is 0.
0022 %       mirror  To consider the mirror transition at -f0. Default is false.
0023 
0024 % 2006-11-21   Created by Patrick Eriksson.
0025 
0026 
0027 function l = lorentz_lshape( f, f0, dp, varargin )
0028 %
0029 [prefac,mirror] = optargs( varargin, { 0, false } );
0030                                                                            %&%
0031                                                                            %&%
0032 %- Check input                                                             %&%
0033 %                                                                          %&%
0034 rqre_nargin( 3, nargin )                                                   %&%
0035 %                                                                          %&%
0036 rqre_datatype( f, {@istensor1} );                                          %&%
0037 rqre_datatype( f0, {@istensor1} );                                         %&%
0038 rqre_datatype( dp, {@istensor0,@istensor1} );                              %&%
0039 %                                                                          %&%
0040 rqre_datatype( prefac, {@istensor1} );                                     %&%
0041 rqre_datatype( mirror, {@isboolean} );                                     %&%
0042 
0043 
0044 %- Allocate output
0045 %
0046 l = zeros( length(f), length(dp) );
0047 
0048 
0049 if prefac == 0
0050   a = 1/pi;
0051 else
0052   a = (f/f0).^prefac/pi;
0053 end
0054 
0055 
0056 for i = 1 : length(dp)
0057 
0058   if mirror
0059     l(:,i) = a .* ( dp(i) ./ ( (f-f0).^2 + dp(i)^2 ) + ...
0060                     dp(i) ./ ( (f+f0).^2 + dp(i)^2 ) );
0061   else
0062     l(:,i) = a .* ( dp(i) ./ ( (f-f0).^2 + dp(i)^2 ) );
0063   end
0064 end

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