How to use the astromodels.functions.functions.DiracDelta function in astromodels

To help you get started, we’ve selected a few astromodels examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github threeML / threeML / threeML / utils / step_parameter_generator.py View on Github external
i = i + 1

            func.free_parameters["value_%d" % i].value = initial_value
            func.free_parameters["value_%d" % i].min_value = parameter_min
            func.free_parameters["value_%d" % i].max_value = parameter_max

            func.parameters["upper_bound_%d" % i].value = interval[1]

            func.parameters["lower_bound_%d" % i].value = interval[0]

    else:

        # For 1-D intervals, just create a sum of delta functions

        func = DiracDelta()

        for i in range(n_intervals - 1):

            func += DiracDelta()

        # Set up the values

        for i, interval in enumerate(intervals):

            i = i + 1

            func.free_parameters["value_%d" % i].value = initial_value
            func.free_parameters["value_%d" % i].min_value = parameter_min
            func.free_parameters["value_%d" % i].max_value = parameter_max

            func.parameters["zero_point_%d" % i].value = interval
github threeML / threeML / threeML / utils / step_parameter_generator.py View on Github external
func.free_parameters["value_%d" % i].min_value = parameter_min
            func.free_parameters["value_%d" % i].max_value = parameter_max

            func.parameters["upper_bound_%d" % i].value = interval[1]

            func.parameters["lower_bound_%d" % i].value = interval[0]

    else:

        # For 1-D intervals, just create a sum of delta functions

        func = DiracDelta()

        for i in range(n_intervals - 1):

            func += DiracDelta()

        # Set up the values

        for i, interval in enumerate(intervals):

            i = i + 1

            func.free_parameters["value_%d" % i].value = initial_value
            func.free_parameters["value_%d" % i].min_value = parameter_min
            func.free_parameters["value_%d" % i].max_value = parameter_max

            func.parameters["zero_point_%d" % i].value = interval

    return func