-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathairwave-allToJDX.py
72 lines (63 loc) · 2.13 KB
/
airwave-allToJDX.py
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
#script para generar jcamps del proyecto airwave
import os
from os.path import join
dataPath = '/home/abolanos/homeHost/decompressTest';
pathForSave = '/home/abolanos/homeHost/airwaveJres';
folderList = os.listdir(dataPath);
nmrTypePosition = 1; # esta variable deberia desaparecer porque no todos los archivos tienen la dimension en el nombre.
nbBrukerData = 0
nbOneDBruker = 0
nbTwoDBruker = 0
nbOneD = 0
varianList = [];
counter = 1
for folder in folderList:
exist = False;
splittedFolderName = folder.split('_');
rackNumber = int(splittedFolderName[2].replace('Rack', ''));
if rackNumber > 9: continue
rackNumber = str(rackNumber)
for root, dirs, files in os.walk(join(dataPath,folder), topdown=True):
isBruker = False; isOneD = False; isTwoD = False;
for file in files:
if file.lower() == 'fid':
isOneD = True
if os.access(join(root, 'acqu'), os.F_OK):
isBruker = True
break
if file.lower() == 'ser':
isTwoD = True
if os.access(join(root, 'acqu2s'), os.F_OK):
isBruker = True
break
if isBruker:
nbBrukerData += 1
if isOneD:
nbOneDBruker += 1
if isTwoD:
nbTwoDBruker += 1
splittedDirs = root.split('/');
expno = str(int(splittedDirs[len(splittedDirs)-1]))
#MSG(nameFile);
nameFile = 'Airwave-'+rackNumber+'-'+expno+'-1'
tempath = os.path.join(pathForSave, nameFile)
expno = str(int(expno) - 1)
RE_PATH(os.path.join(root, 'pdata', '1'))
nameFile = 'Airwave-'+rackNumber+'-'+expno+'-1'
title = 'C:'+nameFile+'\n'+'B:001\nE:[email protected]'
tojdx = "tojdx \""+ tempath + ".jdx" + "\"" + " 1 3 " + "\"" +title + "\"" + " BRUKER *"
XCMD(tojdx, WAIT_TILL_DONE)
counter +=1;
elif isOneD:
MSG(folder)
#tempath = os.path.join(pathForSave, folder);
#mytitle = '*';
#e = 'vconv ' + root + ' ' + folder + ' ' + str(counter) + ' C:/Users/JuanCBA/Desktop/desktop/varianData Bruker';
#result = XCMD(e, NO_WAIT_TILL_DONE);
#MSG(folder)
#varianList.append()
#tojdx = "tojdx \""+ tempath + ".jdx" + "\"" + " 2 3 " + mytitle + " BRUKER *"
#XCMD(tojdx, WAIT_TILL_DONE)
#counter +=1;
#if counter > 1: break;
MSG(str(nbTwoDBruker))