Skip to content
Snippets Groups Projects
Commit 79f77314 authored by oboebel's avatar oboebel
Browse files

No commit message

No commit message
parent 648506ec
No related branches found
No related tags found
No related merge requests found
% ARTOA ini file for dimes first three floats
[files]
-soundsourcefile C:\MyData\RAFOS\HAFOS.soso
%-soundsourcefile C:\MyData\RAFOS\HAFOS.soso
-soundsourcefile C:\MyData\RAFOS\TESTwithOFFSETS.soso
-floatfile ..\HAFOS.flo % not used in artoa4 yet
-bathyfile ..\HAFOS.prj % not used in artoa4 yet
-etopo C:\MyData\TOPO\etopo1_ice_c.flt
......
......
......@@ -22,6 +22,7 @@ toaData.toa = artoaDataInput.toaData.toa;
artoaWorkspace.editOffsets.unfilteredA, ...
artoaWorkspace.editOffsets.unfilteredB, ...
artoaWorkspace.editOffsets.D, ...
artoaWorkspace.editOffsets.soundspeed,... % Olaf Boebel 2022-10-07
] = artoa.offsets.solve( ...
artoaDataInput.rfb, ...
soundsources, ...
......
......
......@@ -8,10 +8,10 @@ global artoaWorkspace artoaConfig;
unfilteredA = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'unfilteredA'}, false);
unfilteredB = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'unfilteredB'}, false);
A = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'A'}, false);
B = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'B'}, false);
X = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'X'}, false);
B = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'B'}, false); % retains columns corresponding to fitted values
X = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'X'}, false); % fitted values
D = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'D'}, false);
offsets = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'offsets'}, false);
offsets = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'offsets'}, false); % the current offset table
soundspeed = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'soundspeed'}, false);
if islogical(unfilteredA) || islogical(unfilteredB) ...
......
......
......@@ -33,4 +33,4 @@ end
rfbfile = artoa.load.tomlini(pFilename);
end
cdend
......@@ -2,6 +2,9 @@ function [a, b, c, d] = createCalculationTables(pRfb, pSoundsources, pTrackingPa
%CREATECALCULATIONMATRICES Summary of this function goes here
% Detailed explanation goes here
% Olaf Boebel 2022-10-18: the calling function passes pSoundvelocity to his function.
% pSoundvelocity semms to host the "Applied to" sound source velocities
%% Initialize required variables
%pSoundsources = artoa.controller.getSoundsourcesWithAppliedToa();
satPositions = [pSatData.lat_sat, pSatData.lon_sat];
......
......
function [A, B, X, unfilteredA, unfilteredB, D] = solve(pRfb, pSoundsources, pTrackingParameter, pToaData, pSatData, pLeapsecondsMatrix, pOffsetsParameter)
%function [A, B, X, unfilteredA, unfilteredB, D] = solve(pRfb, pSoundsources, pTrackingParameter, pToaData, pSatData, pLeapsecondsMatrix, pOffsetsParameter)
% Olaf Boebel 2022-11-03 added 'soundspeed' to output arguments
function [A, B, X, unfilteredA, unfilteredB, D, soundspeed] = solve(pRfb, pSoundsources, pTrackingParameter, pToaData, pSatData, pLeapsecondsMatrix, pOffsetsParameter)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
......@@ -14,6 +18,10 @@ function [A, B, X, unfilteredA, unfilteredB, D] = solve(pRfb, pSoundsources, pTr
pLeapsecondsMatrix ...
);
%OB% 20221018 The above function call passes the Sosos' AppliedSoundspeed to artoa.offsets.createCalculationTables
%If it is NaN, solve does not work, unclear if tables are %constructed nevertheless. Why should the Soso's sound speed be mandatory
%and not a fitting parameter?
%% Subtract all known offsets
[B] = artoa.offsets.subtractKnownOffsets( ...
unfilteredA, ...
......@@ -51,6 +59,24 @@ end
%% Solve it!
X = A{:, :} \ B.toa;
% Olaf Boebel 2022 11 03
% the above solves the liner equation system if solvable. However, due to
% noise this is not necessarily the case. Rather, we seek to find a
% solution which minimizes the differnce between the found solution and the
% true solution. This is given by:
H = A{:, :};
B2 = H'*B.toa;
A2 = H'*H;
X2 = A2\B2;
DET = det(A2)
CONDITION = rcond(A2)
[X X2]
X = X2;
% End Olaf Boebel 2022 11 03
%% Apply row names to X
if isrow(X)
X = X';
......@@ -65,5 +91,8 @@ for i = 1:length(varNames)
end
end
%OB% 20221007
soundspeed = pOffsetsParameter.offsets{'Float', 'AppliedSoundspeed'};
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment