Home > reduc > support > deglitchWrapper.m

deglitchWrapper

PURPOSE ^

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

SYNOPSIS ^

function d = deglitchWrapper(d, plotparams, parm, field);

DESCRIPTION ^

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

  function d = deglitchWrapper(d, plotparams, parm, field);

    reduceData function that calls the deglitching algorithm with
    parameters parm.

    sjcm

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function d = deglitchWrapper(d, plotparams, parm, field);
0002 
0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0004 %
0005 %  function d = deglitchWrapper(d, plotparams, parm, field);
0006 %
0007 %    reduceData function that calls the deglitching algorithm with
0008 %    parameters parm.
0009 %
0010 %    sjcm
0011 %
0012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0013 
0014 % check if we have the flagging parameters
0015 parFlag = checkpar(parm, 'deglitch');
0016 
0017 if(parFlag)
0018   flagParams = [parm.deglitch.chan1 parm.deglitch.chan2];
0019 else
0020   display('Using Default deglitching parameters');
0021   flagParams = [10 5];
0022 end
0023 
0024 [d,q] = logcal(d, 'deglitch');
0025 if (q)
0026   disp('Deglitching has already been applied')
0027   disp(' ')
0028   d=checkstatus(d);
0029   return
0030 end
0031 
0032 % first we separate the old flags
0033 flags.old.bit = d.flags.bit;
0034 
0035 % if deglitching hasn't been done, do it.
0036 flags.new = deglitch(d, flagParams);
0037 
0038 display('Plotting data');
0039 
0040 setPlotDisplay(plotparams.plot);
0041 
0042 % d in packd should be unchanged.
0043 
0044 [d flag] = packd(d, flags, 'none', 'deglitch', plotparams, 'Deglitching Plots', field);
0045 
0046 % next we fix our flags  -- all the ones in this stage, including
0047 % interactive flagging, are in flag.new.out
0048 d = setNewFlag(d, flag.new.out, 'deglitch');
0049 d = updateFlags(d, 1);
0050 
0051 
0052 d = logcal(d, 'deglitch');
0053 
0054 return;
0055 
0056 
0057 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0058 function d=checkstatus(d)
0059 
0060 disp('Would you like to view the plots?')
0061 
0062 if (query)
0063   d = packd(d, [], 'none', 'deglitch', 0, 'Deglitching Plots', '');
0064 end
0065 
0066 disp(' ')
0067

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