- qspec.analyze. King.fit ( a , a_ref , x = None , y = None , xy = None , func = 'york_fit' , alpha = 0 , find_alpha = False , show = True , ** kwargs )[source]
-
- Parameters:
-
- andarray | Iterable
An Iterable of the mass numbers of the used isotopes.
- a_refndarray | Iterable
An Iterable of the mass numbers of the used reference isotopes.
- xndarray | Iterable
The x-values and their uncertainties of the King-fit to be performed. If 'mode' is "radii", this must contain the differences of mean square nuclear charge radii or the Lambda-factor. 'x' must have shape (len(a), 2). Units: (fm ** 2) or (MHz).
- yndarray | Iterable
The isotope shifts and their uncertainties of the King-fit to be performed. 'y' must have shape (len(a), 2). If None, 'y' is tried to be inherited from 'self.f'. Units: (MHz).
- xyIterable[int]
A 2-tuple of indices (ix, iy) which select the axes to use for the King-fit from 'King.x_abs' if x or y is not specified. The default value is (0, 1), fitting the second against the first axis.
- funcstr | Callable
The fitting routine. Must be one of {'york_fit' (default), 'linear_fit', 'linear_monte_carlo'}.
- alphascalar
An x-axis offset to reduce the correlation coefficient between the y-intercept and the slope. Unit: (u fm ** 2) or (u MHz).
- find_alphabool
Whether to search for the best 'alpha'. Uses the given 'alpha' as a starting point. May not give the desired result if 'alpha' was initialized to far from its optimal value.
- showbool
Whether to plot the fit result.
- kwargsNone
Additional keyword arguments are passed to 'self.plot'.
- Returns:
-
- outNone
A list of results as defined by the routine 'linear_alpha': a, b, sigma_a, sigma_b, corr_ab, alpha. The best y-intercept and slope, their respective 1-sigma uncertainties, their correlation coefficient and the used alpha.