Skip to content
Snippets Groups Projects
Commit b9cb4743 authored by leprob001's avatar leprob001
Browse files

Added function that adds the float offset and signal length to the toa data.

parent 196a442a
No related branches found
No related tags found
No related merge requests found
function [ correctedToa ] = addFloatOffsetAndSignalLength(pFloatRfb, pToa)
%ADDFLOATOFFSETANDSIGNALLENGTH Adds the float offset, substracts signal length
%
% Parameters:
% pFloatRfb (struct) The RFB file loaded using artoa.load.rfb function.
% pToa (double) The Toa vector.
%% Initialize return variables
correctedToa = false;
%% Parameter check
parameterError = false;
if (~isstruct(pFloatRfb))
warning([mfilename ': Given rfb data is not a struct!']);
parameterError = true;
end
if (~isnumeric(pToa))
warning([mfilename ': Given TOA data is not numeric!']);
parameterError = true;
end
if (parameterError)
return;
else
clear parameterError;
end
%% Add offset and subtract signal length
signalLength = pFloatRfb.FLOAT.signal_length;
floatOffset = pFloatRfb.FLOAT.offset(:, 6);
schedule = pFloatRfb.FLOAT.schedule;
step = schedule / 24;
cycle = pFloatRfb.FLOAT.cycle;
cycleBegin = artoa.convert.dmy2rd(cycle(6), cycle(5), cycle(4)) ...
+ artoa.convert.hms2rd(cycle(7), cycle(8), 0);
cycleEnd = artoa.convert.dmy2rd(cycle(13), cycle(12), cycle(11)) ...
+ artoa.convert.hms2rd(cycle(14), cycle(15), 0);
toaDate = repmat([cycleBegin:step:cycleEnd]', 6, 1);
offsetCorrection = ...
((floatOffset(2) - floatOffset(1)) / (cycleEnd - cycleBegin)) ...
* (toaDate - min(toaDate)) + floatOffset(1);
correctedToa = pToa + offsetCorrection - signalLength;
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment