Logo FIREFLY
Credit: NSF–DOE Vera C. Rubin Observatory — CC BY 4.0

Full Spectral Fitting Code

Fitting IteRativEly For Likelihood analYsis

Get Started

FIREFLY is a python-based full spectral fitting code designed to recover the physical properties of galaxies from their spectra. FIREFLY employs a prior-free chi-squared minimisation technique along with the latest stellar population libraries such as MaStar to analyse spectra from surveys like DESI and SDSS.

Traditional spectral fitting codes often introduce fixed priors or polynomial normalisations to stellar continuums to speed up fitting. While computationally efficient, these assumptions can bias the recovered ages and metallicities of stellar populations.

In contrast, FIREFLY fits combinations of SSP components to converge on a best fit and reconstructs the star formation history of galaxies without imposing restrictive priors or arbitrary continuum corrections. This prior-free, iterative chi-squared minimisation technique ensures a unbiased parameter derivation, and the ability to accurately determine the stellar mass, age, and metallicity of galaxies.

Developed in 2017 by the Institute of Cosmology and Gravitation (ICG, Portsmouth, UK), FIREFLY quickly established itself as a powerful tool for deriving the properties of millions of galaxies from large spectroscopic surveys. Its key advantages include:

  • Preserving intrinsic SEDs: unlike other codes, FIREFLY does not apply arbitrary polynomials to normalise spectra, so the stellar continuum shapes are fully preserved for accurate comparison with model spectra.
  • Handling low S/N: FIREFLY recovers reliable stellar parameters down to a uniquely low S/N∼5, making it ideal for deeper surveys like DESI.
  • Multiple viable solutions: by using the Bayesian Information Criterion (BIC), FIREFLY retains several nearly-equivalent fits rather than a single best-fit, improving convergence with models and allowing for realistic error estimates on derived parameters.

These design choices make FIREFLY particularly well-suited for analysing the latest data from vast spectroscopic datasets like SDSS and DESI.

Try Now

Test FIREFLY for yourself with our quick demonstration tool

FIREFLY Demo Tool →
FIREFLY Workflow Diagram
Credit: Samuel Helps (FIREFLY Collaboration) — CC BY 4.0

Begin Fitting with FIREFLY

Installation

Clone the FIREFLY repository via GitHub

Learn more →

Configuration

Format input data and specify SSP model choice, resolution, IMF, and dust model

Learn more →

Launch

Fit galaxy spectra with tutorials included for DESI and SDSS.

Learn more →

Stellar Population Models

Full spectral fitting relies on stellar population models made of libraries of Simple Stellar Populations (SSPs) - groups of coeval stars formed in single bursts. Each SSP model is synthesised by summing stellar spectra along an isochrone, accounting for an Initial Mass Function (IMF) and the population's stellar evolution.

Classical isochrone synthesis computes the total luminosity from stars still on the main sequence, while the Fuel Consumption Theorem handles the post-main-sequence phases, where smaller numbers of bright stars can dominate a galaxy's stellar continuum. FIREFLY combines many SSP models (of different ages and metallicities) to reconstruct a galaxy's star formation history.

Integrated into FIREFLY:

The evolution of SSP models has greatly expanded in stellar parameter coverage over time. M05 (Maraston 2005) was the first to include treatment of Thermally-Pulsating AGB (TP-AGB) phase stars and their spectral contribution especially in intermediate-age populations. This improved the flux predictions in the near-infrared (IR) wavelength regime, vital for modelling high-redshift galaxies.

M11 later merged the M05 framework with large empirical stellar libraries (Pickles, MILES, ELODIE, STELIB) and theoretical MARCS spectra for NIR modelling. M11 achieved a uniquely high spectral resolution (up to R≈20,000) and covered a broad metallicity range (-3.0 < [Fe/H] < +1.6). It also incorporated fully empirical TP-AGB spectra (Lançon & Mouhcine 2002). However, M11 still had limitations its parameter coverage, under-representing some more rare stellar types, particularly very low-mass stars, and had limited empirical UV/NIR coverage requiring artificial extensions to the edges of spectra.

MaStar spectral coverage or visualisation
Credit: Samuel Helps (FIREFLY Collaboration) — CC BY 4.0

As the most recent and widely adopted model in the FIREFLY framework, MaStar represents a significant leap forward in stellar population synthesis. Its large and diverse empirical spectral library, based on ~60,000 stars from SDSS-IV/MaNGA, enables the derivation of galaxies features across a highly-sampled broad range of stellar parameters.

The empirical inclusion of metal-poor and low-mass stars, previously under-represented, is especially critical for analysing passive populations, globular clusters, and dwarf galaxies. With coverage across 3622-10354 Å, MaStar has become the default choice for modern galaxy evolution studies.

MaStar's high-S/N empirical stellar spectra cover a wide range of temperatures, gravities and metallicities (Seen in Table). Only the SSP energetics in the stellar library are modelled theoretically, keeping the intrinsic shape of the spectra directly from observations. The result is very high fidelity SSPs calibrated to the MaNGA resolution (R≈1800). FIREFLY showcases MaStar as its default model grid as it proves to outperforms earlier models, decreasing residuals near its wavelength limits (∼4,000Å and ∼10,000Å), better representing key spectral features.

Model Wavelength Range
(min-max) / Å
Age Range
(min-max) / Gyr
Age Grid
N ages
Metallicity
[Fe/H]
HB Morphology
Th-MaStar 3621.6 - 10352.31 - 1515[-2.3]red
3621.6 - 10352.31 - 1515[-2.3]red
3621.6 - 10352.31 - 1515[-2.3]blue
3621.6 - 10352.30.5 - 1520[-1.3]red
3621.6 - 10352.30.5 - 1520[-1.3]blue
3621.6 - 10352.30.2 - 1523[-0.3]red
3621.6 - 10352.30.2 - 1524[+0.0]red
3621.6 - 10352.30.2 - 1525[+0.3]red
E-MaStar 3621.6 - 10352.310 - 1515[-2.3]red
3621.6 - 10352.310 - 1515[-2.3]red
3621.6 - 10352.36 - 1515[-2.3]red
3621.6 - 10352.36 - 1515[-2.3]blue
3621.6 - 10352.30.5 - 1520[-1.3]red
3621.6 - 10352.30.5 - 1520[-1.3]blue
3621.6 - 10352.30.4 - 1521[-0.3]blue
3621.6 - 10352.30.2 - 1524[+0.0]blue
3621.6 - 10352.30.2 - 1525[+0.3]blue
Parameter coverage of the MaStar SSP models, including both the earlier theoretical (Th-MaStar) and empirical (E-MaStar) model sets (Maraston et al. 2020).

Surveys

FIREFLY has already analysed millions of galaxies from spectroscopic surveys, including:

DESI
SDSS
Interactive Galaxy Sky Map

Usage & Citation

If you use FIREFLY or its resources for work/research presented in a publication we ask that you please cite the following papers: