fit_transient_both

TRXASprefitpack.driver.fit_transient_both(irf: str, fwhm_init: Union[float, ndarray], t0_init: ndarray, tau_init: ndarray, tau_osc_init: ndarray, period_osc_init: ndarray, base: bool, method_glb: Optional[str] = None, method_lsq: Optional[str] = 'trf', kwargs_glb: Optional[dict] = None, kwargs_lsq: Optional[dict] = None, bound_fwhm: Optional[Sequence[Tuple[float, float]]] = None, bound_t0: Optional[Sequence[Tuple[float, float]]] = None, bound_tau: Optional[Sequence[Tuple[float, float]]] = None, bound_tau_osc: Optional[Sequence[Tuple[float, float]]] = None, bound_period_osc: Optional[Sequence[Tuple[float, float]]] = None, same_t0: Optional[bool] = False, name_of_dset: Optional[Sequence[str]] = None, t: Optional[Sequence[ndarray]] = None, intensity: Optional[Sequence[ndarray]] = None, eps: Optional[Sequence[ndarray]] = 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 and sum of the convolution of damped oscillation and insrumental 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. (method_glb) 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 optain. 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

  • tau_osc (np.ndarray) – lifetime constant for each damped oscillation component

  • period_init (np.ndarray) – period of each oscillation 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.

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

  • bound_period_osc (sequence of tuple) – boundary for period of damped oscillation component, if bound_period_osc 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

  • 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