StraightLineModel#

class sunkit_spex.models.models.StraightLineModel(
slope=Parameter('slope', value=1.0),
intercept=Parameter('intercept', value=0.0),
edges=True,
**kwargs,
)[source]#

Bases: FittableModel

Attributes Summary

input_units

This property is used to indicate what units or sets of units the evaluate method expects, and returns a dictionary mapping inputs to units (or None if any units are accepted).

input_units_equivalencies

intercept

n_inputs

n_outputs

param_names

Names of the parameters that describe models of this type.

return_units

This property is used to indicate what units or sets of units the output of evaluate should be in, and returns a dictionary mapping outputs to units (or None if any units are accepted).

slope

Methods Summary

__call__(*inputs[, model_set_axis, ...])

Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.

evaluate(x, slope, intercept)

Evaluate the model on some input variables.

Attributes Documentation

input_units#
input_units_equivalencies = {'keV': [(Unit("m"), Unit("Hz"), <function spectral.<locals>.<lambda>>), (Unit("m"), Unit("J"), <function spectral.<locals>.<lambda>>), (Unit("Hz"), Unit("J"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>), (Unit("m"), Unit("1 / m"), <function spectral.<locals>.<lambda>>), (Unit("Hz"), Unit("1 / m"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>), (Unit("J"), Unit("1 / m"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>), (Unit("1 / m"), Unit("rad / m"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>), (Unit("m"), Unit("rad / m"), <function spectral.<locals>.<lambda>>), (Unit("Hz"), Unit("rad / m"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>), (Unit("J"), Unit("rad / m"), <function spectral.<locals>.<lambda>>, <function spectral.<locals>.<lambda>>)]}#
intercept = Parameter('intercept', value=0.0)#
n_inputs = 1#
n_outputs = 1#
param_names = ('slope', 'intercept')#

Names of the parameters that describe models of this type.

The parameters in this tuple are in the same order they should be passed in when initializing a model of a specific type. Some types of models, such as polynomial models, have a different number of parameters depending on some other property of the model, such as the degree.

When defining a custom model class the value of this attribute is automatically set by the Parameter attributes defined in the class body.

return_units#
slope = Parameter('slope', value=1.0)#

Methods Documentation

__call__(
*inputs,
model_set_axis=None,
with_bounding_box=False,
fill_value=nan,
equivalencies=None,
inputs_map=None,
**new_inputs,
)#

Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.

evaluate(x, slope, intercept)[source]#

Evaluate the model on some input variables.