bugs: fit display did not work when not all functions are checked; FC calc_relax changed x axis
This commit is contained in:
parent
16ccc3eb3d
commit
9aab28d593
@ -23,8 +23,7 @@ class LogGaussian(Distribution):
|
|||||||
bounds = [(0, 10)]
|
bounds = [(0, 10)]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def distribution(tau, tau0, *args):
|
def distribution(tau, tau0, sigma: float):
|
||||||
sigma = args[0]
|
|
||||||
return np.exp(-0.5*(np.log(tau/tau0)/sigma)**2)/np.sqrt(2*np.pi)/sigma
|
return np.exp(-0.5*(np.log(tau/tau0)/sigma)**2)/np.sqrt(2*np.pi)/sigma
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -82,7 +82,9 @@ class QFitDialog(QtWidgets.QWidget, Ui_FitDialog):
|
|||||||
self._current_function = None
|
self._current_function = None
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self._current_function = self.functionwidget.use_combobox.currentData()
|
f_tree = self.functionwidget.functree
|
||||||
|
func_idx = f_tree.currentItem().data(0, f_tree.counterRole)
|
||||||
|
self._current_function = self.functionwidget.functions[func_idx]
|
||||||
|
|
||||||
@QtCore.pyqtSlot(int)
|
@QtCore.pyqtSlot(int)
|
||||||
def show_function_parameter(self, function_id: int, function_idx: int = None):
|
def show_function_parameter(self, function_id: int, function_idx: int = None):
|
||||||
@ -457,6 +459,7 @@ class QFitDialog(QtWidgets.QWidget, Ui_FitDialog):
|
|||||||
|
|
||||||
def set_parameter_iter(self, fit_id: str | None, param: List[float], functions: List, cnt: int = 0):
|
def set_parameter_iter(self, fit_id: str | None, param: List[float], functions: List, cnt: int = 0):
|
||||||
for model_p in functions:
|
for model_p in functions:
|
||||||
|
if model_p['active']:
|
||||||
cnt += self.param_widgets[model_p['cnt']].set_parameter(fit_id, param[cnt:])
|
cnt += self.param_widgets[model_p['cnt']].set_parameter(fit_id, param[cnt:])
|
||||||
if model_p['children']:
|
if model_p['children']:
|
||||||
cnt += self.set_parameter_iter(fit_id, param, model_p['children'], cnt=cnt)
|
cnt += self.set_parameter_iter(fit_id, param, model_p['children'], cnt=cnt)
|
||||||
|
@ -25,7 +25,7 @@ class _AbstractFC:
|
|||||||
def _calc_relax(cls, x, c, *args, xaxis='freq', yaxis='chi', is_bpp=True, **kwargs):
|
def _calc_relax(cls, x, c, *args, xaxis='freq', yaxis='chi', is_bpp=True, **kwargs):
|
||||||
_x = x
|
_x = x
|
||||||
if xaxis == 'freq':
|
if xaxis == 'freq':
|
||||||
_x *= 2*np.pi
|
_x = 2*np.pi * x
|
||||||
|
|
||||||
if is_bpp:
|
if is_bpp:
|
||||||
r1 = cls.relax.t1(_x, *args, prefactor=c, inverse=False)
|
r1 = cls.relax.t1(_x, *args, prefactor=c, inverse=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user