(bl, theta)
return beam
Computes a circular beam profile b(theta) in real space from
    its transfer (or window) function b(l) in spherical harmonic space.

    Parameters
    ----------
    bl : array
        Window function b(l) of the beam.
    theta : array
        Radius at which the beam profile will be computed.
        Has to be given in radians.

    Returns
    -------
    beam : array
        (Circular) beam profile b(theta).
Computes a circular beam profile b(theta) in real space from
    its transfer (or window) function b(l) in spherical harmonic space.
Computes a circular beam profile b ( theta ) in real space from its transfer ( or window ) function b ( l ) in spherical harmonic space .
def bl2beam(bl, theta):
    """Computes a circular beam profile b(theta) in real space from
    its transfer (or window) function b(l) in spherical harmonic space.

    Parameters
    ----------
    bl : array
        Window function b(l) of the beam.
    theta : array
        Radius at which the beam profile will be computed.
        Has to be given in radians.

    Returns
    -------
    beam : array
        (Circular) beam profile b(theta).
    """

    lmax = len(bl) - 1
    nx = len(theta)
    x = np.cos(theta)
    p0 = np.zeros(nx) + 1
    p1 = x

    beam = bl[0] * p0 + bl[1] * p1 * 3

    for l in np.arange(2, lmax + 1):
        p2 = x * p1 * (2 * l - 1) / l - p0 * (l - 1) / l
        p0 = p1
        p1 = p2
        beam += bl[l] * p2 * (2 * l + 1)

    beam /= 4 * np.pi

    return beam
def bl2beam ( bl , theta ) : lmax = len ( bl ) - 1 nx = len ( theta ) x = np . cos ( theta ) p0 = np . zeros ( nx ) + 1 p1 = x beam = bl [ 0 ] * p0 + bl [ 1 ] * p1 * 3 for l in np . arange ( 2 , lmax + 1 ) : p2 = x * p1 * ( 2 * l - 1 ) / l - p0 * ( l - 1 ) / l p0 = p1 p1 = p2 beam += bl [ l ] * p2 * ( 2 * l + 1 ) beam /= 4 * np . pi return beam