load_psf

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.

Parameters:
  • 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_psf()
Delete the PSF model for a data set.
load_conv()
Load a 1D convolution model.
load_table_model()
Load tabular data and use it as a model component.
set_full_model()
Define the convolved model expression for a data set.
set_model()
Set the source model expression for a data set.
set_psf()
Add a PSF model to a data set.

Examples

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