def make_random_models_table(n_sources, param_ranges, random_state=None):
    """
    Make a `~astropy.table.Table` containing randomly generated
    parameters for an Astropy model to simulate a set of sources.

    Each row of the table corresponds to a source whose parameters are
    defined by the column names.  The parameters are drawn from a
    uniform distribution over the specified input ranges.

    The output table can be input into :func:`make_model_sources_image`
    to create an image containing the model sources.

    Parameters
    ----------
    n_sources : float
        The number of random model sources to generate.

    param_ranges : dict
        The lower and upper boundaries for each of the model parameters
        as a `dict` mapping the parameter name to its ``(lower, upper)``
        bounds.

    random_state : int or `~numpy.random.RandomState`, optional
        Pseudo-random number generator state used for random sampling.

    Returns
    -------
    table : `~astropy.table.Table`
        A table of parameters for the randomly generated sources.  Each
        row of the table corresponds to a source whose model parameters
        are defined by the column names.  The column names will be the
        keys of the dictionary ``param_ranges``.

    See Also
    --------
    make_random_gaussians_table, make_model_sources_image

    Notes
    -----
    To generate identical parameter values from separate function calls,
    ``param_ranges`` must be input as an `~collections.OrderedDict` with
    the same parameter ranges and ``random_state`` must be the same.

    Examples
    --------
    >>> from collections import OrderedDict
    >>> from photutils.datasets import make_random_models_table
    >>> n_sources = 5
    >>> param_ranges = [('amplitude', [500, 1000]),
    ...                 ('x_mean', [0, 500]),
    ...                 ('y_mean', [0, 300]),
    ...                 ('x_stddev', [1, 5]),
    ...                 ('y_stddev', [1, 5]),
    ...                 ('theta', [0, np.pi])]
    >>> param_ranges = OrderedDict(param_ranges)
    >>> sources = make_random_models_table(n_sources, param_ranges,
    ...                                    random_state=12345)
    >>> for col in sources.colnames:
    ...     sources[col].info.format = '%.8g'  # for consistent table output
    >>> print(sources)
    amplitude   x_mean    y_mean   x_stddev  y_stddev   theta
    --------- --------- --------- --------- --------- ----------
    964.80805 297.77235 224.31444 3.6256447 3.5699013  2.2923859
    658.18778 482.25726 288.39202 4.2392502 3.8698145  3.1227889
    591.95941 326.58855 2.5164894 4.4887037  2.870396  2.1264615
    602.28014 374.45332 31.933313 4.8585904 2.3023387  2.4844422
    783.86251 326.78494 89.611114 3.8947414 2.7585784 0.53694298
    """

    prng = check_random_state(random_state)

    sources = Table()
    for param_name, (lower, upper) in param_ranges.items():
        # Generate a column for every item in param_ranges, even if it
        # is not in the model (e.g. flux).  However, such columns will
        # be ignored when rendering the image.
        sources[param_name] = prng.uniform(lower, upper, n_sources)

    return sources
Make a `~astropy.table.Table` containing randomly generated
    parameters for an Astropy model to simulate a set of sources.

    Each row of the table corresponds to a source whose parameters are
    defined by the column names.  The parameters are drawn from a
    uniform distribution over the specified input ranges.

    The output table can be input into :func:`make_model_sources_image`
    to create an image containing the model sources.

    Parameters
    ----------
    n_sources : float
        The number of random model sources to generate.

    param_ranges : dict
        The lower and upper boundaries for each of the model parameters
        as a `dict` mapping the parameter name to its ``(lower, upper)``
        bounds.

    random_state : int or `~numpy.random.RandomState`, optional
        Pseudo-random number generator state used for random sampling.

    Returns
    -------
    table : `~astropy.table.Table`
        A table of parameters for the randomly generated sources.  Each
        row of the table corresponds to a source whose model parameters
        are defined by the column names.  The column names will be the
        keys of the dictionary ``param_ranges``.

    See Also
    --------
    make_random_gaussians_table, make_model_sources_image

    Notes
    -----
    To generate identical parameter values from separate function calls,
    ``param_ranges`` must be input as an `~collections.OrderedDict` with
    the same parameter ranges and ``random_state`` must be the same.

    Examples
    --------
    >>> from collections import OrderedDict
    >>> from photutils.datasets import make_random_models_table
    >>> n_sources = 5
    >>> param_ranges = [('amplitude', [500, 1000]),
    ...                 ('x_mean', [0, 500]),
    ...                 ('y_mean', [0, 300]),
    ...                 ('x_stddev', [1, 5]),
    ...                 ('y_stddev', [1, 5]),
    ...                 ('theta', [0, np.pi])]
    >>> param_ranges = OrderedDict(param_ranges)
    >>> sources = make_random_models_table(n_sources, param_ranges,
    ...                                    random_state=12345)
    >>> for col in sources.colnames:
    ...     sources[col].info.format = '%.8g'  # for consistent table output
    >>> print(sources)
    amplitude   x_mean    y_mean   x_stddev  y_stddev   theta
    --------- --------- --------- --------- --------- ----------
    964.80805 297.77235 224.31444 3.6256447 3.5699013  2.2923859
    658.18778 482.25726 288.39202 4.2392502 3.8698145  3.1227889
    591.95941 326.58855 2.5164894 4.4887037  2.870396  2.1264615
    602.28014 374.45332 31.933313 4.8585904 2.3023387  2.4844422
    783.86251 326.78494 89.611114 3.8947414 2.7585784 0.53694298