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

Added conversion function for raw toa to phasereftime.

parent 718876b0
No related branches found
No related tags found
No related merge requests found
function [ toaRelativeToPhaseRefTime ] = rawToa2PhaseRefTime(pFloatRfb)
%RAWTOA2PHASEREFTIME Converts the raw toa to travel time relative to phasereftime
% Takes the raw toa given in the rfb file (travel time relative to window
% start) and converts it to the travel time relative to the phasereftime.
%
% To convert it, it adds the windowstart offset to the raw toa.
% Parameters:
% pFloatRfb (struct) The RFB file loaded using artoa.load.rfb function.
%% Initialize return variables
toaRelativeToPhaseRefTime = false;
%% Parameter check
parameterError = false;
if (~isstruct(pFloatRfb))
warning([mfilename ': Given rfb data is not a struct!']);
parameterError = true;
end
if (parameterError)
return;
else
clear parameterError;
end
%% Collect required data
% gets the toa converted to a column vector with one column
toa = pFloatRfb.DATA(:, pFloatRfb.VARIABLE_LIST.time_of_arrival);
toa = toa(:);
windowStart = pFloatRfb.FLOAT.windowstart;
windowsPerPhase = pFloatRfb.FLOAT.windowsperphase;
toaPerWindow = pFloatRfb.FLOAT.toaperwindow;
window = ones(length(toa), 1) * [1:1:windowsPerPhase];
for i = 1:length(windowStart)
toa(window == i) = toa(window == i) + (windowStart(i) * 60);
end
toaRelativeToPhaseRefTime = toa;
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