Last modified: December 2023

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/load_psf.html
AHELP for CIAO 4.16 Sherpa

load_psf

Context: psfs

Synopsis

Create a PSF model.

Syntax

load_psf(modelname, filename_or_model, *args, **kwargs)

modelname - str
filename_or_model - str or model instance

Description

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.


Examples

Example 1

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

Example 2

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

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.

Bugs

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

See Also

modeling
load_table_model
psfs
contour_kernel, contour_psf, delete_psf, get_psf, get_psf_contour, get_psf_image, get_psf_plot, image_kernel, image_psf, load_conv, plot_kernel, plot_psf, set_psf, show_kernel, show_psf