DTU Risø Campus Technical University of Denmark


PALSfit spectrum files


Elements of a PALSfit spectrum file

  1. Spectrum file
  2. Spectrum header
  3. Spectrum body
1. Spectrum file

A spectrum file is a text file consisting of a number of positron lifetime spectra (from 1 up to 100 spectra).
The preferred filetype is .dat.

A spectrum in a spectrum file must be composed of a 'spectrum header' line and a 'spectrum body'.
The latter consists of a number of 'channels', each containing a count number.

All spectra in a spectrum file must consist of the same number of channels.

A spectrum file containing several spectra should have each spectrum terminated by a blank line.

2. Spectrum Header

The first line of a spectrum will be interpreted as a header to identify the individual spectrum in the file.

No two headers should be identical. If they are, only the first af those spectra will be accessible.

If a header is missing, PALSfit will attempt to use the first dataline (in the body) as the header.
This will only work if the spectrum file contains one single spectrum.

3. Spectrum body

The spectrum body contains the actual counts in a proper format suitable for collective reading.

There is in principle no limit to the number of channels. The program has been verified up to 64,000 channels pr. spectrum.

PALSfit allows spectrum lines to be up to 260 characters in width, but we recommend a maximum of 80 characters pr. line.

Each line (except the first and last) in the spectrum body must contain the same number of channels.

If the first line has fewer numbers than the following, then it will be skipped when reading the spectrum.
This allows for storing extra descriptive data, which will be neglected by PALSfit.

The preferred format of a data line is n columns of right aligned integer numbers.

PALSfit will however accept lines containing n numbers separated by a fixed delimiter, either comma or tabulation, as long as the same delimiter is used in all spectra in the file.

If the last line in a spectrum is shorter, only by containing fewer channels, but otherwise formatted like the rest, then these channels will be included in the spectrum and included in the channel count, otherwise they will be skipped.

Webmaster 20. june 2022