1Gaussian(3)           User Contributed Perl Documentation          Gaussian(3)
2
3
4

NAME

6       PDL::Fit::Gaussian - routines for fitting gaussians
7

DESCRIPTION

9       This module contains some custom gaussian fitting routines.  These were
10       developed in collaboration with Alison Offer, they do a reasonably
11       robust job and are quite useful.
12
13       Gaussian fitting is something I do a lot of, so I figured it was worth
14       putting in my special code.
15
16       Note this code is also used in the Karma package.
17
18       Note it is not clear to me that this code is fully debugged. The reason
19       I say that is because I tried using the internal linear eqn solving C
20       routines called elsewhere and they were giving erroneous results.  So
21       steal from this code with caution! However it does give good fits to
22       reasonable looking gaussians and tests show correct parameters.
23
24                    KGB 29/Oct/2002
25

SYNOPSIS

27               use PDL::Fit::Gaussian;
28               ($cen, $pk, $fwhm, $back, $err, $fit) = fitgauss1d($x, $data);
29               ($pk, $fwhm, $back, $err, $fit) = fitgauss1dr($r, $data);
30

FUNCTIONS

32       fitgauss1d
33
34       Fit 1D Gassian to data piddle
35
36       ($cen, $pk, $fwhm2, $back, $err, $fit) = fitgauss1d($x, $data);
37
38       ($cen, $pk, $fwhm2, $back, $err, $fit) = fitgauss1d($x, $data);
39
40       xval(n); data(n); [o]xcentre();[o]peak_ht(); [o]fwhm(); [o]back‐
41       ground();int [o]err(); [o]datafit(n); [t]sig(n);  [t]xtmp(n);
42       [t]ytmp(n); [t]yytmp(n); [t]rtmp(n);
43
44       Fit's a 1D Gaussian robustly free parameters are the centre, peak
45       height, FWHM. The background is NOT fit, because I find this is gener‐
46       ally unreliable, rather a median is determined in the 'outer' 10% of
47       pixels (i.e. those at the start/end of the data piddle). The initial
48       estimate of the FWHM is the length of the piddle/3, so it might fail if
49       the piddle is too long. (This is non-robust anyway). Most data does
50       just fine and this is a good default gaussian fitter.
51
52       SEE ALSO: fitgauss1dr() for fitting radial gaussians
53
54       fitgauss1dr
55
56       Fit 1D Gassian to radial data piddle
57
58       ($pk, $fwhm2, $back, $err, $fit) = fitgauss1dr($r, $data);
59
60       ($pk, $fwhm2, $back, $err, $fit) = fitgauss1dr($r, $data);
61
62       xval(n); data(n); [o]peak_ht(); [o]fwhm(); [o]background();int
63       [o]err(); [o]datafit(n); [t]sig(n);  [t]xtmp(n); [t]ytmp(n);
64       [t]yytmp(n); [t]rtmp(n);
65
66       Fit's a 1D radial Gaussian robustly free parameters are the peak
67       height, FWHM. Centre is assumed to be X=0 (i.e. start of piddle).  The
68       background is NOT fit, because I find this is generally unreliable,
69       rather a median is determined in the 'outer' 10% of pixels (i.e. those
70       at the end of the data piddle). The initial estimate of the FWHM is the
71       length of the piddle/3, so it might fail if the piddle is too long.
72       (This is non-robust anyway). Most data does just fine and this is a
73       good default gaussian fitter.
74
75       SEE ALSO: fitgauss1d() to fit centre as well.
76

BUGS

78       May not converge for weird data, still pretty good!
79

AUTHOR

81       This file copyright (C) 1999, Karl Glazebrook (kgb@aaoepp.aao.gov.au),
82       Gaussian fitting code by Alison Offer (aro@aaocbn.aao.gov.au).  All
83       rights reserved. There is no warranty. You are allowed to redistribute
84       this software / documentation under certain conditions. For details,
85       see the file COPYING in the PDL distribution. If this file is separated
86       from the PDL distribution, the copyright notice should be included in
87       the file.
88
89
90
91perl v5.8.8                       2006-12-02                       Gaussian(3)
Impressum