    Load a 1D convolution model.

load_conv(modelname, filename_or_model, *args, **kwargs)
modelname - str
filename_or_model - str or model instance

The convolution model can be defined either by a data set, read from a file, or an analytic model, using a Sherpa model instance. A source model can be convolved with this model by including modelname in the `set_model` call, using the form:

modelname(modelexpr)

Create a 1D data set, assign a box model - which is flat between the xlow and xhi values and zero elsewhere - and then display the model values. Then add in a convolution component by a gaussian and overplot the resulting source model with two different widths.

>>> dataspace1d(-10, 10, 0.5, id='tst', dstype=Data1D) >>> set_source('tst', box1d.bmdl) >>> bmdl.xlow = -2 >>> bmdl.xhi = 3 >>> plot_source('tst') >>> load_conv('conv', normgauss1d.gconv) >>> gconv.fwhm = 2 >>> set_source('tst', conv(bmdl)) >>> plot_source('tst', overplot=True) >>> gconv.fwhm = 5 >>> plot_source('tst', overplot=True)

Create a convolution component called "cmodel" which uses the data in the file "conv.dat", which should have two columns (the X and Y values).

>>> load_conv('cmodel', 'conv.dat')

PARAMETERS

The parameters for this function are:

Parameter
Definition
modelname
The identifier for this PSF model.
filename_or_model
This can be the name of an ASCII file or a Sherpa model component.
args
Arguments for `unpack_data` if `filename_or_model` is a file.
kwargs
Keyword arguments for `unpack_data` if `filename_or_model` is a file.

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

December 2023