./
pp_gauss_from_fwhm.pro
Author information
- Author
Paulo Penteado (pp.penteado@gmail.com), Nov/2010
Routines
top source pp_gauss_from_fwhm
result = pp_gauss_from_fwhm(x [, fwhm=fwhm] [, sigma=sigma])
Evaluates a normalized Gaussian distribution of mean zero and the provided
width at the provided locations (x
). The width can be provided from the
standard deviation (sigma
) or the FWHM (fwhm
).
Parameters
- x
The locations where the Gaussian is to be evaluated.
Keywords
- fwhm in optional default=1d0
Specifies the width of the Gaussian, as its Full Width Half Maximum (FWHM). If both
sigma
andfwhm
are provided,fwhm
takes precedence.- sigma in optional default=1d0
Specifies the width of the Gaussian, as its Full Width Half Maximum (FWHM). If both
sigma
andfwhm
are provided,fwhm
takes precedence.
Examples
Make a domain where the Gaussian is to be evaluated:
nx=201
x=(dindgen(nx)/(nx-1d0)-0.5d0)*5d0
yg=pp_gauss_from_fwhm(x,fwhm=1d0)
pg=plot(x,yg,color='red',name='Gaussian, FWHM=1d0',thick=2.)
pp_lorentz_from_fwhm
):
yl=pp_lorentz_from_fwhm(x,fwhm=1d0)
pl=plot(x,yl,color='blue',name='Lorentzian, FWHM=1d0',thick=2.,/over)
l=legend(target=[pg,pl],position=[0.5,0.5]) ;Identify the two lines
pg.save,'pp_gauss_from_fwhm.png',resolution=100
Statistics
Lines: | 10 lines |
Cyclomatic complexity: | 2 |
Modified cyclomatic complexity: | 2 |
File attributes
Modification date: | Wed Jun 29 22:15:28 2016 |
Lines: | 10 |
Docformat: | rst rst |