How to use the astromodels.functions.functions.StepFunctionUpper 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
is_2d = False

    else:

        raise RuntimeError("These intervals are not yet supported")

    # Copy the parameter values
    parameter_min = parameter.min_value
    parameter_max = parameter.max_value
    initial_value = parameter.value

    if is_2d:

        # For 2D intervals, we grab a step function

        func = StepFunctionUpper()

        # Sum up the functions

        for i in range(n_intervals - 1):

            func += StepFunctionUpper()

        # Go through and iterate over intervals to set the parameter 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
github threeML / threeML / threeML / utils / step_parameter_generator.py View on Github external
# Copy the parameter values
    parameter_min = parameter.min_value
    parameter_max = parameter.max_value
    initial_value = parameter.value

    if is_2d:

        # For 2D intervals, we grab a step function

        func = StepFunctionUpper()

        # Sum up the functions

        for i in range(n_intervals - 1):

            func += StepFunctionUpper()

        # Go through and iterate over intervals to set the parameter 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["upper_bound_%d" % i].value = interval[1]

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

    else: