Home > reduc > calculateStokes_DD.m

calculateStokes_DD

PURPOSE ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

SYNOPSIS ^

function d = calculateStokes_DD(d,r)

DESCRIPTION ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 This function calculates the instrument Stokes parameters from the
 data register. The d.antenna0.receiver.data register is then updated
 with the Stokes parameters. The columns of the data register are:
 [I Q1 U1 Q2 U2 Q3 U3 V]
 where (Qi,Ui) are the linear Stokes set i.

 OGK, 21 Nov 2010

 mod ogk: 26 Nov 2011: Now keep I1 and I2 separate
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function d = calculateStokes_DD(d,r)
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 % This function calculates the instrument Stokes parameters from the
0004 % data register. The d.antenna0.receiver.data register is then updated
0005 % with the Stokes parameters. The columns of the data register are:
0006 % [I Q1 U1 Q2 U2 Q3 U3 V]
0007 % where (Qi,Ui) are the linear Stokes set i.
0008 %
0009 % OGK, 21 Nov 2010
0010 %
0011 % mod ogk: 26 Nov 2011: Now keep I1 and I2 separate
0012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0013 
0014 if size(d.antenna0.receiver.data,2) ~= 10
0015   display('calculateStokes_DD:: R-factor should not be applied to this data');
0016   display('calculateStokes_DD:: Either you are trying to do alpha Pol Only');
0017   display('calculateStokes_DD:: Or you need to run assembleAlphaStreams_DD');
0018   display('calculateStokes_DD:: and applyAlpha_DD.')
0019   return;
0020 end
0021 
0022 % Default r values for scans through the NCP:
0023 if isempty(r)
0024     r = [1.8;
0025      1.6];
0026 end
0027 
0028 swd = d.antenna0.receiver.data;
0029 d.antenna0.receiver.data = zeros(size(d.antenna0.receiver.data,1),8);
0030 
0031 d.antenna0.receiver.data(:,1) = swd(:,1)-r(1)*swd(:,2);
0032 d.antenna0.receiver.data(:,8) = swd(:,9)-r(2)*swd(:,10);
0033 
0034 % Polarization products:
0035 d.antenna0.receiver.data(:,2) = swd(:,3);
0036 d.antenna0.receiver.data(:,3) = swd(:,4);
0037 d.antenna0.receiver.data(:,4) = swd(:,5);
0038 d.antenna0.receiver.data(:,5) = swd(:,6);
0039 d.antenna0.receiver.data(:,6) = swd(:,7);
0040 d.antenna0.receiver.data(:,7) = swd(:,8);
0041 
0042 % % remove extra 2 columns
0043 % d.antenna0.receiver.data(9:10) = [];
0044 
0045 end

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005