def make_100gaussians_image(noise=True):
    """
    Make an example image containing 100 2D Gaussians plus a constant
    background.

    The background has a mean of 5.

    If ``noise`` is `True`, then Gaussian noise with a mean of 0 and a
    standard deviation of 2 is added to the output image.

    Parameters
    ----------
    noise : bool, optional
        Whether to include noise in the output image (default is
        `True`).

    Returns
    -------
    image : 2D `~numpy.ndarray`
        Image containing 100 2D Gaussian sources.

    See Also
    --------
    make_4gaussians_image

    Examples
    --------
    .. plot::
        :include-source:

        from photutils import datasets
        image = datasets.make_100gaussians_image()
        plt.imshow(image, origin='lower', interpolation='nearest')
    """

    n_sources = 100
    flux_range = [500, 1000]
    xmean_range = [0, 500]
    ymean_range = [0, 300]
    xstddev_range = [1, 5]
    ystddev_range = [1, 5]
    params = OrderedDict([('flux', flux_range),
                          ('x_mean', xmean_range),
                          ('y_mean', ymean_range),
                          ('x_stddev', xstddev_range),
                          ('y_stddev', ystddev_range),
                          ('theta', [0, 2*np.pi])])

    sources = make_random_gaussians_table(n_sources, params,
                                          random_state=12345)

    shape = (300, 500)
    data = make_gaussian_sources_image(shape, sources) + 5.

    if noise:
        data += make_noise_image(shape, type='gaussian', mean=0.,
                                 stddev=2., random_state=12345)

    return data
def make_100gaussians_image ( noise = True ) : n_sources = 100 flux_range = [ 500 , 1000 ] xmean_range = [ 0 , 500 ] ymean_range = [ 0 , 300 ] xstddev_range = [ 1 , 5 ] ystddev_range = [ 1 , 5 ] params = OrderedDict ( [ ( 'flux' , flux_range ) , ( 'x_mean' , xmean_range ) , ( 'y_mean' , ymean_range ) , ( 'x_stddev' , xstddev_range ) , ( 'y_stddev' , ystddev_range ) , ( 'theta' , [ 0 , 2 * np . pi ] ) ] ) sources = make_random_gaussians_table ( n_sources , params , random_state = 12345 ) shape = ( 300 , 500 ) data = make_gaussian_sources_image ( shape , sources ) + 5. if noise : data += make_noise_image ( shape , type = 'gaussian' , mean = 0. , stddev = 2. , random_state = 12345 ) return data
Make an example image containing 100 2D Gaussians plus a constant
    background.

    The background has a mean of 5.

    If ``noise`` is `True`, then Gaussian noise with a mean of 0 and a
    standard deviation of 2 is added to the output image.

    Parameters
    ----------
    noise : bool, optional
        Whether to include noise in the output image (default is
        `True`).

    Returns
    -------
    image : 2D `~numpy.ndarray`
        Image containing 100 2D Gaussian sources.

    See Also
    --------
    make_4gaussians_image

    Examples
    --------
    .. plot::
        :include-source:

        from photutils import datasets
        image = datasets.make_100gaussians_image()
        plt.imshow(image, origin='lower', interpolation='nearest')