BL Lac host QSFit recipe
Abstract
This is the source code to reproduce the analysis in the paper "BL Lac host galaxies: how to systematically characterise them in optical-NIR spectroscopy", Delucchi et al. (2026). The BL-Lac-host-recipe repository on github allows to download and install the source code used to analyse the BL Lacs UV-NIR synthetic spectra described in the paper. Softwares and packages needed to replicate the analysis:- Julia;- our package BLLacHostRecipe (please, see the instruction on the github readme);- QSFit, DataFrames, CSV packages The repository is composed of a README file and 2 source codes: QSFit_analysis_df.jl (to reproduce the analysis on synthetic spectra) and QSFit_analysis_SDSS.jl (to analyse SDSS BL Lac spectra). The synthetic dataset can be downloaded via the link provided in the repository, which contains 4900 synthetic spectra (as .txt files), including both the "golden sample" and the out-of-sequence spectra (respectively 3500 and 1400 spectra). Each file consists of three columns: wavelength (in Å), flux density in erg cm^(-2) s^(-1) Å^(-1), and the corresponding flux density uncertainty. The synthetic spectra can be analysed with "QSFit_analysis_df.jl". The analysis is set to run twice, with two different host galaxy templates (Ell5 and Sb). Examples of spectral decomposition process carried out by the script for the spectra included in the data directory are shown in Fig. 2, 3, 4. Key input parameters (redshift, host galaxy type, and host-to-blazar luminosity ratios) are automatically extracted from the file names. The resulting best-fit parameters and derived quantities are systematically compiled into a structured DataFrame with columns: filename, redshift, input_host, QSFit_host, fit_stat (best-fit statistic), PL, sigma_PL, alpha, sigma_alpha (power-law normalization and spectral index with their uncertainties), val_host, sigma_host, rel_err_host (host galaxy normalisation and associated uncertainties), sed (phenomenological of out-of-sequence). The final DataFrame is then exported as a .csv file for subsequent analysis and visualisation (e.g. Fig. 5, 7 of Delucchi et al. 2026). The same procedure can be replicated on real data. QSFit_analysis_SDSS.jl analyses SDSS-like .fits spectra, and can be directly applied to a proprietary sample after taking care of minor changes (e.g. file style, data file path, main parameters input).
Publication details
- Journal / source
- Zenodo (CERN European Organization for Nuclear Research)
- Publication date
- 10 March 2026