Bugfixes - all analysis routines runs now on multi-parameter scans as well.
This commit is contained in:
parent
228a35d22e
commit
717f2c84e9
@ -26,7 +26,6 @@ function results = conductSpectralAnalysis(od_imgs, scan_parameter_values, optio
|
|||||||
% theta_min, theta_max - angular range for radial spectrum integration
|
% theta_min, theta_max - angular range for radial spectrum integration
|
||||||
% N_radial_bins - number of radial bins for S(k)
|
% N_radial_bins - number of radial bins for S(k)
|
||||||
% Radial_WindowSize - window size for smoothing radial spectrum
|
% Radial_WindowSize - window size for smoothing radial spectrum
|
||||||
% scan_parameter - string, type of scan parameter (used in plot text)
|
|
||||||
% font - font name for plots
|
% font - font name for plots
|
||||||
%
|
%
|
||||||
% Outputs:
|
% Outputs:
|
||||||
@ -55,7 +54,6 @@ function results = conductSpectralAnalysis(od_imgs, scan_parameter_values, optio
|
|||||||
skipLivePlot = options.skipLivePlot;
|
skipLivePlot = options.skipLivePlot;
|
||||||
skipSaveFigures = options.skipSaveFigures;
|
skipSaveFigures = options.skipSaveFigures;
|
||||||
saveDirectory = options.saveDirectory;
|
saveDirectory = options.saveDirectory;
|
||||||
scan_parameter = options.scan_parameter;
|
|
||||||
font = options.font;
|
font = options.font;
|
||||||
|
|
||||||
%% ===== Initialization =====
|
%% ===== Initialization =====
|
||||||
@ -178,8 +176,14 @@ function results = conductSpectralAnalysis(od_imgs, scan_parameter_values, optio
|
|||||||
title('OD Image', 'FontSize', 16, 'FontWeight', 'bold', 'Interpreter', 'tex', 'FontName', font);
|
title('OD Image', 'FontSize', 16, 'FontWeight', 'bold', 'Interpreter', 'tex', 'FontName', font);
|
||||||
|
|
||||||
% Annotate scan parameter
|
% Annotate scan parameter
|
||||||
% --- Extract parameter row for this shot ---
|
% Extract parameter row for this shot
|
||||||
|
if iscell(scan_parameter_values)
|
||||||
|
% Multi-parameter scan stored as cell array of row vectors
|
||||||
|
param_row = scan_parameter_values{k};
|
||||||
|
else
|
||||||
|
% Numeric vector / matrix
|
||||||
param_row = scan_parameter_values(k,:);
|
param_row = scan_parameter_values(k,:);
|
||||||
|
end
|
||||||
|
|
||||||
% --- Ensure units list is long enough ---
|
% --- Ensure units list is long enough ---
|
||||||
if numel(unitList) < numel(param_row)
|
if numel(unitList) < numel(param_row)
|
||||||
@ -189,7 +193,7 @@ function results = conductSpectralAnalysis(od_imgs, scan_parameter_values, optio
|
|||||||
% --- Place one text object per parameter ---
|
% --- Place one text object per parameter ---
|
||||||
xPos = 0.975; % normalized x-position (right-aligned)
|
xPos = 0.975; % normalized x-position (right-aligned)
|
||||||
yPos = 0.975; % starting y-position (top)
|
yPos = 0.975; % starting y-position (top)
|
||||||
yStep = 0.05; % vertical spacing between multiple parameters
|
yStep = 0.075; % vertical spacing between multiple parameters
|
||||||
|
|
||||||
for j = 1:numel(param_row)
|
for j = 1:numel(param_row)
|
||||||
[unitSuffix, txtInterpreter] = getUnitInfo(unitList{j});
|
[unitSuffix, txtInterpreter] = getUnitInfo(unitList{j});
|
||||||
|
|||||||
@ -9,9 +9,20 @@ function results = extractAutocorrelation(theta_values, angular_spectral_distrib
|
|||||||
delta_nkr_all(k, :) = angular_spectral_distribution{k};
|
delta_nkr_all(k, :) = angular_spectral_distribution{k};
|
||||||
end
|
end
|
||||||
|
|
||||||
% ===== Group images by scan parameter values =====
|
% ===== Determine unique scan parameter values =====
|
||||||
[unique_scan_parameter_values, ~, idx] = unique(scan_parameter_values);
|
if isnumeric(scan_parameter_values) && isvector(scan_parameter_values)
|
||||||
N_params = length(unique_scan_parameter_values);
|
% --- Single parameter case (numeric vector) ---
|
||||||
|
[unique_scan_parameter_values, ~, idx] = unique(scan_parameter_values(:), 'stable');
|
||||||
|
N_params = numel(scan_parameter_values);
|
||||||
|
|
||||||
|
elseif iscell(scan_parameter_values)
|
||||||
|
% --- Multi-parameter case (cell array of row vectors) ---
|
||||||
|
params = cell2mat(scan_parameter_values); % convert to numeric matrix
|
||||||
|
[unique_scan_parameter_values, ~, idx] = unique(params, 'rows', 'stable');
|
||||||
|
N_params = numel(scan_parameter_values);
|
||||||
|
else
|
||||||
|
error('Unsupported format for raw scan parameter values.');
|
||||||
|
end
|
||||||
|
|
||||||
% ===== Preallocate outputs =====
|
% ===== Preallocate outputs =====
|
||||||
g2_curves = cell(1, N_params); % each cell: [N_reps × N_angular_bins]
|
g2_curves = cell(1, N_params); % each cell: [N_reps × N_angular_bins]
|
||||||
|
|||||||
@ -21,9 +21,20 @@ function results = extractCustomCorrelation(angular_spectral_distribution, scan_
|
|||||||
delta_nkr_all(k, :) = angular_spectral_distribution{k};
|
delta_nkr_all(k, :) = angular_spectral_distribution{k};
|
||||||
end
|
end
|
||||||
|
|
||||||
% ===== Group images by scan parameter values =====
|
% ===== Determine unique scan parameter values =====
|
||||||
[unique_scan_parameter_values, ~, idx] = unique(scan_parameter_values);
|
if isnumeric(scan_parameter_values) && isvector(scan_parameter_values)
|
||||||
N_params = length(unique_scan_parameter_values);
|
% --- Single parameter case (numeric vector) ---
|
||||||
|
[~, ~, idx] = unique(scan_parameter_values(:), 'stable');
|
||||||
|
N_params = numel(scan_parameter_values);
|
||||||
|
|
||||||
|
elseif iscell(scan_parameter_values)
|
||||||
|
% --- Multi-parameter case (cell array of row vectors) ---
|
||||||
|
params = cell2mat(scan_parameter_values); % convert to numeric matrix
|
||||||
|
[~, ~, idx] = unique(params, 'rows', 'stable');
|
||||||
|
N_params = numel(scan_parameter_values);
|
||||||
|
else
|
||||||
|
error('Unsupported format for raw scan parameter values.');
|
||||||
|
end
|
||||||
|
|
||||||
% ===== Angular settings =====
|
% ===== Angular settings =====
|
||||||
angle_range = 180;
|
angle_range = 180;
|
||||||
|
|||||||
@ -39,7 +39,7 @@ function [results, scan_parameter_values, scan_reference_values] = performAnalys
|
|||||||
options.skipFullODImagesFolderUse (1,1) logical
|
options.skipFullODImagesFolderUse (1,1) logical
|
||||||
options.showProgressBar (1,1) logical
|
options.showProgressBar (1,1) logical
|
||||||
options.measurementName (1,:) char
|
options.measurementName (1,:) char
|
||||||
options.scanParameterUnits (1,:) char
|
options.scanParameterUnits {mustBeText} = ''
|
||||||
options.selectedPath (1,:) char
|
options.selectedPath (1,:) char
|
||||||
options.folderPath (1,:) char
|
options.folderPath (1,:) char
|
||||||
options.baseDataFolder (1,:) char
|
options.baseDataFolder (1,:) char
|
||||||
|
|||||||
@ -56,7 +56,7 @@ options.skipFullODImagesFolderUse = false;
|
|||||||
options.skipSaveData = false;
|
options.skipSaveData = false;
|
||||||
options.skipSaveFigures = true;
|
options.skipSaveFigures = true;
|
||||||
options.skipSaveProcessedOD = true;
|
options.skipSaveProcessedOD = true;
|
||||||
options.skipLivePlot = true;
|
options.skipLivePlot = false;
|
||||||
options.showProgressBar = true;
|
options.showProgressBar = true;
|
||||||
|
|
||||||
% Extras
|
% Extras
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user