def Fplan(A, Phi, Fstar, Rp, d, AU=False):
    """
    Planetary flux function

    Parameters
    ----------
    A : float or array-like
        Planetary geometric albedo
    Phi : float
        Planetary phase function
    Fstar : float or array-like
        Stellar flux [W/m**2/um]
    Rp : float
        Planetary radius [Earth radii]
    d : float
        Distance to star [pc]
    AU : bool, optional
        Flag that indicates d is in AU

    Returns
    -------
    Fplan : float or array-like
        Planetary flux [W/m**2/um]
    """
    Re = 6371000.0
    ds = 3.08567e+16
    if AU:
        ds = 149597900000.0
    return A * Phi * Fstar * (Rp * Re / d / ds) ** 2.0
