import math


def _gaussian_function(settings):
    """
    Make a weighted 1D Gaussian function object.

    Inputs:
    settings (dict) - Parameters for configuring the Gaussian.  Keys/values are:
    weight (float) - The maximum height of the Gaussian
    mean (float) - The mean (peak) of the Gaussian
    std_dev (float) - The standard deviation (width) of the Gaussian

    Return:
    gaussian (function) - A function that takes a single numeric value and returns
    the value of the Gaussian for that point.
    """
    def gaussian(x):
        """
        Gaussian function.

        Input:
        x (float)

        Return:
        gaussian(x) - the value of the Gaussian
        """
        return settings['weight'] * math.exp(
            -0.5 * (x - settings['mean'])**2 / settings['std_dev']**2)
    return gaussian