Skip to main content
QUICK REVIEW

[Paper Review] VoigtFit: A Python package for Voigt profile fitting

Jens-Kristian Krogager|arXiv (Cornell University)|Mar 3, 2018
Glycosylation and Glycoproteins ResearchBiochemistry, Genetics and Molecular Biology1 references25 citations
TL;DR

VoigtFit is a pure Python package for fitting Voigt profiles to absorption lines in astronomical spectra, enabling simultaneous fitting of multiple components, tied/linked parameters, polynomial continuum modeling, and physical broadening constraints. It supports interactive fitting via matplotlib, scriptable workflows, and is designed for ease of installation and integration into larger projects, with validation on real quasar data showing consistent results with prior studies.

ABSTRACT

I present a Python package developed for fitting Voigt profiles to absorption lines. The software fits multiple components for various atomic lines simultaneously allowing parameters to be tied and fixed. Moreover, the code is able to automatically fit a polynomial continuum model together with the line profiles. Lastly, a physical model can readily be used to constrain thermal and turbulent broadening of absorption lines as well as implementing molecular excitation models. The code can be run with interactive features such as manual continuum placement locally around each line, manual masking of undesired fitting regions, and interactive definition of velocity components for various elements. This greatly improves the ease by which the initial guesses can be estimated. Since the code is written in pure Python, it can easily be scripted and modified to fit the user's needs. The code uses a $χ^2$ minimization approach to find the best solution. The code and a set of test-data together with the full documentation is available on GitHub.

Motivation & Objective

  • To develop a modern, user-friendly, and extensible Python package for fitting Voigt profiles to absorption lines in high-resolution spectroscopic data.
  • To overcome limitations of legacy software (e.g., vpfit, FitLyman) that are difficult to install and not easily scriptable on modern systems.
  • To enable interactive fitting with manual component definition, masking, and continuum placement using matplotlib.
  • To support simultaneous fitting of multiple ions and transitions with tied or fixed parameters.
  • To integrate physical constraints on thermal and turbulent broadening (b-values) and allow for continuum modeling with polynomials.

Proposed method

  • The package uses a χ² minimization approach to fit Voigt profiles to spectral data, with optimization performed via standard nonlinear least-squares fitting.
  • Input data can be in FITS or ASCII format, with support for wavelength, flux, error, and pixel masks; wavelengths are automatically converted from air to vacuum using Edlén's formula if needed.
  • The software supports fitting multiple spectral lines and ions simultaneously, with options to tie or fix parameters such as redshift, b-value, or column density across components.
  • A polynomial continuum is fitted automatically alongside the line profiles, and users can manually define continuum regions or mask problematic segments.
  • Interactive features allow users to define velocity components and adjust fits in real time via a matplotlib-based GUI, improving initial guess estimation.
  • The code is fully scriptable and can be imported into Python workflows, enabling automation and integration into larger data analysis pipelines.

Experimental results

Research questions

  • RQ1How can a modern, interactive, and scriptable Python package improve the fitting of Voigt profiles in high-resolution absorption line spectra compared to legacy tools?
  • RQ2To what extent can automated and interactive fitting reduce user bias and improve accuracy in component and continuum estimation?
  • RQ3Can a pure Python implementation support robust, physically constrained fitting of multiple ions and components with tied parameters?
  • RQ4How does the performance of VoigtFit compare to established tools like vpfit in terms of fitting accuracy and convergence on real astronomical data?
  • RQ5What is the impact of interactive continuum placement and masking on the reliability of column density and b-value measurements?

Key findings

  • VoigtFit successfully reproduced high-precision column densities for Fe II, Si II, and O I in the z = 3.08815 absorber toward Q0420−388, with log N(Fe II) = 14.09 ± 0.02, log N(Si II) = 14.65 ± 0.01, and log N(O I) = 15.34 ± 0.01.
  • The results are consistent with previous studies using lower-resolution and noisier data (Carswell et al. 1996), validating the accuracy of VoigtFit despite higher signal-to-noise and resolution.
  • The slight differences in column densities for Fe II and Si II compared to prior work are attributed to different assumptions about b-values, with VoigtFit using tied broadening parameters versus fixed temperature in earlier work.
  • The package demonstrated robust performance on real data, handling complex blends and saturated lines effectively through interactive masking and component definition.
  • The software enables efficient, reproducible, and extensible analysis workflows due to its pure Python implementation and full scriptability.
  • VoigtFit is available via GitHub and PyPI, with comprehensive documentation and active maintenance, supporting community adoption and long-term usability.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.