Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit b4136c9

Browse files
modified 'w_lims' funcs --- instead of set_param_hint, now using set to constrain the fits to desired limits
1 parent 6ef348b commit b4136c9

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

PythonGUI_apps/Spectrum_analysis/Spectra_fit_funcs.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ def gaussian_model_w_lims(self, center_min=None, center_max=None):
6060
x,y = self.background_correction()
6161
gmodel = GaussianModel(prefix = 'g1_') # calling gaussian model
6262
pars = gmodel.guess(y, x=x) # parameters - center, width, height
63-
# pars['g1_center'].set(800, min = 795, max = 820)
64-
gmodel.set_param_hint('g1_center', min=center_min, max=center_max)
63+
pars['g1_center'].set(min=center_min, max=center_max)
6564
result = gmodel.fit(y, pars, x=x, nan_policy='propagate')
6665
return result
6766

@@ -84,7 +83,7 @@ def lorentzian_model_w_lims(self, center_min = None, center_max = None):
8483
x,y = self.background_correction()
8584
lmodel = LorentzianModel(prefix = 'l1_') # calling lorentzian model
8685
pars = lmodel.guess(y, x=x) # parameters - center, width, height
87-
lmodel.set_param_hint('l1_center', min = center_min, max = center_max)
86+
pars['l1_center'].set(min = center_min, max = center_max)
8887
result = lmodel.fit(y, pars, x=x, nan_policy='propagate')
8988
return result
9089

0 commit comments

Comments
 (0)