function [] = copyRfbToWorkspace()
%COPYRFBTOWORKSPACE Copies rfb input data to the workspace.
%   

global artoaDataInput artoaWorkspace;

%% Generate workspace

%% RAFOS DATE
artoaWorkspace.rafosDate = artoa.convert.dmy2rd( ...
    artoaDataInput.rfb.DATA(:, artoaDataInput.rfb.VARIABLE_LIST.start_listen_day), ...
    artoaDataInput.rfb.DATA(:, artoaDataInput.rfb.VARIABLE_LIST.start_listen_mon), ...
    artoaDataInput.rfb.DATA(:, artoaDataInput.rfb.VARIABLE_LIST.start_listen_yr) ...
) ...
+ ...
artoa.convert.hms2rd( ...
    artoaDataInput.rfb.DATA(:, artoaDataInput.rfb.VARIABLE_LIST.start_listen_hr), ...
    artoaDataInput.rfb.DATA(:, artoaDataInput.rfb.VARIABLE_LIST.start_listen_min), ...
    artoaDataInput.rfb.DATA(:, artoaDataInput.rfb.VARIABLE_LIST.start_listen_sec) ...
);

%% TOA
artoaWorkspace.toaData = struct();
artoaWorkspace.toaData.status = zeros( ...
    size(artoaDataInput.rfb.DATA, 1) * length(artoaDataInput.rfb.VARIABLE_LIST.time_of_arrival), ...
    1 ...
);

artoaWorkspace.toaData.toa = [];
toaColumns = artoaDataInput.rfb.VARIABLE_LIST.time_of_arrival;
for i = 1:length(toaColumns)
    artoaWorkspace.toaData.toa = [ ...
        artoaWorkspace.toaData.toa; ...
        artoaDataInput.rfb.DATA(:, toaColumns(i)) ...
    ];
end

artoaWorkspace.toaData.correlationHeight = [];
correleationHeightColumns = artoaDataInput.rfb.VARIABLE_LIST.correlation_height;
for i = 1:length(correleationHeightColumns)
    artoaWorkspace.toaData.correlationHeight = [ ...
        artoaWorkspace.toaData.correlationHeight; ...
        artoaDataInput.rfb.DATA(:, correleationHeightColumns(i)) ...
    ];
end

artoaWorkspace.toaData.toaDate = repmat( ...
    artoaWorkspace.rafosDate, ...
    length(artoaDataInput.rfb.VARIABLE_LIST.time_of_arrival), ...
    1 ...
);

artoaWorkspace.toaData.soundSource = cell( ...
    size(artoaDataInput.rfb.DATA, 1) * length(artoaDataInput.rfb.VARIABLE_LIST.time_of_arrival), ...
    1 ...
);


%% TEMPERATURE
artoaWorkspace.temperature = artoaDataInput.rfb.DATA(:, artoaDataInput.rfb.VARIABLE_LIST.temperature);
artoaWorkspace.statusTemperature = zeros(size(artoaDataInput.rfb.DATA, 1), 1);

%% PRESSURE
artoaWorkspace.pressure = artoaDataInput.rfb.DATA(:, artoaDataInput.rfb.VARIABLE_LIST.pressure);
artoaWorkspace.statusPressure = zeros(size(artoaDataInput.rfb.DATA, 1), 1);

%% SET DEFAULTS TO NaN
% toa
default = artoaDataInput.ini.defaults.toa;
artoaWorkspace.toaData.toa(artoaWorkspace.toaData.toa == default) = NaN;
% temperature
default = artoaDataInput.ini.defaults.temperature;
artoaWorkspace.temperature(artoaWorkspace.temperature == default) = NaN;
% pressure
default = artoaDataInput.ini.defaults.pressure;
artoaWorkspace.pressure(artoaWorkspace.pressure == default) = NaN;

%% FLOAT DETAILS
artoaWorkspace.float = artoaDataInput.rfb.FLOAT;


end

