Skip to content
Snippets Groups Projects
copyRfbToWorkspace.m 1.67 KiB
Newer Older
function [] = copyRfbToWorkspace()
%COPYRFBTOWORKSPACE Copies rfb input data to the workspace.
%   

global artoaDataInput artoaWorkspace;

%% Generate workspace

% TOA
artoaWorkspace.toaData = struct();
artoaWorkspace.toaData.status = zeros( ...
    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);
% PRESSURE
artoaWorkspace.pressure = artoaDataInput.rfb.DATA(:, artoaDataInput.rfb.VARIABLE_LIST.pressure);

% STATUS
artoaWorkspace.status = zeros(size(artoaDataInput.rfb.DATA, 1), 1);


% EXCLUDE LINES CONTAINING 9999
temperatureToExclude = artoaDataInput.rfb.DATA(:, artoaDataInput.rfb.VARIABLE_LIST.temperature) == 9999;
pressureToExclude = artoaDataInput.rfb.DATA(:, artoaDataInput.rfb.VARIABLE_LIST.pressure) == 9999;
pointsToExclude = or(temperatureToExclude, pressureToExclude);
artoaWorkspace.status(pointsToExclude) = 2;

% 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) ...
);

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


end