res_grad_both_same_t0

TRXASprefitpack.res.res_grad_both_same_t0(x0: ndarray, num_comp: int, num_comp_osc: int, base: bool, irf: str, fix_param_idx: Optional[ndarray] = None, t: Optional[Sequence[ndarray]] = None, intensity: Optional[Sequence[ndarray]] = None, eps: Optional[Sequence[ndarray]] = None) Tuple[ndarray, ndarray][source]

scipy.optimize.minimize compatible scalar residual and its gradient function for fitting multiple set of time delay scan with the sum of convolution of (sum of exponential decay damped oscillation) and instrumental response function

Parameters
  • x0

    initial parameter, if irf == ‘g’,’c’:

    • 1st: fwhm_(G/L)

    • 2nd to \(2+N_{dset}\): time zero of each dataset

    • \(2+N_{dset}\) to \(2+N_{dset}+N_{\tau}\): time constant of each decay component

    • \(2+N_{dset}+N_{\tau}+i\): time constant of each damped oscillation

    • \(2+N_{dset}+N_{\tau}+N_{osc}+i\): period of each damped oscillation

    if irf == ‘pv’:

    • 1st and 2nd: fwhm_G, fwhm_L

    • 3rd to \(3+N_{dset}\): time zero of each dataset

    • \(3+N_{dset}\) to \(3+N_{dset}+N_{\tau}\): time constant of each decay component

    • \(3+N_{dset}+N_{\tau}+i\): time constant of each damped oscillation

    • \(3+N_{dset}+N_{\tau}+N_{osc}+i\): period of each damped oscillation

  • num_comp – number of exponential decay component (except base)

  • num_comp_osc – number of damped oscillation component

  • base – whether or not include baseline (i.e. very long lifetime component)

  • irf

    shape of instrumental response function

    • ’g’: normalized gaussian distribution,

    • ’c’: normalized cauchy distribution,

    • ’pv’: pseudo voigt profile \((1-\eta)g(f) + \eta c(f)\)

    For pseudo voigt profile, the mixing parameter \(\eta(f_G, f_L)\) and uniform fwhm paramter \(f(f_G, f_L)\) are calculated by calc_eta and calc_fwhm routine

  • fix_param_idx – idx for fixed parameter (masked array for x0)

  • t – time points for each data set

  • intensity – sequence of intensity of datasets

  • eps – sequence of estimated error of datasets

Returns

Tuple of scalar residual function \((\frac{1}{2}\sum_i {res}^2_i)\) and its gradient