ring_widths#
- anri.index.ring_widths(prof, lo, step, ring_tth, frac=0.95, max_hw=0.5)[source]#
Measure each ring’s offset and half-width (degrees 2theta) from a 2theta profile.
Each ring is looked at within half the gap to its neighbours (at most
max_hw). Background: the median of the outer fifth of that window. Offset: the centroid minus the ring’s 2theta. Half-width: the distance from the centroid that holdsfracof the ring’s net intensity. It sums everything that spreads a ring: parallax (sample size / distance), strain, peak size and detector distortion. A ring without intensity gets offset 0 and the whole window.- Parameters:
prof (
Array|ndarray|bool|number|bool|int|float|complex) – Intensity per 2theta bin, fromtth_profile()lo (
float) – The binsstep (
float) – The binsring_tth (
Array|ndarray|bool|number|bool|int|float|complex) – [Nr] 2theta of the ringsfrac (
float, default:0.95) – Fraction of a ring’s intensity within the half-widthmax_hw (
float, default:0.5) – Largest half-width considered
- Returns:
offset, half_width (
np.ndarray) – [Nr] each, in degrees