Skip to content
Snippets Groups Projects
Commit a57bded0 authored by Grant David Meadors's avatar Grant David Meadors
Browse files

Made modifications to enable absolute sum vetos in the comb and fixed a bug in...

Made modifications to enable absolute sum vetos in the comb and fixed a bug in the middle of divided segments
parent 2e4ce261
Branches
No related tags found
No related merge requests found
...@@ -463,7 +463,17 @@ classdef HoftEditor < handle ...@@ -463,7 +463,17 @@ classdef HoftEditor < handle
function dataReviewer(Hoft, newHoft, jj, jjStart) function dataReviewer(Hoft, newHoft, jj, jjStart)
frameWriter(Hoft); frameWriter(Hoft);
Hoft.vetoAlarm = (Hoft.successVector.range | Hoft.successVector.comb); Hoft.vetoAlarm = (Hoft.successVector.range | Hoft.successVector.comb);
if (Hoft.vetoAlarm & ~(Hoft.isFirstSubFlag) & ~(Hoft.tIsFollowed)) == 1 % Normally, if the vetoAlarm is raised, we will proceed to
% extricate our bad feedforward attempt and introduce normal data.
% However, a few conditions must be met.
% The followed method is not suited to the starting window,
% so we verify that isFirstSubFlag is not on. Moreover,
% the proceedure is inappropriate on the last window of a job for
% a segment that has been divided across multiple jobs.
dataCleaningFlag = Hoft.vetoAlarm &...
(Hoft.isFirstSubFlag == 0) &...
((Hoft.tIsFollowed == 0) | (Hoft.isLastSubFlag == 0));
if dataCleaningFlag == 1
disp('Veto alarm raised in window; writing baseline instead of filtered data') disp('Veto alarm raised in window; writing baseline instead of filtered data')
% First we have to back out bad data and renormalize the preceding window % First we have to back out bad data and renormalize the preceding window
windowRenormalize(Hoft, Hoft.tSub, Hoft.p, Hoft.s, newHoft, jj, jjStart); windowRenormalize(Hoft, Hoft.tSub, Hoft.p, Hoft.s, newHoft, jj, jjStart);
...@@ -1116,7 +1126,25 @@ classdef HoftEditor < handle ...@@ -1116,7 +1126,25 @@ classdef HoftEditor < handle
% or more generous if less than 32 averages % or more generous if less than 32 averages
% else pass (zero) % else pass (zero)
combOutput.combLimit = max(1.2, 1.2 * sqrt(32 / (Hoft.r/nfft))); combOutput.combLimit = max(1.2, 1.2 * sqrt(32 / (Hoft.r/nfft)));
combOutput.maximum = max(combOutput.Ratio >= combOutput.combLimit ); combOutput.maximum =... max(combOutput.Ratio >= combOutput.combLimit );
% In addition to the ratio cutoff, check the sum of comb
% values after feedforward. If the sum of points at
% frequencies greater than or equal to 450 Hz is greater
% than or equal to 2.75e-21, abort.
% This threshold is chosen based
% on post-processing diagnostics that show worse values
% to be indicative of sufficiently noisy periods that
% feedforward should not be attempted, even if all other
% vetos are clear.
% 450 Hz is the 24th index in the comb.
combSumOver450 = sum(combOutput.After(24:end));
combAfterSumThreshold = 2.75e-21;
combSumVeto = combSumOver450 >= combAfterSumThreshold;
% Finaly Boolean result
combOutput.combVetoFlag = combOutput.maximum | combSumVeto;
disp('Comb limit for this window') disp('Comb limit for this window')
disp(combOutput.combLimit) disp(combOutput.combLimit)
...@@ -1126,6 +1154,9 @@ classdef HoftEditor < handle ...@@ -1126,6 +1154,9 @@ classdef HoftEditor < handle
disp(combOutput.Diff) disp(combOutput.Diff)
disp('Maximum should be Boolean') disp('Maximum should be Boolean')
disp(combOutput.maximum) disp(combOutput.maximum)
disp('Sum of values >= 450 Hz')
disp(combSumOver450)
disp('Comb veto (one fails, zero passes)')
% Store the bin index number in the output: % Store the bin index number in the output:
combOutput.frequencyCombC = frequencyCombC; combOutput.frequencyCombC = frequencyCombC;
...@@ -1133,7 +1164,7 @@ classdef HoftEditor < handle ...@@ -1133,7 +1164,7 @@ classdef HoftEditor < handle
combOutput.frequencyList = (Fs./nfft).*frequencyCombC; combOutput.frequencyList = (Fs./nfft).*frequencyCombC;
end end
combOutputResult = comber(Fs, nfft, pdarmcal, perrcal); combOutputResult = comber(Fs, nfft, pdarmcal, perrcal);
Hoft.successVector.comb = combOutputResult.maximum; Hoft.successVector.comb = combOutputResult.combVetoFlag;
disp('success (0) or failure (1) of the data in range and comb veto tests:') disp('success (0) or failure (1) of the data in range and comb veto tests:')
disp(Hoft.successVector.range) disp(Hoft.successVector.range)
disp(Hoft.successVector.comb) disp(Hoft.successVector.comb)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment