fit_transient_exp

TRXASprefitpack.driver.fit_transient_exp(irf: str, fwhm_init: float | ndarray, t0_init: ndarray, tau_init: ndarray, base: bool, method_glb: str | None = None, method_lsq: str | None = 'trf', kwargs_glb: dict | None = None, kwargs_lsq: dict | None = None, bound_fwhm: Sequence[Tuple[float, float]] | None = None, bound_t0: Sequence[Tuple[float, float]] | None = None, bound_tau: Sequence[Tuple[float, float]] | None = None, same_t0: bool | None = False, tau_mask: Sequence[ndarray] | None = None, name_of_dset: Sequence[str] | None = None, t: Sequence[ndarray] | None = None, intensity: Sequence[ndarray] | None = None, eps: Sequence[ndarray] | None = None) TransientResult[source]

driver routine for fitting multiple data set of time delay scan data with sum of the convolution of exponential decay and instrumental response function.

It separates linear and non-linear part of the optimization problem to solve non linear least sequare optimization problem efficiently.

Moreover this driver uses two step method to search best parameter, its covariance and estimated parameter error.

Step 1. (basinhopping or ampgo) Use global optimization to find rough global minimum of our objective function. In this stage, it use analytic gradient for scalar residual function.

Step 2. (method_lsq) Use least squares optimization algorithm to refine global minimum of objective function and approximate covariance matrix. Because of linear and non-linear seperation scheme, the analytic jacobian for vector residual function is hard to obtain. Thus, in this stage, it uses numerical jacobian.

Parameters:
  • irf ({'g', 'c', 'pv'}) –

    shape of instrumental response function

    ’g’: gaussian shape

    ’c’: cauchy shape

    ’pv’: pseudo voigt shape (kind 2)

  • fwhm_init (float or np.ndarray) –

    initial full width at half maximum for instrumental response function

    • if irf in [‘g’, ‘c’] then fwhm_init is float

    • if irf == ‘pv’ then fwhm_init is the numpy.ndarray with [fwhm_G, fwhm_L]

  • t0_init (np.ndarray) – time zeros for each scan

  • tau_init (np.ndarray) – lifetime constant for each decay component

  • base (bool) – Whether or not include baseline feature (i.e. very long lifetime constant)

  • method_glb ({None, 'basinhopping', 'ampgo'}) – Method for global optimization

  • method_lsq ({'trf', 'dogbox', 'lm'}) – method of local optimization for least_squares minimization (refinement of global optimization solution)

  • kwargs_glb – keyward arguments for global optimization solver

  • kwargs_lsq – keyward arguments for least square optimization solver

  • bound_fwhm (sequence of tuple) – boundary for irf parameter. If upper and lower bound are same, driver assumes that the parameter is fixed during optimization. If bound_fwhm is None, the upper and lower bound are given as (fwhm_init/2, 2*fwhm_init).

  • bound_t0 (sequence of tuple) – boundary for time zero parameter. If bound_t0 is None, the upper and lower bound are given by set_bound_t0.

  • bound_tau (sequence of tuple) – boundary for lifetime constant for decay component, if bound_tau is None, the upper and lower bound are given by set_bound_tau.

  • same_t0 (bool) – Whether or not time zero of every time delay scan in the same dataset should be same

  • tau_mask (sequence of boolean np.ndarray) – whether or not include jth time constant in ith dataset fitting (tau_mask[i][j]) If base is True, size of tau_mask[i] should be num_tau+1.

  • name_of_dset (sequence of str) – name of each dataset

  • t (sequence of np.narray) – time scan range for each datasets

  • intensity (sequence of np.ndarray) – sequence of intensity of datasets for time delay scan

  • eps (sequence of np.ndarray) – sequence of estimated errors of each dataset

  • Returns – TransientResult class object