sherpa.astro.ui.load_conv(modelname, filename_or_model, *args, **kwargs)

Load a 1D convolution model.

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 (str) – The identifier for this PSF model.

  • filename_or_model (str or model instance) – 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 also


Delete the PSF model for a data set.


Create a PSF model.


Load tabular data and use it as a model component.


Define the convolved model expression for a data set.


Set the source model expression for a data set.


Add a PSF model to a data set.


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')