Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ludwigc committed Dec 22, 2023
1 parent 5b8df1d commit cb415b3
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 8 deletions.
48 changes: 40 additions & 8 deletions metabolabpy/nmr/acqPars.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,46 @@ def __str__(self): # pragma: no cover
# end __str__

def parse_reg_ex(self):
self.sfo1 = float(self.reg_ex.sfo1.findall(self.acqus_text)[0])
self.sfo2 = float(self.reg_ex.sfo2.findall(self.acqus_text)[0])
self.sfo3 = float(self.reg_ex.sfo3.findall(self.acqus_text)[0])
self.sfo4 = float(self.reg_ex.sfo4.findall(self.acqus_text)[0])
self.sfo5 = float(self.reg_ex.sfo5.findall(self.acqus_text)[0])
self.sfo6 = float(self.reg_ex.sfo6.findall(self.acqus_text)[0])
self.sfo7 = float(self.reg_ex.sfo7.findall(self.acqus_text)[0])
self.sfo8 = float(self.reg_ex.sfo8.findall(self.acqus_text)[0])
try:
self.sfo1 = float(self.reg_ex.sfo1.findall(self.acqus_text)[0])
except:
self.sfo1 = float(self.reg_ex.sfo1i.findall(self.acqus_text)[0])

try:
self.sfo2 = float(self.reg_ex.sfo2.findall(self.acqus_text)[0])
except:
self.sfo1 = float(self.reg_ex.sfo2i.findall(self.acqus_text)[0])

try:
self.sfo3 = float(self.reg_ex.sfo3.findall(self.acqus_text)[0])
except:
self.sfo1 = float(self.reg_ex.sfo3i.findall(self.acqus_text)[0])

try:
self.sfo4 = float(self.reg_ex.sfo4.findall(self.acqus_text)[0])
except:
self.sfo1 = float(self.reg_ex.sfo4i.findall(self.acqus_text)[0])

try:
self.sfo5 = float(self.reg_ex.sfo5.findall(self.acqus_text)[0])
except:
self.sfo1 = float(self.reg_ex.sfo5i.findall(self.acqus_text)[0])

try:
self.sfo6 = float(self.reg_ex.sfo6.findall(self.acqus_text)[0])
except:
self.sfo1 = float(self.reg_ex.sfo6i.findall(self.acqus_text)[0])

try:
self.sfo7 = float(self.reg_ex.sfo7.findall(self.acqus_text)[0])
except:
self.sfo1 = float(self.reg_ex.sfo7i.findall(self.acqus_text)[0])

try:
self.sfo8 = float(self.reg_ex.sfo8.findall(self.acqus_text)[0])
except:
self.sfo1 = float(self.reg_ex.sfo8i.findall(self.acqus_text)[0])

self.bf1 = float(self.reg_ex.bf1.findall(self.acqus_text)[0])
self.bf2 = float(self.reg_ex.bf2.findall(self.acqus_text)[0])
self.bf3 = float(self.reg_ex.bf3.findall(self.acqus_text)[0])
Expand Down
8 changes: 8 additions & 0 deletions metabolabpy/nmr/acqRegEx.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ def __init__(self):
self.sfo6 = re.compile(r'##\$SFO6= (\d+\.\d+)')
self.sfo7 = re.compile(r'##\$SFO7= (\d+\.\d+)')
self.sfo8 = re.compile(r'##\$SFO8= (\d+\.\d+)')
self.sfo1i = re.compile(r'##\$SFO1= (\d+)')
self.sfo2i = re.compile(r'##\$SFO2= (\d+)')
self.sfo3i = re.compile(r'##\$SFO3= (\d+)')
self.sfo4i = re.compile(r'##\$SFO4= (\d+)')
self.sfo5i = re.compile(r'##\$SFO5= (\d+)')
self.sfo6i = re.compile(r'##\$SFO6= (\d+)')
self.sfo7i = re.compile(r'##\$SFO7= (\d+)')
self.sfo8i = re.compile(r'##\$SFO8= (\d+)')
self.bf1 = re.compile(r'##\$BF1= (\d+\.\d+)')
self.bf2 = re.compile(r'##\$BF2= (\d+\.\d+)')
self.bf3 = re.compile(r'##\$BF3= (\d+\.\d+)')
Expand Down

0 comments on commit cb415b3

Please sign in to comment.