def Lorentz1d(x, *p):
    """
    function to calculate a general one dimensional Lorentzian

    Parameters
    ----------
    x :     array-like
        coordinate(s) where the function should be evaluated
    p :     list
        list of parameters of the Lorentz-function
        [XCEN, FWHM, AMP, BACKGROUND]

    Returns
    -------
    array-like
        the value of the Lorentian described by the parameters p
        at position (x, y)

    """
    g = p[3] + p[2] / (1 + (2 * (x - p[0]) / p[1]) ** 2)
    return g
