3.16 The spectral line fitting window

The spectral line fitting window allows you to measure the wavelength and equivalent width of emission or absorption lines and to fit various standard profiles to the lines.

The standard profiles offered are Gaussian, Lorentzian and Voigt, as well as a model independent intensity analysis measure.


Background type: Choose a type of background estimate to be subtracted from the spectrum before fitting. The choices are Constant and Polynomial. If you have already subtracted the background from the spectrum, or have applied a normalisation (so that the background is flat, usually with a value of 1) then you need to choose Constant and provide a suitable value. Otherwise choose Polynomial and select a spectrum from the list in Background fit.

Background fit: For emission lines you would normally define a background spectrum using the polynomial fitting tool. In this case select the Polynomial option and choose the background spectrum you have created. Note that you can actually use any spectrum from the global list as the background (so you are not restricted to what SPLAT-VO, provides) but if you choose the same spectrum as is being measured then a background of 0 is assumed.

The default background should be set to the first polynomial found on the global list.

Use error as weights: If your spectrum has associated error measurements then you can select this checkbox to use the errors as weights in the fitting procedure.

Coordinate ranges: This table shows the upper and lower coordinate range for each line that you want to measure.

To add a line to this list press the Add button. Now drag out a region on the plot display area that encompasses the spectral line. You should now see a yellow rectangle over the line:


Note that the rectangle is just defining a range, not an area, so you just need to worry about its width and position along the X axis, not its height.

To adjust the rectangle position select it and either drag it around, or use the grips on the exterior to resize it. You can see the physical extent of the region in the Coordinate ranges: table. To set these to a known value double click on the value you’d like to set, make the change, and then press <Return> to apply it.

The extents of lines can be saved to a simple text file and re-read. The format is simple. It should have two fields separated by whitespace or commas. Comments are indicated by lines starting with a hash (#) and are ignored.

Types of fit:

Once you have defined the extents of your spectral lines and chosen a background, you can proceed to make the measurements you want. Just select the types of fit you want from the list Gaussian, Lorentzian and Voigt. Note you can de-select all these and just get a Quick measurement.

All types except Quick use a non-linear least squares (Levenberg-Marquardt) minimisation stage to perform the actual fit of the model to the data (possibly with weighting, if the spectrum has any error measurements). So it is necessary to have some idea of the shape of the line, before attempting to fit it. This job is done by the Quick fit, which is compulsory. The description of each of the types and what their measurements represent is given below.

The error estimates are based on the variances produced by the fit. If you have errors for the data values, these will be used as weights and providing they are realistic the errors will be correct. In the absence of data errors the errors produced will be decided assuming that the fit is good (the chi-square statistic will be artificially forced to have a value of 1).

Quick: The default line measurement type. This is based on the ABLINE technique described in the FIGARO documentation. This just uses an analysis of the intensities in the selected region and the chosen background. The results you get are:

Gaussian: The formula used for the Gaussian is:

y(r) = Aexp 0.5 xc σ 2

where A is the scale height, r is the distance from the centre, c is the centre, x the distance from the origin and σ is the Gaussian sigma. The y values are background subtracted.

The values measured for this line shape are:

Lorentzian: The formula used for the Lorentzian is:

y(r) = A 1 + 0.5 (xc w )2

where A is the scale height, r is the distance from the centre, c is the centre, x the distance from the origin and w the Lorentzian width. The y values are background subtracted. The full width half maximum (fwhm) of the curve is:

fwhm = w 22

The values measured for this line shape are:

Voigt: The formula for a Voigt profile (a convolution of a Gaussian and Lorentzian) is:

K(a, b) = b π exp(t2) (at)2 + b2 dt


a = ln 2 xc σ


b = ln 2 w σ

In these equations c is the central wavelength, x the distance from the origin, σ is the Gaussian width and w the Lorentzian width. Which is complex to solve. However, if we take a complex variable z = a + ib, then the Voigt function is, within a scale factor (A), also the real part of the complex error function:

w(z) = exp(z2)erfc(iz)

which has been approximated by various numerical codes. Using this fact with a non-linear minimisation routine (plus some derivatives) is how SPLAT performs its Voigt fitting.

The values measured for this line shape are:

3.16.1 Saving the results

The measurements, as shown in the Spectral fitting results: table can be written out to a text file. Just select the File->Save line fits item and either pick an existing file to overwrite, or enter a new file name. The format of this file is very simple, as shown by the following example (long lines are wrapped for presentation):

  # File created by Starlink SPLAT-VO
  # Quick results:
  # ID Peak Centre Width Equiv Flux Asym
  0 0.5280543 4101.737 9.664325 0 8.636 1.046
  # Gaussian results:
  # ID Peak PeakErr Centre CentreErr Width WidthErr FWHM FWHMErr
  # Flux FluxErr Rms
  0 0.47457 0.013518 4101.637 0.20611 6.266466 0.2061116 14.7564 0.4853556
  7.454487 0.3243526 0.03108123
  # Lorentzian results:
  # ID Peak PeakErr Centre CentreErr Width WidthErr FWHM FWHMErr
  # Flux FluxErr Rms
  0 0.5306862 0.00502416 4101.669 0.05490553 4.108373 0.05540269 11.62023 0.1567025
  9.686626 0.1596041 0.009050248
  # Voigt results:
  # ID Peak PeakErr Centre CentreErr Gwidth GwidthErr Lwidth
  # LwidthErr FWHM FWHMErr Flux FluxErr Rms
  0 0.5308469 0.0120453 4101.668 0.05545499 0.6207013 0.7700358 11.48657 0.3663733
  11.68279 0.4136257 9.687501 0.1166889 0.009053993

So each fit type has a section in which the results for each line are shown. Lines are uniquely identified by their ID value.

Accelerator keys