From 9a88e9a22be51d6545fc1833a970b0939612338d Mon Sep 17 00:00:00 2001 From: Grant Meadors <gdmeadors@gmail.com> Date: Tue, 30 Apr 2013 03:09:21 -0700 Subject: [PATCH] Fixed a special case where the obliteration of 32 s windows into windows of up to 512+32 s long caused the final window to extend into another frame, which constructWhitespace had not prepared for. To minimize intrusion into other parts of the code, an edit was made directly to the failure point in the HoftEditor windower function, where the frameTail is attached; the Hoft.data and Hoft.baseline structures are extended by the required amount, which is exactly the length of the frameTail. A variety of checks are made the ensure this only occurs where needed and that it survives in cases where the window needs to be renormalized due to vetoes. All checks out with one test case, and since the entire category of so-called type 1 errors in the 2013-01-22-1 LHO and 2013-02-21 LLO production runs were similar across all the variables that are invoked, I think it is safe to say this should solve the problem for all errors involving loopPRC. Note that loopMICH and initialMICH, also known as type 0 and type 2 errors, are due to issues with 64 and 96 s LDAS frames sneaking into ligo_data_find and the cluster nodes, and I cannot resolve those without extensive recoding, so I think I will ignore them and just write over those jobs with interstitialFrame.m --- HoftEditor.m | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/HoftEditor.m b/HoftEditor.m index 4a6e861..a767f10 100644 --- a/HoftEditor.m +++ b/HoftEditor.m @@ -49,6 +49,7 @@ classdef HoftEditor < handle successVector site siteFull + excessFrameAppliedFlag end methods @@ -106,6 +107,7 @@ classdef HoftEditor < handle Hoft.isFirstSubFlag = 1; Hoft.isLastSubFlag = 0; Hoft.successVector = []; + Hoft.excessFrameAppliedFlag = []; end function constructVector(Hoft, totalFrameDuration) Hoft.data = ones(16384*totalFrameDuration, 1); @@ -624,7 +626,46 @@ classdef HoftEditor < handle disp(length(Hoft.data)) disp(length(Hoft.data((jjStart+s+1):end))) disp(length(Hoft.frameTail)) - if length(Hoft.frameTail) > 0 + % There is an unusual special case now if the last window + % is between 512 and 512+32 s long. Subdivider obliterates + % all windows less than 32 s long, creating a category of + % final windows a bit longer than the 512 or less that is + % typical. If this extension pushes the end of the final + % window across a 128 s frame boundary from where the + % penultimate window ends (remember, they are usually + % together), then the above windowing will extend Hoft.data, + % because Matlab index assertions soft-extend arrays so long + % as left and right match. Yet the Hoft.data array will not + % be extended sufficiently to include the next full frameTail. + % Thus, in that rare instance, we create an exception. + durationFinalSub = tSub.tEnd(end) - tSub.tStart(end); + excessFrameCondition = ( durationFinalSub > 512 ) &... + ( durationFinalSub <= 512+32 ); + % Note that we only make the correction the first + % time around; in a veto case, it must not be made again) + if excessFrameCondition & (Hoft.vetoAlarm == 0) + if length(Hoft.data((jjStart+s+1):end)) == 0 + Hoft.data = [Hoft.data; Hoft.frameTail]; + Hoft.baseline = [Hoft.baseline; Hoft.frameTail]; + disp('Excess frame adjustment applied') + Hoft.excessFrameAppliedFlag = 1; + disp('New length of Hoft.data((jjStart+s+1):end) is') + disp(length(Hoft.data((jjStart+s+1):end))) + else + Hoft.excessFrameAppliedFlag = 0; + disp('No excess frame adjustment needed') + end + elseif Hoft.vetoAlarm == 0 + Hoft.excessFrameAppliedFlag = 0; + end + % Below is the part for which the above discussion built up + % so much anticipation: the final attachment of the frameTail + % back into the main Hoft.data array, having been seperated + % as the latter made its voyage from being dirty to clean. + % With Hoft.data filtered, the frameTail now only serves + % to fill out the remainder of the final frame. + if (length(Hoft.frameTail) > 0) &... + (Hoft.excessFrameAppliedFlag == 0); Hoft.data((jjStart+s+1):end) = Hoft.frameTail; Hoft.baseline((jjStart+s+1):end) = Hoft.frameTail; end -- GitLab