ISAP Line fitting module


This module has three basic functions: it allows you to fit models to your flux continuum and spectral line data and reports the salient results; it allows you to replot your data on a velocity axis with respect to a given rest wavelength; and it will assist you in identifying spectral lines.

If your source velocity (V_helio) is significantly different from 0 km/s, we recommend entering the source velocity as your first action upon entering this module. (The three functions above will provide more useful information if the source velocity is entered.)

Three warnings: 1) We recommend averaging your data prior to entering this module: unaveraged data may have spurious points that can throw-off the convergence of fits. 2) If you have SWS data, or any other data in the units of Jy, use the Special Functions button "Change Units" and convert your fluxes to W/cm^2/um. (Future versions of Line Fit will accept Jy. 3) If you have LWS FP data, we recommend that you first use the "arithm" routine to divide your spectrum by the resolution element of the LWS (in microns), which may be found in the LWS User's Manual. This will put your data into flux density units (W/cm^2/um) although it will not change the label, which are units that are natural to the module. (The module also accepts flux density in Jys as from SWS.)

Note: there is a message sub-window at the bottom of this window, and when fits do not converge, etc., there will be a message there saying why.

In fitting lines,  you may choose one of the two fitting method: Gaussian (also multiple components) or Lorentzian. you may follow one of three paths: The first path is the "composite fit," where you fit the Gaussian line and polynomial baseline simultaneously. The second possible path is "two-step baseline and Gaussian or Lorentzian fit," where you first identify baselines regions for the fit and remove (subtract) a polynomial baseline from the data, and then you identify  line(s) region and fit a desired profile to this. The third path, "two-step baseline and moment fit" is much like the second, but here, after removing the baseline, you determine the "moments" of the data. The details of these operations are discussed below.

Setting Source Velocity:


This sub-window allows you to set a v_helio velocity, or specify a source redshift, z (z = V_helio / c).

The redshift law used in this module is always the non-relativistic optical definition of redshift:

lambda_shifted = lambda_rest x (1 + V_helio/c),

and likewise:

lambda_shifted = lambda_rest x (1 + z)

The source velocity is used in many places in this module. When a fit is performed, any cataloged lines found within 1 HPBW of the fitted line center in the source's velocity frame are reported. The nearest is referred to as the "identified line." The velocity associated with the line's fitted center (with respect to the rest wavelength of the identified line) is also reported. When the user plots the data against heliocentric velocity (the "Plot in V-space" option) the velocities shown on the x-axis are velocities with respect to the rest wavelength of the identified line. The identified line wavelength is indicated on the wavelength plots with a pointer and a label. The wavelength pointed to is the redshifted wavelength using the entered source velocity.

When velocities are reported, they are always computed using the law:

V = c x (lambda - lambda_rest) / lambda_rest

no matter how large the velocity. Note that the ISO satellite always reports wavelengths in the V_helio frame.

Three Methods of Fitting the Continuum and Line:

1) The Composite Fit: Here a polynomial baseline and a Gaussian line are fitted simultaneously to the data. The advantage of the composite fit is that no assumptions are made as to where the line ends and the baseline begins. For this reason more data points are used for each component than would available were the dataset separated, and so the results are more accurate.
The steps in this mode are :
How the method works: An initial baseline guess (zeroeth or first order only) is made from the endpoints of the data set, and this function is subtracted from the data to guess the Gaussian line parameters. The Gaussian height and center are guessed from the extreme data point (negative or positive flux) and the lambda variance with respect to this guessed center provides a guess for the width. A modified interactive IDL curvefit routine, equipped with the parameter partial derivatives is set to work on the original data to perform a gradient search on the chi-square of the fit. Convergence is determined by a non-changing chi-square and uncertainties are determined from the product of the central diagonal of the covariance matrix of the parameters and the reduced chi-square. The data are not weighted by their own standard deviations as these are often unreliable.
2) Two-Step Baseline and Line Fit: Here the user specifies baseline regions, fits and removes the baseline, then specifies a  line region , and fits  a Gaussian or Lorentzian to this, or select multi Gaussian fit menu to identify and fit multiple regions The advantages to this method are that the user may avoid poor segments of the baseline in the fit, and may judge the results of baseline fitting before removing it and proceeding. If the user wants to fit a single or multiple lines  in this two step method, the user must remove the baseline fit from the data. The user also records the baseline fit, and it is remembered by the module so that the user may overplot the data, baseline fit and line fit when finished. The user may also look back at the line fit reports or write them to disk.

The first step of this method is baseline removal. Note, if this step is skipped, then when the user subsequently fits a line (Gaussian , Lorentzian, or Moment), the routine will consider any underlying continuum as part of the line shape. The steps are:

The second set of the method is line fitting: When fit is done, the baseline fit (green) and line fit (blue) are overplotted on the spectrum and the line residual is shown in red. A plot with the residual absent may be acquired by pressing the Replot Line and Fit button. The plot is also labeled with the nearest line in the source velocity frame found in line database, but if one is found within 1 HPBW of the fitted line center. The data range used for the line fit used marked with two vertical cyan bars. The results of the line fit are displayed in a pop-up window. The user can then Record these parameters into Line Fit Results or Cancel and try to fix some parameters or select a new range.

Note that when the multiple gaussian option is chosen, an additional possibility is offered: a set of lines (2 up to 8) can be fitted keeping the distance between line centers fixed. This mode can be activated pressing the 'yes' button at the option 'Bounded Gaussians'. In this case, the linecenters for the selected number of gaussians will be held to a fixed distance from the linecenter of the first gaussian and the whole pattern can float as a whole during the fitting procedure. IMPORTANT: when this option is active, the numbers given in input in the 'linecenter' text field of the mutigaussian widget, which normally are the absolute linecenter values, will instead hold the distance of the linecenters with respect to the first gaussian (in microns). If this option is selected, the errors on the linecenters of the multiple gaussians will be equal to the error on the linecenter determination of the first gaussian.

Main Functions :

Input Options :

Spectrum Region(s) of Interest:

All selections are done by pressing the right mouse button.

Plot Buttons

Line Fit Output:

Line Fit Additional Buttons:

WARNINGS : Crazy fits

Fit Parameters :

Line Database Access:

Line database :

The database currently records a list of about 800 lines. Each line is defined by a wavelength (in microns), an element or molecule formula, a transition name (when available) and a precision (not currently used). It has been created merging three lists available from MPE web server ( Warnings :
The database is not complete, it contains only the most frequently observed molecules or elements. Moreover, possible lines from sources with very high redshift may not be recorded as we limit the list to the ISO range. People who are looking for specific elements (or who observe sources with high redshift) are kindly requested to use their own line list. Some are available at ISO centers e.g. (

Line Fit Output:

Line Fit specific plots buttons:

GUI Buttons
ISAP Home Page 
Last update:  03-December-1999