# profitMakeGaussianPSF: Make a 2D Gaussian PSF (point source profile or point spread... In ProFit: Fit Projected 2D Profiles to Galaxy Images

## Description

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

## Usage

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

## Arguments

 `fwhm` 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. `dim` 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. `trim` 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. `plot` Logical; should a `magimage` plot of the output be generated? `...` Further arguments to be passed to `magimage`. Only relevant is plot=TRUE.

## Details

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.

## Value

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

## Author(s)

Aaron Robotham & Dan Taranu

`profitMakePointSource`, `profitConvolvePSF`

## Examples

 ```1 2 3 4 5``` ```#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
Package 'sm', version 2.2-5.4: type help(sm) for summary information

Attaching package: 'sm'

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

muscle

Attaching package: 'pracma'

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

nile

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

Mode, logit, loglog