ScipyUtils.BoundsChecker

ScipyUtils.BoundsChecker#

ScipyUtils.BoundsChecker.py

check_egh_bounds(x, y, x0, bounds, modify=False, debug=False)#

Check if the parameters for EGH function are within specified bounds. Optionally modify the parameters to fit within bounds and visualize the results.

Parameters:
  • x (array-like) – The x-values of the data.

  • y (array-like) – The y-values of the data.

  • x0 (array-like) – The initial guess parameters for the EGH function, expected to be in groups of four (H, tR, sigma, tau).

  • bounds (list of tuples) – The bounds for each parameter, specified as (min, max) pairs.

  • modify (bool, optional) – If True, modify x0 to fit within bounds. Default is False.

  • debug (bool, optional) – If True, print debug information and plot the results. Default is False.

Returns:

x0 – The modified parameters, if modify is True. Otherwise, returns None.

Return type:

array-like