added ptychography scripts

This commit is contained in:
2026-08-07 16:31:16 +09:00
parent 3700c783e4
commit 5945346784
19 changed files with 5599 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
function par = parameter_builder(parfile)
par = struct;
fileID = fopen(parfile, 'r');
tline = fgetl(fileID);
while ischar(tline)
tline = fgetl(fileID);
if tline == -1
break;
end
% disp(tline);
temp = split(tline);
if size(temp, 1) == 1 || temp{1,1}(1) == '#'
continue
end
if ~isnan(str2double(temp{2,1}))
par.(temp{1,1}) = str2double(temp{2,1});
else
par.(temp{1,1}) = temp{2,1};
end
end
% fclose(fileID);
% save( parfile, "par");
end