Latest script to carry out PCA on experimental dataset

This commit is contained in:
Karthik 2025-08-14 17:54:47 +02:00
parent 832431bac5
commit ea14ccddf4

View File

@ -71,6 +71,76 @@ skipMovieRender = true;
skipSaveFigures = true;
skipSaveOD = true;
%% ===== S-D Settings =====
groupList = ["/images/MOT_3D_Camera/in_situ_absorption", "/images/ODT_1_Axis_Camera/in_situ_absorption", ...
"/images/ODT_2_Axis_Camera/in_situ_absorption", "/images/Horizontal_Axis_Camera/in_situ_absorption", ...
"/images/Vertical_Axis_Camera/in_situ_absorption"];
folderPath = "//DyLabNAS/Data/TwoDGas/2025/06/24/";
run = '0001';
folderPath = strcat(folderPath, run);
cam = 5;
angle = 0;
center = [1410, 2030];
span = [200, 200];
fraction = [0.1, 0.1];
pixel_size = 5.86e-6; % in meters
magnification = 23.94;
removeFringes = false;
ImagingMode = 'HighIntensity';
PulseDuration = 5e-6; % in s
% Fourier analysis settings
% Radial Spectral Distribution
theta_min = deg2rad(0);
theta_max = deg2rad(180);
N_radial_bins = 500;
Radial_Sigma = 2;
Radial_WindowSize = 5; % Choose an odd number for a centered moving average
% Angular Spectral Distribution
r_min = 10;
r_max = 20;
N_angular_bins = 180;
Angular_Threshold = 75;
Angular_Sigma = 2;
Angular_WindowSize = 5;
zoom_size = 50; % Zoomed-in region around center
% Plotting and saving
scan_parameter = 'ps_rot_mag_fin_pol_angle';
% scan_parameter = 'rot_mag_field';
savefileName = 'StripesToDroplets';
font = 'Bahnschrift';
if strcmp(savefileName, 'DropletsToStripes')
scan_groups = 0:5:45
titleString = 'Droplets to Stripes';
elseif strcmp(savefileName, 'StripesToDroplets')
scan_groups = 45:-5:0;
titleString = 'Stripes to Droplets';
end
% Flags
skipNormalization = true;
skipUnshuffling = false;
skipPreprocessing = true;
skipMasking = true;
skipIntensityThresholding = true;
skipBinarization = true;
skipMovieRender = true;
skipSaveFigures = true;
skipSaveOD = true;
%% ===== Load and compute OD image, rotate and extract ROI for analysis =====
% Get a list of all files in the folder with the desired file name pattern.
@ -203,6 +273,7 @@ colorbar;
title(sprintf('First Principal Component (PC1) Image - Explains %.2f%% Variance', explained(1)));
%% Distribution scatter plot
numGroups = numel(scan_groups);
colors = lines(numGroups);
figure(2); clf; set(gcf, 'Color', 'w', 'Position', [100 100 950 750]); hold on;