Home > reduc > shortfallCorr.m

shortfallCorr

PURPOSE ^

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

SYNOPSIS ^

function d = shortfallCorr(d)

DESCRIPTION ^

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

  function d = shortfallCorr(d)

   Calcualtes an array of same size as d.antenna0.receiver.switchData.  
   The elements are the multiplicative factors which the switch values 
   should be multiplied by.  All valid values will be between 1.0 and
   1.026 (inclusive).  Note that a correction of 1.026 implies that the
   shortfall flag was saturated at 254, and so the integration is
   unusable.  There's no need to check for this, though, as the flagging
   methods should notice this.

   Applies the correction to the data itself.

   24-May-2010 (MAS)
   modified 26-may-2010 sjcm to return the data structure with teh
   correction applied.

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function d = shortfallCorr(d)
0002 
0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0004 %
0005 %  function d = shortfallCorr(d)
0006 %
0007 %   Calcualtes an array of same size as d.antenna0.receiver.switchData.
0008 %   The elements are the multiplicative factors which the switch values
0009 %   should be multiplied by.  All valid values will be between 1.0 and
0010 %   1.026 (inclusive).  Note that a correction of 1.026 implies that the
0011 %   shortfall flag was saturated at 254, and so the integration is
0012 %   unusable.  There's no need to check for this, though, as the flagging
0013 %   methods should notice this.
0014 %
0015 %   Applies the correction to the data itself.
0016 %
0017 %   24-May-2010 (MAS)
0018 %   modified 26-may-2010 sjcm to return the data structure with teh
0019 %   correction applied.
0020 %
0021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0022 
0023 
0024 % Create the basic array:
0025 dataCorr1D = 1 ./ (1 - d.antenna0.receiver.diagnostics(:,4) / 10000);
0026 
0027 % Only these switched channels need to be corrected:
0028 switchCorr = [1 3 5 7 9 11 13 15 17 19 22 24];
0029 
0030 
0031 % Turn it into a matrix.
0032 dataCorr = ones(size(d.antenna0.receiver.switchData));
0033 for i = switchCorr
0034     dataCorr(:,i) = dataCorr1D;    
0035 end
0036 
0037 
0038 % And that's it!
0039 
0040 % let's just apply it to the data off the bat.
0041 
0042 d.antenna0.receiver.switchData = d.antenna0.receiver.switchData.*dataCorr;
0043 
0044 d = logcal(d, 'shortfall');
0045 
0046 return;
0047

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