Newer
Older
function [xop_dir,msg] = gtCrystXopInitializeDirectory(name, material)
% GTCRYSTXOPINITIALIZEDIRECTORY
% Creates the directory in /data/id11/graintracking/file_xop for this sample
% ------------------------------------------------
%
% INPUT:
% name = parameters.acq.name
%
% OUTPUT:
% xop_dir = the name of the directory created
%
top_xop_dir=fullfile('/data','id11','archive','file_xop');
dataset_xop_dir=fullfile('/data','id11','archive','file_xop', name);
material_xop_dir=fullfile('/data','id11','archive','file_xop', name, material);
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
% create top level directory if needed
if ~exist(top_xop_dir,'dir')
[~,msg]=mkdir(top_xop_dir); disp(msg)
end
% now create directory for the dataset
if ~exist(dataset_xop_dir,'dir')
% this is the first time - create directory for the dataset
[~,msg]=mkdir(dataset_xop_dir); disp(msg)
end
% now create a sub-directory for this material
if ~exist(material_xop_dir,'dir')
% this is the first time - create sub-directory for the material
[~,msg]=mkdir(material_xop_dir); disp(msg)
xop_dir=material_xop_dir;
else
% we already have a directory, so create a new one for this date
xop_dir=fullfile(material_xop_dir, date());
[~,msg]=mkdir(xop_dir); disp(msg)
end
% for this function, nothing else is needed. Everything else will go
% inside this folder
%else
% xop_dir=fullfile(xop_dir, name, material, date());
% [~,msg]=mkdir(xop_dir); disp(msg)
% elseif ~exist(fullfile(xop_dir,name, material),'dir')
% xop_dir=fullfile(xop_dir, name, material);
% [~,msg]=mkdir(xop_dir); disp(msg)
% % read info from xop/diamond
% disp('Please create the .csv or .dat file from Diamond or xop')
% disp('and copy it in this folder:')
% disp(xop_dir)
% disp('using <material>.csv from Diamond or <material>.dat from xop')
% check=inputwdefault('Have you done this? [y/n]','n');
% if strcmpi(check,'y')
% xop=gtLoadReflections(xop_dir);
% msg=[];
% else
% xop=[];
% msg=['Before running gtPreprocessing, run by yourself this lines:'...
% ' cd(ANALYSIS_DIR) '...
% ' load(parameters);'...
% ' xop_dir=' xop_dir...
% ' xop=gtLoadReflections(xop_dir);'...
% ' parameters.xop=xop;'...
% ' save parameters parameters'];
% % need more instructions here to complete parameters.cryst
% end
%
% xop.xop_dir = xop_dir;
end % end of function