profitMakeGaussianPSF: Make a 2D Gaussian PSF (point source profile or point spread...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/profitMakeGaussianPSF.R


Creates an analytic 2D Gaussian PSF with a given full-width at half-maximum.


profitMakeGaussianPSF(fwhm = 3, dim = c(25,25), trim = 1 - pi/4, plot = FALSE, ...)



Numeric scalar; the full width half max (FWHM) of the desired PSF. This is internally converted to a Gaussian standard deviation (sigma) using sigma=FWHM/(2*sqrt(2*log(2)))~FWHM/2.355.


Integer vector; the dimensions of the image to be generated. Typically this should be c(Nx,Ny). If length 1 then the value will be replicated for both dimensions.


Numeric scalar; fraction of pixels to keep. This is done by using quantile to find the pixel value and setting pixels below this to zero. This is done to obtain a more circular kernel (often handy), where the defaults will approximately fill a square image with a circle of diameter dim.


Logical; should a magimage plot of the output be generated?


Further arguments to be passed to magimage. Only relevant is plot=TRUE.


This is a simple function to create a Gaussian PSF for prototyping image convolution/fits in cases where PSF has not been estimated. In general this should *not* be used for final fitting, since it is rare to have an exact, circular Gaussian profile PSFs in real astronomical images. Better options would be a double winged Gaussian, a Moffat (which is similar to a 2D Student-T distribution with no correlation), or an empirical PSF.


Numeric matrix; the 2D image of the specified PSF with dimensions c(npix,npix).


Aaron Robotham & Dan Taranu

See Also

profitMakePointSource, profitConvolvePSF


#Various FWHM:

magimage(profitMakeGaussianPSF(fwhm=1), stretch='lin')
magimage(profitMakeGaussianPSF(fwhm=3), stretch='lin')
magimage(profitMakeGaussianPSF(fwhm=5), stretch='lin')

Example output

Loading required package: FITSio
Loading required package: LaplacesDemon
Loading required package: magicaxis
Loading required package: MASS
Loading required package: plotrix
Loading required package: sm
Package 'sm', version 2.2-5.4: type help(sm) for summary information

Attaching package: 'sm'

The following object is masked from 'package:MASS':


Loading required package: mapproj
Loading required package: maps
Loading required package: celestial
Loading required package: RANN
Loading required package: NISTunits
Loading required package: pracma

Attaching package: 'pracma'

The following object is masked from 'package:sm':


The following objects are masked from 'package:LaplacesDemon':

    Mode, logit, loglog

Loading required package: R2Cuba
Loading required package: RColorBrewer

ProFit documentation built on Nov. 11, 2019, 5:07 p.m.