Newer
Older
function [A, B, X, unfilteredA, unfilteredB] = solve(pRfb, pSoundsources, pTrackingParameter, pToaData, pSatData, pLeapsecondsMatrix, pOffsetsParameter, pSoundvelocity)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
leprob001
committed
%% Construct matrices A, B and C
[unfilteredA, unfilteredB, unfilteredC] = artoa.offsets.createCalculationTables( ...
leprob001
committed
pRfb, ...
pSoundsources, ...
pTrackingParameter, ...
pToaData, ...
pSatData, ...
pLeapsecondsMatrix ...
);
%% Subtract all known offsets
[B] = artoa.offsets.subtractKnownOffsets( ...
unfilteredA, ...
pOffsetsParameter.offsets ...
);
%% Subtract all known drifts
[B] = artoa.offsets.subtractKnownDrifts( ...
unfilteredA, ...
B, ...
pOffsetsParameter.offsets ...
);
%% Optimize matrices for calculation
leprob001
committed
[A, unfilteredA] = artoa.offsets.filterCalculationTables( ...
unfilteredA, ...
pOffsetsParameter.offsets ...
);
leprob001
committed
%% Subtract window start and soundsource reference time
B.toa = B.toa - unfilteredC.ReferenceTime;
%% Use soundspeed
if ~isnan(pOffsetsParameter.soundspeed{'Soundspeed', 'Empirical'})
if isempty(A)
return; % nothing to be done, everything is given and soundspeed is fixed
end
% Distances are in km, soundspeed m/s
B.toa = B.toa - A{:, 'Distances'} * (pOffsetsParameter.soundspeed{'Soundspeed', 'Empirical'} / 1000);
leprob001
committed
end
X = table(X, 'VariableNames', {'Value'}, 'RowNames', A.Properties.VariableNames);
% Rename Distance column to Soundspeed
varNames = X.Properties.RowNames;
for i = 1:length(varNames)
if strcmp(varNames{i}, 'Distances')
X.Properties.RowNames{i} = 'Soundspeed';
X{'Soundspeed', 'Value'} = 1 / X{'Soundspeed', 'Value'};