Skip to Content

Astronomy and Astrophysics Group


MGFIT

IDL Library for Least-Squares Minimization Genetic Algorithm Fitting

Current Version: 0.1

What is MGFIT?
The MGFIT is an Interactive Data Language (IDL)/GNU Data Language (GDL) Library developed to fit multiple Gaussian functions to a list of emission (or absorption) lines using a least-squares minimization technique and a random walk method in the line space (peak, width, and redshift). The initial seed values are estimated by using the MPFIT IDL Library (Markwardt 2009). To determine the best fitting Gaussian functions, it uses a genetic-type random walk method originally adopted from the early version of the Fortran program ALFA (Wesson 2016), which was translated to IDL/GDL and several performance was optimized. It measures the continuum curve and subtract it before the flux measurements. The best-fit model residuals, together with the white noise of the spectrum, are used to calculate uncertainties of the fitted lines using the signal-dependent noise model of least-squares Gaussian fitting (Lenz & Ayres 1992).
How does MGFIT work?
MGFIT uses the flux array and wavelength array of the observed spectrum, and fit the observed lines using the line list read from its data folder for the line identification.
How can I use MGFIT?
MGFIT needs to use the line list data, so you need to read them using the IDL/GDL procedure read_stronglines(), read_deeplines(), and read_ultradeeplines(), then there are the one main function for the line identification, mgfit_emis(). This function is also called by other high-level functions.
What are the system requirements for MGFIT?
MGFIT requires the Interactive Data Language (IDL) compiler developed by ITT Exelis Visual Information Solutions (ITT Exelis VIS). It can be used with GNU Data Language (GDL), which is a free alternative to IDL. It also needs to use some from the external libraries: the IDL Astronomy User's library, the Coyote Graphics Library, and the MPFIT IDL Library. The externals sub-directory contains external libraries which are required for use by the MGFIT IDL library.
Download
The source code can be downloaded from the following links: