Home > atmlab > sensors > amsua_apply_polarisation.m

amsua_apply_polarisation

PURPOSE ^

AMSUA_APPLY_POLARISATION Includes AMSU-A polarisation response

SYNOPSIS ^

function y = amsua_apply_polarisation(y0,za,stokes_dim,channels)

DESCRIPTION ^

 AMSUA_APPLY_POLARISATION   Includes AMSU-A polarisation response

    The function takes an ARTS spectrum and includes the polarisation
    response. The spectrum shall be a column vector, with Stokes elements
    in order as used by ARTS. The WSV *stokes_dim* must be at least 3. It
    is allowed to just include a sub-set of the chanels. For example, if
    only the two first channels are considered, set channels=1:2.

    The function can handle several spectra in one call, if *za*,
    *stokes_dim* and *channels* are common for all spectra. The different
    spectra are then given as columns in a matrix.

 FORMAT   y = amsua_apply_polarisation(y0,za,stokes_dim[,channels])
        
 OUT   y          Measurement spectrum.
 IN    y0         Spectrum with Stokes elements.
       za         Zenith angle, a value between 90 and 180.
       stokes_dim Stokes dimensionality. Must be >= 3.
 OPT   channels   Index of channels included. Default is 1:15, 
                  ie. all channels are included.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

amsua_apply_polarisation.m

SOURCE CODE ^

0001 % AMSUA_APPLY_POLARISATION   Includes AMSU-A polarisation response
0002 %
0003 %    The function takes an ARTS spectrum and includes the polarisation
0004 %    response. The spectrum shall be a column vector, with Stokes elements
0005 %    in order as used by ARTS. The WSV *stokes_dim* must be at least 3. It
0006 %    is allowed to just include a sub-set of the chanels. For example, if
0007 %    only the two first channels are considered, set channels=1:2.
0008 %
0009 %    The function can handle several spectra in one call, if *za*,
0010 %    *stokes_dim* and *channels* are common for all spectra. The different
0011 %    spectra are then given as columns in a matrix.
0012 %
0013 % FORMAT   y = amsua_apply_polarisation(y0,za,stokes_dim[,channels])
0014 %
0015 % OUT   y          Measurement spectrum.
0016 % IN    y0         Spectrum with Stokes elements.
0017 %       za         Zenith angle, a value between 90 and 180.
0018 %       stokes_dim Stokes dimensionality. Must be >= 3.
0019 % OPT   channels   Index of channels included. Default is 1:15,
0020 %                  ie. all channels are included.
0021 
0022 % 2013-06-24   Created by Patrick Eriksson.
0023 
0024 
0025 function y = amsua_apply_polarisation(y0,za,stokes_dim,channels)
0026 %
0027 if nargin < 4
0028   channels = 1:15;
0029 end
0030 
0031 rqre_datatype( za, @istensor0 );
0032 rqre_datatype( stokes_dim, @istensor0 );
0033 
0034 if za < 90  | za >180
0035   error( 'The argument *za* must be in the range [90,180].' );
0036 end
0037 if stokes_dim < 3
0038   error( 'The argument *stokes_dim* must be >= 3.' );
0039 end
0040 if size(y0,1) ~= stokes_dim*length(channels)
0041   error( ['Inconsistency between length of *y* and the combination of ',...
0042            '*stokes_dim* and length of *channels*.' ] );
0043 end
0044 if min(channels) < 1 | max(channels) > 15
0045   error( 'The values in *channels* must be in the range [1,15].' );
0046 end
0047 
0048 
0049 % H polarisation response vector
0050 hpol = [ 0.5 -0.5 0 0 ];
0051 hpol = hpol( 1 : stokes_dim );
0052 
0053 
0054 % Rotation angles
0055 na = 180-za;
0056 rotangle = [ 90-na; 90-na; 90-na; 90-na; na; na; 90-na; na; na; na; na; ...
0057              na; na; na; 90-na; ];
0058 rotangle = rotangle( channels );
0059 
0060 
0061 % Matrix to be fileld for applying rotation
0062 R      = speye( stokes_dim );
0063 R(2,3) = 0.01; % Dummy value
0064 R(3,2) = 0.01; % Dummy value
0065   
0066 
0067 % Set up H
0068 %
0069 row = [];
0070 col = [];
0071 s   = [];
0072 %
0073 for i = 1 : length(channels)
0074   row = [ row, repmat( i, 1, stokes_dim ) ];
0075   col = [ col, (i-1)*stokes_dim+[1:stokes_dim] ];
0076   %
0077   [R(2,2),R(3,3)] = deal( cosd( 2*rotangle(i)  ) );
0078   R(2,3)          = sind( 2*rotangle(i) );
0079   R(3,2)          = -R(2,3);
0080   %
0081   s   = [ s, hpol*R ];
0082 end
0083 %
0084 H = sparse( row, col, s, length(channels), length(y0) );
0085           
0086 % Apply H
0087 y = H * y0;

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