function [adjustedToaData] = addFloatDrift(pToaData, pFloatOffsetBegin, pFloatOffsetEnd)
%ADDFLOATDRIFT Summary of this function goes here
%   Detailed explanation goes here

%% Prepare return variable
adjustedToaData = pToaData;

%% Parameter check
if pFloatOffsetBegin == 0 && pFloatOffsetEnd == 0
    return;
end
if pFloatOffsetBegin == pFloatOffsetEnd
    adjustedToaData.toa = pToaData.toa + pFloatOffsetEnd;
end

%% Get required data
maxToaDate = max(pToaData.toaDate);
minToaDate = min(pToaData.toaDate);

%% Calculate offset for every toa
offset = ((pFloatOffsetEnd - pFloatOffsetBegin) / (maxToaDate - minToaDate)) ...
    * (pToaData.toaDate - minToaDate) + pFloatOffsetBegin;

%% Add calculated offset to toa data
adjustedToaData.toa = pToaData.toa + offset;


end

