pysrw.lib.uti_math.fwhm

Contents

pysrw.lib.uti_math.fwhm#

pysrw.lib.uti_math.fwhm(x, y, shift=0.5, return_as_dict=False)[source]#

The function searches x-values (roots) where y=0 (after normalization to values between 0 and 1 and shifting the values down by 0.5 (default value)) based on linear interpolation, and calculates full width at half maximum (FWHM).

Parameters:
  • x – an array of x values.

  • y – an array of y values.

  • shift – an optional shift to be used in the process of normalization (between 0 and 1).

  • return_as_dict – if to return a dict with ‘fwhm’ and ‘x_range’

Returns:

a value of the FWHM or dictionary consisting of ‘fwhm’ and ‘x_range’