def METHOD_NAME(Y_array, X_array, shift=0):
    """
    Computation of the bunch length and position from the FWHM
    assuming Gaussian line density.
    """
    half_max = shift + 0.5 * (Y_array.max() - shift)
    # First aproximation for the half maximum values
    taux = np.where(Y_array >= half_max)
    t1 = taux[0][0]
    t2 = taux[0][-1]
    # Interpolation of the time where the line density is half the maximum
    bin_size = X_array[1] - X_array[0]
    try:
        t_left = X_array[t1] - bin_size * \
            (Y_array[t1] - half_max) / \
            (Y_array[t1] - Y_array[t1 - 1])
        t_right = X_array[t2] + bin_size * \
            (Y_array[t2] - half_max) / \
            (Y_array[t2] - Y_array[t2 + 1])
        bl_fwhm = 4 * (t_right - t_left) / (2 * np.sqrt(2 * np.log(2)))
        bp_fwhm = (t_left + t_right) / 2
    except Exception:
        bl_fwhm = np.nan
        bp_fwhm = np.nan
    return bp_fwhm, bl_fwhm