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

Create a PSF model.

Create a PSF model representing either an array of data, read from a file, or a model component (such as a gaussian). The set_psf function is used to associate this model with a data set.

  • 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.
Load a 1D convolution 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 PSF model using a 2D gaussian:

>>> load_psf('psf1', gauss2d.gpsf)
>>> set_psf('psf1')
>>> gpsf.fwhm = 4.2
>>> gpsf.ellip = 0.2
>>> gpsf.theta = 30 * np.pi / 180
>>> image_psf()

Create a PSF model from the data in the ASCII file ‘line_profile.dat’ and apply it to the data set called ‘bgnd’:

>>> load_psf('pmodel', 'line_profile.dat')
>>> set_psf('bgnd', 'pmodel')