Skip to content
Snippets Groups Projects
Commit c37e6a4d authored by leprob001's avatar leprob001
Browse files

Renamed Empirical to Applied values.

parent a049116d
No related branches found
No related tags found
No related merge requests found
Showing
with 87 additions and 45 deletions
229
\ No newline at end of file
230
\ No newline at end of file
function [] = buttonEmpiricalToNan(~, ~)
function [] = buttonAppliedToNan(~, ~)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
%% Save empirical state
artoa.controller.edit.offsets.saveEmpiricalState();
%% Save applied state
artoa.controller.edit.offsets.saveAppliedState();
%% Reset all empirical offsets and drift
%% Reset all Applied offsets and drift
artoaWorkspace.editOffsets.offsets{:, 'EmpiricalOffset'} = NaN;
artoaWorkspace.editOffsets.offsets{:, 'EmpiricalDrift'} = NaN;
artoaWorkspace.editOffsets.offsets{:, 'AppliedOffset'} = NaN;
artoaWorkspace.editOffsets.offsets{:, 'AppliedDrift'} = NaN;
artoaWorkspace.editOffsets.soundspeed.Empirical(1) = NaN;
artoaWorkspace.editOffsets.soundspeed.Applied(1) = NaN;
%% Update GUI
artoa.controller.edit.offsets.updateGui();
......
......
......@@ -4,15 +4,15 @@ function [] = buttonCopyFromMeasured(~, ~)
global artoaWorkspace;
%% Save empirical state
artoa.controller.edit.offsets.saveEmpiricalState();
%% Save Applied state
artoa.controller.edit.offsets.saveAppliedState();
%% Copy from optimum total offset columns to empirical columns
%% Copy from optimum total offset columns to Applied columns
% store float in table
artoaWorkspace.editOffsets.offsets{:, 'EmpiricalOffset'} = artoaWorkspace.editOffsets.offsets{:, 'OffsetStart'};
artoaWorkspace.editOffsets.offsets{:, 'EmpiricalDrift'} = artoaWorkspace.editOffsets.offsets{:, 'Drift'};
artoaWorkspace.editOffsets.offsets{:, 'AppliedOffset'} = artoaWorkspace.editOffsets.offsets{:, 'OffsetStart'};
artoaWorkspace.editOffsets.offsets{:, 'AppliedDrift'} = artoaWorkspace.editOffsets.offsets{:, 'Drift'};
artoaWorkspace.editOffsets.soundspeed.Empirical(1) = artoaWorkspace.editOffsets.soundspeed.Measured(1);
artoaWorkspace.editOffsets.soundspeed.Applied(1) = artoaWorkspace.editOffsets.soundspeed.Measured(1);
%% Update GUI
artoa.controller.edit.offsets.updateGui();
......
......
......@@ -4,20 +4,20 @@ function [] = buttonCopyFromOptimum(~, ~)
global artoaWorkspace;
%% Save empirical state
artoa.controller.edit.offsets.saveEmpiricalState();
%% Save Applied state
artoa.controller.edit.offsets.saveAppliedState();
%% Copy from optimum total offset columns to empirical columns
%% Copy from optimum total offset columns to Applied columns
offsetIndicesToCopy = isnan(artoaWorkspace.editOffsets.offsets{:, 'EmpiricalOffset'});
driftIndicesToCopy = isnan(artoaWorkspace.editOffsets.offsets{:, 'EmpiricalDrift'});
offsetIndicesToCopy = isnan(artoaWorkspace.editOffsets.offsets{:, 'AppliedOffset'});
driftIndicesToCopy = isnan(artoaWorkspace.editOffsets.offsets{:, 'AppliedDrift'});
artoaWorkspace.editOffsets.offsets{offsetIndicesToCopy, 'EmpiricalOffset'} = ...
artoaWorkspace.editOffsets.offsets{offsetIndicesToCopy, 'AppliedOffset'} = ...
artoaWorkspace.editOffsets.offsets{offsetIndicesToCopy, 'OptimumTotalOffset'};
artoaWorkspace.editOffsets.offsets{driftIndicesToCopy, 'EmpiricalDrift'} = ...
artoaWorkspace.editOffsets.offsets{driftIndicesToCopy, 'AppliedDrift'} = ...
artoaWorkspace.editOffsets.offsets{driftIndicesToCopy, 'OptimumTotalDrift'};
artoaWorkspace.editOffsets.soundspeed.Empirical(1) = artoaWorkspace.editOffsets.soundspeed.Optimum(1);
artoaWorkspace.editOffsets.soundspeed.Applied(1) = artoaWorkspace.editOffsets.soundspeed.Optimum(1);
%% Update GUI
artoa.controller.edit.offsets.updateGui();
......
......
......@@ -12,8 +12,8 @@ if islogical(lastValues)
return;
end
artoaWorkspace.editOffsets.offsets.EmpiricalOffset = lastValues.EmpiricalOffset;
artoaWorkspace.editOffsets.offsets.EmpiricalDrift = lastValues.EmpiricalDrift;
artoaWorkspace.editOffsets.offsets.AppliedOffset = lastValues.AppliedOffset;
artoaWorkspace.editOffsets.offsets.AppliedDrift = lastValues.AppliedDrift;
%% Restore soundspeed
lastSoundspeed = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'undoCopySoundspeed'}, false);
......@@ -22,7 +22,7 @@ if islogical(lastSoundspeed)
return;
end
artoaWorkspace.editOffsets.soundspeed.Empirical(1) = lastSoundspeed(1);
artoaWorkspace.editOffsets.soundspeed.Applied(1) = lastSoundspeed(1);
artoa.controller.edit.offsets.updateGui();
......
......
......@@ -20,7 +20,7 @@ availableCallbacks = { ...
'checkboxUseOffsets', ...
'buttonCopyFromOptimum', ...
'buttonCopyFromMeasured', ...
'buttonEmpiricalToNan', ...
'buttonAppliedToNan', ...
'buttonUndoLastCopy' ...
};
......
......
......@@ -31,7 +31,7 @@ artoaWorkspace.editOffsets.soundspeed{1, :} = [ ...
artoaWorkspace.editOffsets.soundspeed.Properties.RowNames = {'Soundspeed'};
artoaWorkspace.editOffsets.soundspeed.Properties.VariableNames = ...
{'Measured', 'Optimum', 'Empirical'};
{'Measured', 'Optimum', 'Applied'};
end
function [] = saveEmpiricalState()
function [] = saveAppliedState()
%SAVEEMPIRICALSTATE Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
artoaWorkspace.editOffsets.undoCopyValues = ...
artoaWorkspace.editOffsets.offsets(:, {'EmpiricalOffset', 'EmpiricalDrift'});
artoaWorkspace.editOffsets.offsets(:, {'AppliedOffset', 'AppliedDrift'});
artoaWorkspace.editOffsets.undoCopySoundspeed = ...
artoaWorkspace.editOffsets.soundspeed.Empirical(1);
artoaWorkspace.editOffsets.soundspeed.Applied(1);
end
......@@ -37,8 +37,8 @@ for o = 1:length(fnames)
if artoa.data.hasMember(artoaWorkspace, {'editOffsets', 'offsets'}) ...
&& any(contains(artoaWorkspace.editOffsets.offsets.Properties.RowNames, fnames{o})) ...
&& artoaWorkspace.editOffsets.useOffsets
offset = artoaWorkspace.editOffsets.offsets{fnames{o}, 'EmpiricalOffset'};
drift = artoaWorkspace.editOffsets.offsets{fnames{o}, 'EmpiricalDrift'};
offset = artoaWorkspace.editOffsets.offsets{fnames{o}, 'AppliedOffset'};
drift = artoaWorkspace.editOffsets.offsets{fnames{o}, 'AppliedDrift'};
% check if Inf
if isinf(offset)
offset = 0;
......
......
......@@ -58,7 +58,7 @@ callbacks.inputSoundspeed = @artoa.controller.edit.offsets.inputSoundspeed;
callbacks.buttonCopyFromOptimum = @artoa.controller.edit.offsets.buttonCopyFromOptimum;
callbacks.buttonCopyFromMeasured = @artoa.controller.edit.offsets.buttonCopyFromMeasured;
callbacks.buttonUndoLastCopy = @artoa.controller.edit.offsets.buttonUndoLastCopy;
callbacks.buttonEmpiricalToNan = @artoa.controller.edit.offsets.buttonEmpiricalToNan;
callbacks.buttonAppliedToNan = @artoa.controller.edit.offsets.buttonAppliedToNan;
artoaGui.callbacks.main = callbacks;
......
......
......@@ -18,7 +18,7 @@ end
%% Fill with manual values or NaN
if ~islogical(soundspeedTable)
initMatrix = repmat(soundspeedTable{'Soundspeed', 'Empirical'}, length(soundsourceNames), 1);
initMatrix = repmat(soundspeedTable{'Soundspeed', 'Applied'}, length(soundsourceNames), 1);
else
initMatrix = NaN(length(soundsourceNames), 1);
end
......
......
......@@ -18,7 +18,7 @@ availableCallbacks = { ...
'checkboxUseOffsets', ...
'buttonCopyFromOptimum', ...
'buttonCopyFromMeasured', ...
'buttonEmpiricalToNan', ...
'buttonAppliedToNan', ...
'buttonUndoLastCopy' ...
};
......@@ -104,7 +104,7 @@ artoaGui.editOffsets.checkboxUseOffsets = uicontrol( ...
artoaGui.editOffsets.buttonCopyFromMeasured = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
'String', 'Copy Measured to Empirical', ...
'String', 'Copy Measured to Applied', ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
......@@ -114,7 +114,7 @@ artoaGui.editOffsets.buttonCopyFromMeasured = uicontrol( ...
artoaGui.editOffsets.buttonCopyFromOptimum = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
'String', 'Copy Optimum to Empirical', ...
'String', 'Copy Optimum to Applied', ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
......@@ -122,14 +122,14 @@ artoaGui.editOffsets.buttonCopyFromOptimum = uicontrol( ...
'CallBack', pCallbacks.buttonCopyFromOptimum ...
);
artoaGui.editOffsets.buttonEmpiricalToNan = uicontrol( ...
artoaGui.editOffsets.buttonAppliedToNan = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
'String', 'Empirical to NaN', ...
'String', 'Applied to NaN', ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [(1.5*left + fullwidth/2) .275 fullwidth/2 .2], ...
'CallBack', pCallbacks.buttonEmpiricalToNan ...
'CallBack', pCallbacks.buttonAppliedToNan ...
);
artoaGui.editOffsets.buttonUndoLastCopy = uicontrol( ...
......
......
......@@ -6,8 +6,8 @@ function [A, unfilteredA] = filterCalculationTables(pA, pOffsets)
A = pA;
%% Initialize constants
driftColumnName = 'EmpiricalDrift';
offsetColumnName = 'EmpiricalOffset';
driftColumnName = 'AppliedDrift';
offsetColumnName = 'AppliedOffset';
floatColumnName = 'Float';
offsetSuffix = 'Offset';
......
......
......@@ -10,8 +10,8 @@ defaultVariableNames = { ...
'Drift', ...
'OptimumTotalOffset', ...
'OptimumTotalDrift', ...
'EmpiricalOffset', ...
'EmpiricalDrift' ...
'AppliedOffset', ...
'AppliedDrift' ...
};
......
......
......@@ -38,13 +38,13 @@ function [A, B, X, unfilteredA, unfilteredB, D] = solve(pRfb, pSoundsources, pTr
B.toa = B.toa - unfilteredC.ReferenceTime;
%% Use soundspeed
if ~isnan(pOffsetsParameter.soundspeed{'Soundspeed', 'Empirical'})
if ~isnan(pOffsetsParameter.soundspeed{'Soundspeed', 'Applied'})
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);
B.toa = B.toa - A{:, 'Distances'} * (pOffsetsParameter.soundspeed{'Soundspeed', 'Applied'} / 1000);
A.Distances = [];
end
......
......
......@@ -9,7 +9,7 @@ function [B] = subtractKnownDrifts(pA, pB, pOffsets, pSkipFloatDrift, pSkipSound
% pB (table): See pA.
% pOffsets (table): The table containing the soundsources
% as row, and the offsets to use as
% column with column name "EmpiricalOffset".
% column with column name "AppliedOffset".
% pSkipFloatDrift (bool): Default: false. If set to true, the
% calculation of the float offset will be
% skipped.
......@@ -28,7 +28,7 @@ elseif nargin == 4
end
%% Prepare constants
driftColumnName = 'EmpiricalDrift';
driftColumnName = 'AppliedDrift';
floatRowName = 'Float';
%% Initialize return variables
......
......
......@@ -9,7 +9,7 @@ function [B] = subtractKnownOffsets(pA, pB, pOffsets, pSkipFloatOffset, pSkipSou
% pB (table): See pA.
% pOffsets (table): The table containing the soundsources
% as row, and the offsets to use as
% column with column name "EmpiricalOffset".
% column with column name "AppliedOffset".
% pSkipFloatOffset (bool): Default: false. If set to true, the
% calculation of the float offset will be
% skipped.
......@@ -28,7 +28,7 @@ elseif nargin == 4
end
%% Prepare constants
offsetColumnName = 'EmpiricalOffset';
offsetColumnName = 'AppliedOffset';
floatRowName = 'Float';
%% Initialize return variables
......
......
......@@ -16,8 +16,8 @@ function [toaData] = recalculate(pFloat, pToaData, pOffsetsTable, pAppliedSounds
% toaData (struct): The toa data structure with adjusted TOAs
%% Prepare constants
driftColumnName = 'EmpiricalDrift';
offsetColumnName = 'EmpiricalOffset';
driftColumnName = 'AppliedDrift';
offsetColumnName = 'AppliedOffset';
%% Prepare return variable
toaData = pToaData;
......
......
%% Rename Empirical to Applied
if ~artoa.data.hasMember(artoaWorkspace, 'editOffsets', 'offsets', 'EmpiricalOffset')
artoaWorkspace.editOffsets.offsets.AppliedOffset = artoaWorkspace.editOffsets.offsets.EmpiricalOffset;
artoaWorkspace.editOffsets.offsets = removevars(artoaWorkspace.editOffsets.offsets, {'EmpiricalOffset'});
end
if ~artoa.data.hasMember(artoaWorkspace, 'editOffsets', 'offsets', 'EmpiricalDrift')
artoaWorkspace.editOffsets.offsets.AppliedDrift = artoaWorkspace.editOffsets.offsets.EmpiricalDrift;
artoaWorkspace.editOffsets.offsets = removevars(artoaWorkspace.editOffsets.offsets, {'EmpiricalDrift'});
end
%% Rename soundspeed empirical to applied
if ~artoa.data.hasMember(artoaWorkspace, 'editOffsets', 'soundspeed', 'Empirical')
artoaWorkspace.editOffsets.soundspeed.Applied = artoaWorkspace.editOffsets.soundspeed.Empirical;
artoaWorkspace.editOffsets.soundspeed = removevars(artoaWorkspace.editOffsets.soundspeed, {'Empirical'});
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment