AHELP for CIAO 4.3 Sherpa v1 | set_psf |
Context: psfs |
Synopsis
Convolve the PSF model with the source model
Syntax
set_psf( [id], psf )
Description
The set_psf command adds a PSF model to the instrument list and uses it to convolve the entire source model expression. To convolve specific model components with the PSF, use the "ahelp set_full_model"
The PSF was loaded by the load_psf command ("ahelp load_psf").
- id - the id of the dataset to use; if not given, uses the default dataset id (id=1 by default, see "ahelp get_default_id")
- psf - the name of the PSF model
What is the difference between the PSF and the kernel?
The point spread function (PSF) is defined by the full (unfiltered) PSF image loaded into Sherpa or the PSF model expression evaluated over the full range of the dataset; both types of PSFs are established with the load_psf() command. The kernel is the subsection of the PSF image or model which is used to convolve the data. This subsection is created from the PSF when the size and center of the kernel are defined by the command set_psf(). While the kernel and PSF might be congruent, defining a smaller kernel helps speed the convolution process by restricting the number of points within the PSF that Sherpa must evaluate.
1-D PSF models
In a 1-D PSF model, a radial profile or 1-D model array is used to convolve (fold) the given source model using the Fast Fourier Transforms (FFTs). The kernel centroid must always be at the center of the extracted sub-image. Otherwise, systematic shifts will occur in best-fit positions of point sources, etc.
Output from an example 1-D PSF model named "psf1":
Param Type Value Min Max Units ----- ---- ----- --- --- ----- psf1.psf frozen rprofile_rmid.fits psf1.size frozen 38 38 38 psf1.center frozen 19 19 19 psf1.radial frozen 0 0 1 psf1.norm frozen 1 0 1
Parameters for a 1-D PSF Model
Name | Description |
---|---|
kernel | the input data file or array used for the PSF kernel |
size | x full-width of the subset of the PSF array to use in convolution |
center | x-direction center of the kernel |
radial | radial profile: 1=yes/0=no |
norm | renormalize the kernel? 1=yes/0=no (kernel mode) |
The PSF data or model array is renormalized to 1 by default, unless the parameter 'norm' is 0; norm=0 produces the functionality of a 1-D kernel model. Renormalization is done by summing over all image pixels, regardless of the size value.
If the radial parameter is set to 1, the kernel array will be extended and its values reflected across the edge boundary. The resultant function will be symmetric. The default value is 0 to reduce some of the edge effects from convolution.
2-D PSF models
In a 2-D PSF model, an image or 2-D model array is used to convolve (fold) the given source model using the Fast Fourier Transforms (FFTs). The kernel centroid must always be at the center of the extracted sub-image. Otherwise, systematic shifts will occur in best-fit positions of point sources, etc.
Output from an example 2-D PSF model named "psf0":
Param Type Value Min Max Units ----- ---- ----- --- --- ----- psf0.psf frozen psf_image.fits psf0.size frozen (256, 256) (256, 256) (256, 256) psf0.center frozen (128, 128) (128, 128) (128, 128) psf0.radial frozen 0 0 1 psf0.norm frozen 1 0 1
Parameters for a 2-D PSF Model
Name | Description |
---|---|
kernel | the input image or array used for the PSF kernel |
size | (x,y) width of the subset of the PSF array to use in convolution |
center | (x,y) center of the kernel |
radial | [not applicable to 2-D PSFs] |
norm | renormalize the kernel? 1=yes/0=no (kernel mode) |
The PSF image array or model array is renormalized to 1 by default, unless the parameter 'norm' is 0; norm=0 produces the functionality of a 2-D kernel model. Renormalization is done by summing over all image pixels, regardless of the size value.
Example 1
sherpa> load_psf("psf1","psf256.fits") sherpa> set_psf(psf1)
A PSF model is created from the file psf256.fits, then is set as the PSF for the default dataset.
Example 2
sherpa> load_psf("psf", "psf_0.25pix.fits") sherpa> set_psf("src", psf )
The PSF model created from psf_0.25pix.fits is set for dataset "src".
Example 3
sherpa> load_psf("psf1", beta2d.p1) sherpa> set_psf(psf1) sherpa> load_psf("psf2", "psf.fits") sherpa> set_psf(2, psf2) sherpa> fit()
A 2-D Beta model is used as the PSF to convolve with the source model for data set 1, and the PSF model defined in file 'psf.fits' is used to convolve the source model for data set 2. The PSF models are convolved with the corresponding source models when set_psf is issued. Data sets 1 and 2 are simultaneously fit with their associated source models convolved by different PSF models.
Bugs
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.