Skip to content

Commit

Permalink
fixed airpls baseline correction
Browse files Browse the repository at this point in the history
  • Loading branch information
ludwigc committed Sep 29, 2023
1 parent 116b085 commit 445cb47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion metabolabpy/nmr/acqPars.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ def parse_reg_ex(self):
except:
pass

self.temperature = float(self.reg_ex.temperature.findall(self.acqus_text)[0])
try:
self.temperature = float(self.reg_ex.temperature.findall(self.acqus_text)[0])
except:
self.temperature = 300

dd = self.reg_ex.cnst.search(self.acqus_text)
dd = self.acqus_text[dd.span()[0]:]
dd = dd[dd.find('\n') + 1:]
Expand Down
2 changes: 1 addition & 1 deletion metabolabpy/nmr/nmrData.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def autobaseline1d(self, lam=1e6, alg='rolling_ball', max_iter=50, alpha=0.1, be
if alg == 'irsqr':
baseline_fitter = Baseline(spc, check_finite=False)
baseline, params = baseline_fitter.irsqr(spc, lam=lam, quantile=quantile) # poly_order=poly_order, method='imodpoly')
if alg == 'irsqr':
if alg == 'airpls':
baseline_fitter = Baseline(spc, check_finite=False)
baseline, params = baseline_fitter.airpls(spc, 1e5) # poly_order=poly_order, method='imodpoly')
#baseline = airpls(spc, lam=lam, max_iter=max_iter)
Expand Down

0 comments on commit 445cb47

Please sign in to comment.