-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalyze.m
104 lines (79 loc) · 1.86 KB
/
analyze.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
function [name,value]= analyze(RawData,varargin)
substr=strsplit(RawData,'/');
filename=strsplit(substr{2},'.');
substr=strsplit(RawData,'Input');
output=[substr{1} 'Output'];
if ~isfolder(output)
mkdir(output);
end
mkdir([output '/met']);
value={'',...
filename{1},...
strtrim(RawData),...
output,...
'4.1',...
'0.2',...
'1024',...
'8.334e-4',...
'99',...
'7',...
'123.25',...
'/home/compimglab/.lcmodel/basis-sets/gamma_press_te30_123mhz_v1.basis',...
'F',...
'F',...
[output '\Input\h2o\RAW'],...
[output '\' filename{1} '.table'],...
[output '\' filename{1} '.ps'],...
[output '/met/RAW' ],...
'30' ,...
[output '\' filename{1} '.csv'],...
[output '\' filename{1} '.coord'],...
'9',...
'14',...
'6',...
[output '\' filename{1} '.print'],...
'0.01',...
''};
name={'$LCMODL',...
'title=',...
'srcraw=',...
'savdir=',...
'ppmst=',...
'ppmend=',...
'nunfil=',...
'deltat=',...
'neach=',...
'ltable=',...
'hzpppm=',...
'filbas=',...
'doecc=',...
'dows=',...
'filh2o=',...
'filtab=',...
'filps=',...
'filraw=',...
'echot=' ,...
'filcsv=',...
'filcoo=',...
'lcoord=',...
'lcsv=',...
'lprint=',...
'filpri=',...
'WDLINE(6)=',...
'$END'};
for i =1:length(varargin)
subset=strsplit(varargin{i},'=');
indx=find(strcmp(name,[subset{1} '=']));
value{indx}=subset{2};
end
fid=fopen('run61616161.control','w');
for i=1:length(value)
if ~isempty(str2num(value{i})) | isempty(value{i})
formatSpec = '%s %s\n';
else
formatSpec = '%s ''%s''\n';
end
fprintf(fid,formatSpec,name{i},value{i})
end
fclose(fid)
end