Module profiles

Detailed information about the Gaussian estimates procedure used in function gauest(), can be found in the kmpfit tutorial.

Function

kapteyn.profiles.gauest(x, y, rms, cutamp, cutsig, q[, ncomp=200, smode=0, flat=False])

Function to search for gaussian components in a profile.

Parameters:
  • x – a one-dimensional NumPy array (or slice) containing the profile’s x-coordinates.

  • y – a one-dimensional NumPy array (or slice) containing the profile’s values.

  • rms – the r.m.s. noise level of the profile.

  • cutamp – critical amplitude of gaussian. Gaussians below this amplitude will be discarded.

  • cutsig – critical dispersion of gaussian.

  • q – smoothing parameter used in calculating the second derivative of the profile. It must be greater than zero.

  • ncomp – maximum number of gaussian components to be found. It should be \(\geq 1\).

  • smode – order in which gaussian components are delivered. 0: decreasing amplitude, 1: decreasing dispersion, 2: decreasing flux.

  • flat – True if a ‘flat’ result shoud be returned. See below.

Returns:

a list with up to ncomp tuples of which each tuple contains the amplitude, the centre and the dispersion of the gaussian, in that order. If the argument flat is True, a ‘flat’ list with ncomp * 3 numbers is returned which may directly be used as initial estimates for kmpfit.Fitter.

In this function the second derivative of the profile in the signal region is calculated by fitting a second degree polynomal. The smoothing parameter q determines the number of points used for this (\(2q+1\)). The gaussians are then estimated as described by Schwarz (1968)

See also

Tutorial chapter “Automatic initial estimates for profiles with multi component Gaussians.”