top of page

WP7: Line fitting

The aim of this work-package is to analyze the absorption lines (Lyman alpha forest) of a redshifted quasar regarding their position, width, and amplitude. With this analysis conclusions about the space between the redshifted lightsource and the receiver may be drawn. Ideally, absorbing hydrogen nebulas distance on the lights path could be found.

LineFittingIcon.png
Download Matlab files

Basics of line fitting

The set of data is analyzed by fitting functions to the data to approximate it. For line fitting, parameters of a function can be altered to resut in a minimal difference between the data and the found equation. This requires a good approximation of the general mathematical form of the function and a good guess of the initial parameters. It always has to be noted, that when performing line fitting with an unsuiting function or false starting parameters, the resulting fit may not estimate the data set well. The fitting algorythm used is a Matlab internal linear least squares method.

Basics of line fitting

Obtaining data - fits files

What is a fits file, what data does it contain, how do we open it (Jeneesh)

Obtaining data - fits files

Preprocessing - Continuum reduction

Usually the provided spectral data contains the general shape of black body radiation, as mentioned previously. In order to analyze the relative influence of nebulas and other disturbances in the path of the light, the data is needed to be leveled at around a value of 1. In the data provided to our group, this step is already performed. In theory, the data should be divided by the average (the continuum) to level it at 1. Therefore the data is split into smaller sections and a linear function is modelled to obtain an average slope. The data is then divided by the function value at each sample point. The sections are created with a degree of overlap into their neighboring sections in order not to cut valuable data. These sections are kept throughout the further analysis.

Continuum reduction

Preprocessing - Outlier filtering

Outlier filtering and smooting (Amal)

Outlier filtering

Preprocessing - Rough line estimation

In order to obtain a good set of starting values when fitting Gaussian functions to the data, a first rough estimation is performed by finding the local minima and their approximate width with the matlab function peakfinder. Since this function does not find minima, but peaks, the data is inverted, which does not affect the location or width approximation.

Rough line estimation

Fitting Gaussians to the data 

The data is fitted by using a linear least squared curve fitting method and a model function depending on the number of estimated absorption lines from the rough line estimation. The model function is leveled at 1 with Gaussians subtracted from this value with initial parameters corresponding to the previously estimated line. This way multiple Gaussian functions can be fitted at once, which has the advantage that absorption lines that reach into another can be estimated. An alternative or additional approach would be to fit each absorption line independently. Since each Gaussian is based on three parameters (location, width and amplitude) the degrees of freedom when fitting a single Gaussian is small compared to fitting multiple Gaussians at once. The fit then provides a generally more robust solution, with the downside that spectrally narrow absorption lines can not be seperated.

Fitting of Gaussians to the data

Simulation of quasar spectrum

The signal recorded by the spectrometer is expected to contain two major data vectors of the same length. One corresponding to the recorded relative amplitude of the flux and one corresponding to the wavelength, the amplitude is recorded at. The general frequency distribution of Quasar light is thought to be based on black body radiation with additional influences, which are estimated as noise for the purpurse of simulation. The absorption lines of the Lyman Alpha forest are modelled as Gaussians with certain amplitude and width, which effectively decrease the spectrum at certain positions. The central wavelength, amplitude and width of these absorption lines is the signal desired to be found. Note that the real absorption lines within the spectrum are more true to a general Voigt functions. Such a function does contain more degrees of freedom than a Gaussian (which is a special case of a Voigt function) and is harder to fit correctly.

Simulationof qusar spectrum

Processing of quasar spectra

The steps mentioned previously are performed in an additional demonstration script. The main processing script can be found in the downloadable folder. In the main script, a fits file can be read in easily, a desired wavelength region selected and the size and overlap of the data sections determined. After processing, insight into the distribution of the estimated absorption lines is provided.

Processing of quasar spectra
bottom of page