function [d,q]=logcal(d,type) logs the calibration step performed on the data in field d.pipe q output is optional - if used type will not be logged q=1 - calibration of 'type' has already been applied q=0 - calibration of 'type' has not been applied type: 'shortfall' 'deglitch' 'rfi' 'mains' 'alpha' 'stokes' 'noise' 'tsys' 'pointing' 'load' 'tau' 'astro' 'iv' SJCM MAS 20-Dec-2010 -- Updated to remove rfi1 and rfi2. Now just rfi.
0001 function [d,q]=logcal(d,type) 0002 0003 % function [d,q]=logcal(d,type) 0004 % 0005 % logs the calibration step performed on the data in field d.pipe 0006 % 0007 % q output is optional - if used type will not be logged 0008 % q=1 - calibration of 'type' has already been applied 0009 % q=0 - calibration of 'type' has not been applied 0010 % 0011 % type: 'shortfall' 0012 % 'deglitch' 0013 % 'rfi' 0014 % 'mains' 0015 % 'alpha' 0016 % 'stokes' 0017 % 'noise' 0018 % 'tsys' 0019 % 'pointing' 0020 % 'load' 0021 % 'tau' 0022 % 'astro' 0023 % 'iv' 0024 % 0025 % SJCM 0026 % 0027 % MAS 20-Dec-2010 -- Updated to remove rfi1 and rfi2. Now just rfi. 0028 0029 % first check whether or not type is the right string 0030 0031 switch type 0032 case {'shortfall', 'deglitch', 'rfi', 'mains', 'alpha','noise', 'tsys', ... 0033 'stokes', 'pointing', 'load', 'tau', 'iv', 'ground', 'astro', 'overf'} 0034 0035 %do nothing and pass through 0036 0037 otherwise 0038 disp('Invalid type argument in logcal') 0039 return 0040 end 0041 0042 if (isfield(d,'pipe')) 0043 for i=1:length(d.pipe) 0044 if (strcmp(d.pipe{i},type)) 0045 if (nargout==2) 0046 q=1; 0047 end 0048 break; 0049 end 0050 if (i==length(d.pipe)) 0051 if (nargout==1) 0052 d.pipe{i+1}=type; 0053 elseif nargout==2 0054 q=0; 0055 end 0056 end 0057 end 0058 else 0059 if (nargout==1) 0060 d.pipe={type}; 0061 elseif (nargout==2) 0062 q=0; 0063 end 0064 end 0065 0066 return; 0067 0068 0069 0070 0071 0072