    Return the source model expression for a data set.

get_source(id=None)
id - int or str, optional

This returns the model expression created by `set_model` or

`set_source` . It does not include any instrument response.

Return the source expression for the default data set, display it, and then find the number of parameters in it:

>>> src = get_source() >>> print(src) >>> len(src.pars) 5

Set the source expression for data set 'obs2' to be equal to the model of data set 'obs1' multiplied by a scalar value:

>>> set_source('obs2', const1d.norm * get_source('obs1'))

PARAMETERS

The parameter for this function is:

Parameter
Definition
id
The data set containing the source expression. If not given then the default identifier is used, as returned by

`get_default_id` .

The return value from this function is:

model -- This can contain multiple model components. Changing attributes of this model changes the model used by the data set.

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

December 2023