API reference#

Core module summary#

Fitter()

Main class for performing fits and organising data

Source(x, y, yerr, name[, xerr])

Initializes a source of data

Model(name[, prefunc])

Base Model class

Models module summary#

ExponentialDecay(a, tau[, name, prefunc])

Model for an exponential decay

Polynomial(p[, name, prefunc])

Model class for a polynomial response

SkewedVoigt(A, mu, FWHMG, FWHML, skew[, ...])

Model for a skewed Voigt peak by the error function.

PiecewiseConstant(values, bounds[, name, ...])

Model class for a PiecewiseConstant response

Voigt(A, mu, FWHMG, FWHML[, name, prefunc])

Model for a Voigt lineshape

HFS(I, J[, A, B, C, df, fwhmg, fwhml, name, ...])

Initializes a hyperfine spectrum Model with the given hyperfine parameters.

Lineshapes module summary#

gaussian(x, fwhm)

Gaussian peak with height 1.

lorentzian(x, fwhm)

Lorentzian peak with height 1.

voigt(x, fwhmg, fwhml)

Voigt peak (convolution of a Gaussian and a Lorentzian) with height 1.

skew(x, skew, fwhmg)

Skewing factor of a peak centred at 0 with Gaussian FWHM fwhmg:

voigtFWHM(fwhmg, fwhml[, fwhmg_unc, ...])

Total FWHM of a Voigt peak, with its uncertainty.

Interface module summary#

HFSModel(I, J, ABC[, centroid, fwhm, scale, ...])

Initializes a hyperfine spectrum Model with the given hyperfine parameters.

SumModel(models, background_params[, name, ...])

Initializes a hyperfine spectrum for the sum of multiple Models with the given models and a step background.

chisquare_fit(model, x, y, yerr[, xerr, method])

Perform a fit of the provided model to the data provided in this function.

Plotting module summary#

generateCorrelationPlot(filename[, filter, ...])

Given the random walk data, creates a triangle plot: distribution of a single parameter on the diagonal axes, 2D contour plots with 1, 2 and 3 sigma contours on the off-diagonal.

generateWalkPlot(filename[, filter, burnin, ...])

Given the random walk data, the random walk for the selected parameters is plotted.

Utilities module summary#

generateSpectrum(models, x[, generator])

Generates a dataset based on the models and x-values provided.

poissonInterval(counts[, sigma, alpha, is_mean])

Calculates the confidence interval for a Poisson distribution.

weightedAverage(x, sigma[, axis])

Takes the weighted average of an array of values and the associated errors.

Subpages#