Home > reduc > support > applyFlags.m

applyFlags

PURPOSE ^

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

SYNOPSIS ^

function d = applyFlags(d)

DESCRIPTION ^

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

   function d = applyFlags(d)

  all this does is take whatever flags you have in d.flags.fast and applies
  it to your data --- setting hte values in the data structure to NaN.

  sjcm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function d = applyFlags(d)
0002 
0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0004 %
0005 %   function d = applyFlags(d)
0006 %
0007 %  all this does is take whatever flags you have in d.flags.fast and applies
0008 %  it to your data --- setting hte values in the data structure to NaN.
0009 %
0010 %  sjcm
0011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0012 
0013 if(isfield(d.antenna0.receiver, 'data'))
0014   switch(size(d.antenna0.receiver.data, 2))
0015     case 6
0016       flagArray = [d.flags.fast(:,1) repmat(d.flags.fast(:,2), [1 4]) ...
0017         d.flags.fast(:,3)];
0018       
0019     case 8
0020       flagArray = [d.flags.fast(:,1) repmat(d.flags.fast(:,2), [1 6]) ...
0021         d.flags.fast(:,3)];
0022       
0023     case 10
0024       flagArray = [repmat(d.flags.fast(:,1), [1 2]) ...
0025         repmat(d.flags.fast(:,2), [1 6]) repmat(d.flags.fast(:,3), [1 ...
0026           2])];
0027       
0028   end
0029   f = find(flagArray);
0030   d.antenna0.receiver.data(f) = nan;
0031 end
0032 
0033 if(isfield(d.antenna0.receiver, 'switchData'))
0034   % make sure the fast flags are incorporated into the switch ones.
0035   flagArray = [repmat(d.flags.fast(:,1), [1 4]) ...
0036     repmat(d.flags.fast(:,2), [1 16]) repmat(d.flags.fast(:,3), [1 ...
0037       4])];
0038   f = find(flagArray);
0039   d.antenna0.receiver.switchData(f) = nan;
0040 end
0041 
0042 return;

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