EASY work

This commit is contained in:
2024-07-25 00:24:25 -04:00
parent 5a9addbeb4
commit f2fcb34b5e
2 changed files with 129 additions and 73 deletions

View File

@@ -11,7 +11,7 @@ function varargout = EASYconsole(varargin)
global wCodeDir
%global ImParMat
wCodeDir=pwd
wCodeDir=pwd;
% changing directory to wCodeDir
returnStartDir
@@ -133,17 +133,11 @@ function NewExpDat_Callback(~, ~, ~)
% Set paths
newExpfilePref= strrep(newExpfile,'.mat','');
resDirName=strcat('Results',datestr(now,29),newExpfilePref);
resDir=fullfile(newExppath,resDirName);
matDir=fullfile(newExppath,resDirName,'matResults');
ExpOutmat=fullfile(matDir,strcat(datestr(now,29),newExpfile));
ExpPath=fullfile(newExppath);
% create the the matResults dir
if ~exist(matDir)
mkdir (matDir);
end
%***Added for 'parfor global' to preallocate 'scan' structure 20-0123*****
nlist=dir(fullfile(ExpPath,'*'));
nnn=0;
@@ -160,23 +154,24 @@ function NewExpDat_Callback(~, ~, ~)
scan(scanMax)= struct(); %changed for parfor global 20_0118
save(ExpOutmat,'scan')
% create supporting dirs
dirs = {'PrintResults', 'CFfigs', 'Fotos', 'Fotos/BkUp'};
for i = 1:length(dirs)
d = dirs{i};
if ~exist(fullfile(ExpPath, resDirName, d), 'dir')
mkdir(fullfile(ExpPath, resDirName, d));
end
end
% BCR rewrote these but moved the functionality into the main workflow script
% % create supporting dirs
% dirs = {'PrintResults', 'CFfigs', 'Fotos', 'Fotos/BkUp'};
% for i = 1:length(dirs)
% d = dirs{i};
% if ~exist(fullfile(ExpPath, resDirName, d), 'dir')
% mkdir(fullfile(ExpPath, resDirName, d));
% end
% end
% templateDirs are stored in the easy template directory
templates = {'figs', 'PTmats'}
for i = 1:length(templates)
d = dirs{i};
if ~exist(fullfile(ExpPath, resDirName, d), 'dir')
copyfile((fullfile(wCodeDir,d)), (fullfile(ExpPath,resDirName,d)));
end
end
% % templateDirs are stored in the easy template directory
% templates = {'figs', 'PTmats'}
% for i = 1:length(templates)
% d = dirs{i};
% if ~exist(fullfile(ExpPath, resDirName, d), 'dir')
% copyfile((fullfile(wCodeDir,d)), (fullfile(ExpPath,resDirName,d)));
% end
% end
clear sbdg % reduce possible retention of a previous job sdbg
sbdg= cell(1,scanMax);
@@ -243,13 +238,13 @@ function LoadDatFile_Callback(~, ~, ~)
mkdir(fullfile(openExppath,'\BkUp'));
% create supporting dirs
dirs = {'PrintResults', 'figs', 'CFfigs', 'PTmats', 'Fotos'}
for i = 1:length(dirs)
d = dirs{i}
if ~exist(fullfile(resDir, d), 'dir')
mkdir(fullfile(resDir, d));
end
end
% dirs = {'PrintResults', 'figs', 'CFfigs', 'PTmats', 'Fotos'}
% for i = 1:length(dirs)
% d = dirs{i}
% if ~exist(fullfile(resDir, d), 'dir')
% mkdir(fullfile(resDir, d));
% end
% end
catch
returnStartDir