def cartesian_to_spherical_azimuthal(x, y):
    """ Calculates the azimuthal angle in spherical coordinates from Cartesian
    coordinates. The azimuthal angle is in [0,2*pi].

    Parameters
    ----------
    x : {numpy.array, float}
        X-coordinate.
    y : {numpy.array, float}
        Y-coordinate.

    Returns
    -------
    phi : {numpy.array, float}
        The azimuthal angle.
    """
    y = float(y) if isinstance(y, int) else y
    phi = numpy.arctan2(y, x)
    return phi % (2 * numpy.pi)
Calculates the azimuthal angle in spherical coordinates from Cartesian
    coordinates. The azimuthal angle is in [0,2*pi].

    Parameters
    ----------
    x : {numpy.array, float}
        X-coordinate.
    y : {numpy.array, float}
        Y-coordinate.

    Returns
    -------
    phi : {numpy.array, float}
        The azimuthal angle.