0001 function d = deglitchWrapper(d, plotparams, parm, field);
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
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
0033 flags.old.bit = d.flags.bit;
0034
0035
0036 flags.new = deglitch(d, flagParams);
0037
0038 display('Plotting data');
0039
0040 setPlotDisplay(plotparams.plot);
0041
0042
0043
0044 [d flag] = packd(d, flags, 'none', 'deglitch', plotparams, 'Deglitching Plots', field);
0045
0046
0047
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