diff --git a/projects/HighSpeedExperiment_2024/analysis_script.m b/projects/HighSpeedExperiment_2024/analysis_script.m new file mode 100644 index 0000000..c68a989 --- /dev/null +++ b/projects/HighSpeedExperiment_2024/analysis_script.m @@ -0,0 +1,79 @@ + +if 0 + +folderPath = "/Volumes/NT-Labor/2024/sioe/High Speed Messungen Oktober/mpi_measurement"; + +% Get list of all files in the folder and subfolders +fileList = dir(fullfile(folderPath, '**', '*')); + + +% Loop through each file +big_wh_list = {}; +small_wh_list = {}; + +for i = 1:length(fileList) + + fileName = fileList(i).name; + iswh = strfind(fileName, 'wh'); + if ~isempty(iswh) + + wh = load(fullfile(fileList(i).folder, fileName)); + wh = wh.obj; + + if isa(wh,'DataStorage') + if prod(wh.dim) > 2 + big_wh_list{end+1} = wh; + + else + small_wh_list{end+1} = wh; + end + end + end +end +end + +%%% merge MPI structs by copying the values %%% +params.M = [4,6,8]; +params.bitrate = [224,336,448].*1e9; +params.duobinary = [0,1]; +params.interference_atten = [0 3 6 9 12 15 18 21 24 27 30 45]; +wh_new=DataStorage(params); + + +for w = 1:numel(big_wh_list) + wh = big_wh_list{w}; + for m = wh.parameter.M.values + for br = wh.parameter.bitrate.values + for db = wh.parameter.duobinary.values + for iatten = wh.parameter.interference_atten.values + + storage_names = fieldnames(wh.sto); + for i = 1:length(storage_names) + + %get two things: + %1) current data storage name + cur_storage = storage_names{i}; + %2) the value saved at this storage and dimension + value = wh.getStoValue(cur_storage,m,br,db,iatten); + + % check if storage name already exists, if not + % .addStorgae(...) + if ~isfield(wh_new.sto,cur_storage) + wh_new.addStorage(cur_storage); + end + + + if isempty(wh_new.getStoValue(cur_storage,m,br,db,iatten)) + % Finally, add the value to the repsective storage + wh_new.addValueToStorage(value,cur_storage,m,br,db,iatten); + else + warning('double vaue?') + end + + end + + end + end + end + end +end \ No newline at end of file diff --git a/projects/HighSpeedExperiment_2024/removeDotsFromFileNames.m b/projects/HighSpeedExperiment_2024/removeDotsFromFileNames.m new file mode 100644 index 0000000..6fc0754 --- /dev/null +++ b/projects/HighSpeedExperiment_2024/removeDotsFromFileNames.m @@ -0,0 +1,47 @@ + + +folderPath = "/Volumes/NT-Labor/2024/sioe/High Speed Messungen Oktober/"; + +% Get list of all files in the folder and subfolders +fileList = dir(fullfile(folderPath, '**', '*')); + +% Loop through each file +for i = 1:length(fileList) + % Get the file name and path + oldFileName = fileList(i).name; + oldFilePath = fullfile(fileList(i).folder, oldFileName); + + % Skip if it’s a directory or hidden file + if fileList(i).isdir || startsWith(oldFileName, '.') + continue; + end + + ismat = strfind(oldFileName, '.mat'); + + if ismat + continue; + else + + % Find position of last dot (for file extension) + dotIndex = strfind(oldFileName, '.'); + + % Only proceed if there is more than one dot in the file name + if ~isempty(dotIndex) + + % Replace all dots in the "base name" with underscores + sanitizedBaseName = strrep(oldFileName, '.', '_'); + + % Create the new file name with the corrected extension + newFileName = [sanitizedBaseName, '.mat']; + + % Full path of the new file + newFilePath = fullfile(fileList(i).folder, newFileName); + + % Rename the file + movefile(oldFilePath, newFilePath); + fprintf('Renamed: %s -> %s\n', oldFilePath, newFilePath); + end + + end +end +