diff --git a/AddendaEditor.m b/AddendaEditor.m index 81a0b768c8362ad0f5a731957af9282b71cfebe8..9f57bc2fa5e930d46fbd2a41b0af82f59ac0cb26 100644 --- a/AddendaEditor.m +++ b/AddendaEditor.m @@ -21,6 +21,7 @@ classdef AddendaEditor < handle baselineCheck site siteFull + oddFrameWarning end methods @@ -45,7 +46,7 @@ classdef AddendaEditor < handle addenda.site = siteName; addenda.siteFull = strcat('L', siteName, 'O'); end - function initialFixer(addenda, tSub, T) + function initialFixer(addenda, oddFrameWarning, tSub, T) tau1 = floor(tSub.tStart(1) / T.s)*T.s; tau2 = ceil(tSub.tEnd(1) / T.s)*T.s; if tSub.tStart(1) == tau1 @@ -65,6 +66,7 @@ classdef AddendaEditor < handle else addenda.frameTailFlag = 1; end + addenda.oddFrameWarning = oddFrameWarning; end function loopFixer(addenda, Hoft, jj, tSub) if jj == length(tSub.tStart) @@ -87,6 +89,7 @@ classdef AddendaEditor < handle addenda.passPRC = Hoft.passPRC; clear Hoft.passPRC end + addenda.oddFrameWarning = Hoft.oddFrameWarning; end function initialPRC(addenda, aFirstHoft) addenda.PRCfilter = 1; diff --git a/Data.m b/Data.m index e1b6f50db2c0851042abe108e1ab666e52696cf3..e9d882787cca32e774d7c873797b90c4dcd1c87a 100644 --- a/Data.m +++ b/Data.m @@ -55,7 +55,30 @@ classdef Data < handle else channels.tau2 = channels.t(2); end - + % In a few rare cases, the frame files are of inconsistent length + % We check for this with the odd frame warning and adjust the tau, + % which are supposed to correctly correspond to the start and stop + % of frame files on disk, to match what ligo_data_find has told + % us are available, as written out to the cache files and then + % made into the oddFrameWarning flag. + % These errors only seem to occur in specific cases, so this fix + % is also quite specific + for ii = length(addenda.oddFrameWarning) + if str2num(addenda.oddFrameWarning(ii).DUR) ~= addenda.s + if str2num(addenda.oddFrameWarning(ii).GPS) == channels.t(1) + channels.tau1 + channels.tau1 = channels.t(1); + channels.tau1 + end + if str2num(addenda.oddFrameWarning(ii).GPS) +... + str2num(addenda.oddFrameWarning(ii).DUR)... + == channels.t(2) + channels.tau2 + channels.tau2 = t(2); + channels.tau2 + end + end + end % Find how far shifted the signal is into the science segment channels.durationHead =... channels.t(1) - floor(channels.t(1)/addenda.s) * addenda.s; diff --git a/HoftEditor.m b/HoftEditor.m index a767f109848e3de14e73cffa47498a001c157f4f..425f69dfc49847fb1baf2eb69b6f859187280566 100644 --- a/HoftEditor.m +++ b/HoftEditor.m @@ -50,6 +50,7 @@ classdef HoftEditor < handle site siteFull excessFrameAppliedFlag + oddFrameWarning end methods @@ -89,6 +90,15 @@ classdef HoftEditor < handle % files that the program is being told to process Hoft.site = listContents(1); Hoft.siteFull = strcat('L', listContents(1), 'O'); + % Let us do a bit of list processing to determine if there are any + % frames of unusual length. + regExOut = regexp(listContents,'-(?<GPS>\d+)-(?<DUR>\d+)\.','names'); + Hoft.oddFrameWarning = []; + for ii = 1:length(regExOut) + if str2num(regExOut(ii).DUR) ~= T.s + Hoft.oddFrameWarning = [Hoft.oddFrameWarning; regExOut(ii)] ; + end + end Hoft.T = T; Hoft.tStart = tSub.tStart(1); Hoft.tEnd = tSub.tEnd(1); @@ -133,7 +143,7 @@ classdef HoftEditor < handle %end function initialMICH(Hoft, T, tSub, addenda) - addenda.initialFixer(tSub, T); + addenda.initialFixer(Hoft.oddFrameWarning, tSub, T); % Call the filter function itself aFirstHoft = aletheia(tSub.tStart(1), tSub.tEnd(1), addenda);