betaFeedback

WorksPhysics and Astronomy

Redrock: Spectroscopic Classification and Redshift Fitting for the Dark Energy Spectroscopic Instrument

Abstract

Redrock is a software package for spectroscopic classification and redshift fitting, designed to use the full information from spectroperfectionism outputs: flux-calibrated spectra, uncorrelated errors, and a per-spectrum resolution matrix encoding the non-Gaussian wavelength-dependent spectral line-spread function. Redrock was originally developed for the Dark Energy Spectroscopic Instrument (DESI), but the Extended Baryon Oscillation Spectroscopic Survey (eBOSS) also used Redrock as their primary galaxy redshift fitter prior to DESI. This paper presents the algorithmic details of Redrock and its performance on DESI data. On spectra from DESI DR2, Redrock achieves a redshift recovery rate of approximately 98% for the Bright Galaxy Survey (BGS) and Luminous Red Galaxies (LRG), 95.9% for Emission Line Galaxies (ELG), and 92.6% for quasars (QSO), and it delivers unbiased stellar radial velocities with a precision of roughly 5 km/s.

Introduction

Introduction

The Dark Energy Spectroscopic Instrument (DESI; [28, 30, 66, 78]) is a spectroscopic redshift survey designed to observe ∼60 million galaxies and quasars over 17,000 deg2^2 with an 8-year observing program (E. F. Schlafly et al. [82]). In addition to the sky-subtracted flux-calibrated spectra, a key output of DESI is the spectral classification (galaxy, quasar, star) and redshift of each observed object, included with the public data releases (DESI Collaboration et al. [31, 33]). Redrock is a spectral classification and redshift fitting code designed for the needs of DESI, while at the same time being open-source and generic enough to be applicable to other spectroscopic surveys such as the Sloan Digital Sky Survey (SDSS).

The algorithmic method in Redrock is similar to that used by SDSS (A. S. Bolton et al. [15]): selecting the χ2\chi^2 minimum from Principal Component Analysis (PCA) template fits over a range of redshifts and template spectral types. It improves upon that method through updated templates, more rigorous error propagation, the use of wavelength-dependent non-Gaussian per-spectrum resolution modeling, and optional spectral archetype fits to avoid unphysical solutions (A. Anand et al. [8]). The improvements in Redrock were significant enough that the SDSS-IV Extended Baryon Oscillation Spectroscopic Survey (eBOSS) switched to using Redrock for the final cosmology analyses instead of the original SDSS code (A. J. Ross et al. [80]).

Other previous methods for automated spectroscopic classification and redshift measurement include template Fourier cross-correlation (J. Tonry & M. Davis [86]), explicitly matching observed spectral peaks to sets of known emission lines (WiggleZ; M. J. Drinkwater et al. [35]), template fitting after subtracting a median-filtered spectrum (DEEP2; J. A. Newman et al. [73]), and fitting flux-calibrated spectra to a library of archetype basis templates (PRIMUS; R. J. Cool et al. [25]). Redrock also uses flux-calibrated spectra — including the continuum — and fits templates across all observed wavelengths simultaneously without explicitly searching for and fitting individual emission or absorption features. This approach enables Redrock to use the full information available in the data. Since the PCA templates are derived from complete spectra, they implicitly encode correlations between line strengths, relative velocity offsets (for the quasar templates), and other line properties in addition to the relationship between these features and the underlying continuum shape. In principle, this offers an advantage over methods that rely on identification of individual features or groups of features: many low signal-to-noise emission and/or absorption lines can collectively contribute to achieving a secure classification and emission line confusion is discouraged. However, this approach is limited by the adequacy of the PCA templates, and reliant upon upstream

processing to provide high-quality sky-subtracted flux-calibrated spectra with well-characterized errors as input.

Redrock comes with a set of templates for fitting stars, quasars (QSOs), and galaxies. The default templates are tuned to the primary populations targeted by DESI. For example, the default galaxy templates are derived from simulated spectra of nearby bright galaxies (BGS; C. Hahn et al. [42]), old metal-rich luminous red galaxies (LRG; R. Zhou et al. [94]), and active star-forming emission line galaxies (ELG; A. Raichoor et al. [79]) while the quasar templates are designed to span the spectral diversity observed over the full targeted redshift range (z<3.5z < 3.5) for cosmology (E. Chaussidon et al. [22]). At the same time, the templates are kept separate from the code, enabling future projects to develop their own custom templates that match their target populations (e.g., V. Ruhlmann-Kleider et al. [81]).

This paper is organized as follows. § 3 provides an overview of the Redrock algorithmic method. § 4 describes the underlying galaxy, QSO, and stellar templates, with further details in Appendix § 11. § 5 lists the performance of Redrock on DESI data. Known issues are described in § 6. §§§ 7, § 8, § 9 discuss the computational performance, output files, and Redrock code, respectively. We conclude in § 10.

Overview of Method

Redrock determines spectral classes and redshifts of astronomical spectra by fitting Principal Component Analysis (PCA) templates to the data. Each template set models a particular spectral class — galaxy, quasar, or star — and is fit over a range of redshifts zz to form a χ2\chi^2 vs. zz scan. The minimum χ2\chi^2 from these scans is selected as the best-fit spectral classification and redshift. In addition to their overall classification, templates can optionally have a subtype, e.g., Redrock has multiple template sets for different stellar subtypes; see § 4.1.3. The core Redrock algorithms are independent of the specific templates and redshift ranges used. § 4 describes the default DESI-centric templates provided with Redrock, but other users can develop (and have developed) their own templates to use with Redrock for other cases.

Redrock is designed to make full use of the spectral outputs of the “spectroperfectionism” algorithm described in A. S. Bolton & D. J. Schlegel [14] — flux-calibrated spectra with an error model that is by construction uncorrelated across wavelength bins, and a resolution matrix per spectrum encoding the full non-Gaussian wavelength-dependent spectral line-spread function. In order to preserve the fidelity of the input data error model, including its lack of covariance between wavelength bins, Redrock always transforms the templates to match the data (redshifting, wavelength resampling, resolution convolving), rather than transforming the data to match the templates.

Redrock fits flux-calibrated spectra but does not incorporate separate imaging-based photometric fluxes or colors as part of the fit. Although the PCA templates provide some flexibility to absorb flux-miscalibration, the templates themselves were constructed from flux-calibrated models and data without explicitly introducing broadband mis-calibration terms into the templates. Early algorithmic comparison testing indicated that Redrock outperformed methods that first removed broadband spectral information, implying that the use of imperfectly calibrated data was better than completely removing calibration effects. However, this improvement has not been quantified on current DESI data. It should also be noted that galactic extinction is not incorporated into Redrock fits.

DESI runs Redrock on spectra that are pre-coadded across exposures following the algorithm described in J. Guy et al. [41] §4.11, which includes the effective resolution matrix of the resulting coadded spectra. An equivalent algorithm is implemented independently within Redrock and is used if the inputs are provided as uncoadded spectra; since it does not import the DESI pipeline code, it is not guaranteed to reproduce the DESI pipeline coadds exactly. Redrock can simultaneously fit multiple spectra for the same object, but it will coadd them only if they are already on identical wavelength grids. For example, DESI coadds across exposures but not across spectrograph arms, such that each target has 3 spectra for the 3 DESI spectrograph arms B (3600–5930 Å), R (5600–7720 Å), and Z (7470–9800 Å). Redrock naturally handles the camera overlap regions since the measurements in each arm are independent. Redrock performs a simultaneous fit to all 3 spectra per object to determine a single best-fit classification and redshift. Since the DESI spectra are in the barycentric frame, so are the resulting redshift estimates from Redrock.

The templates are assumed to be noise-free and fully span the wavelength range of the data for any possible redshift solution. To perform the redshift scan, Redrock multiplies the wavelength grid of the templates by (1+z)(1+z) then resamples to the binning of the data using trapezoidal integration over each wavelength bin. It then multiplies the templates by the wavelength-dependent resolution matrix RR, provided by the spectropectifionism extractions (see §4.5 of J. Guy et al. [41]). The redshifted and resampled templates tit_i, convolved with the resolution matrix RR, are then fit to the spectral flux ff with uncertainties σ\sigma to obtain the PCA coefficients cic_i and best fit χ2\chi^2.

χ2(z)=∑λ(fλ−∑ici(Rti)λσλ)2(1)\chi^2(z) = \sum_{\lambda} \left(\frac{f_\lambda- \sum_i c_i(Rt_i)_\lambda}{\sigma_\lambda}\right)^2 \tag*{(1)}

The initial χ2\chi^2 vs. zz scan uses the redshift ranges and step sizes given in Table 1 for each template set. 70 For each template set, the lowest 3 minima are rescanned using 15 finer redshift steps spanning ±1\pm1 coarse redshift step around the original minimum. These are refined in order from lowest χ2\chi^2 local minimum to highest; if a new minimum is within 1000 km s−1^{-1} of a previously fit minimum (or 100 km s−1^{-1} for stellar fits), it is considered part of the same redshift solution and skipped, so that the lower-χ2\chi^2 minimum is always the one retained.

Templateλrf\lambda_{rf} range (Å)zmin⁡z_{\min}zmax⁡z_{\max}zz step
STAR3000 − 11000−0.0020.002Δz=4×10−5\Delta z = 4 \times10^{-5}
GALAXY1228 − 11000−0.0051.7Δlog⁡(1+z)=3×10−4\Delta\log(1+z) = 3 \times10^{-4}
QSO450 − 103990.056.0Δlog⁡(1+z)=5×10−4\Delta\log(1+z) = 5 \times10^{-4}
QSO-LOZ1329 − 96320.051.6Δlog⁡(1+z)=5×10−4\Delta\log(1+z) = 5 \times10^{-4}
QSO-HIZ444 − 44981.47.0Δlog⁡(1+z)=5×10−4\Delta\log(1+z) = 5 \times10^{-4}

Table 1. Rest-frame wavelength coverage, redshift ranges, and redshift step sizes used by each Redrock template type. The DESI Early Data Release (EDR) used a single QSO template set spanning redshifts 0.05≤z<6.00.05 \le z < 6.0; Data Release 1 (DR1) and the forthcoming DR2 use two sets of QSO templates spanning 0.05≤z<1.60.05 \le z < 1.6 and 1.4≤z<7.01.4 \le z < 7.0.

A parabola is fit to the 3 points around the minimum of the new finer χ2\chi^2 vs. zz scan. The parabolic fit minimum defines the redshift and χ2\chi^2 for this candidate classification/redshift, and the change in redshift for a Δχ2=1\Delta\chi^2 = 1 is used as the estimate of the statistical redshift error. This is shown schematically in Figure 1 for fitting 3 minima while excluding a 4th minimum that is too close in redshift to an already better minimum. Figure 2 shows the coarse redshift scan, refined redshift scan, and parabola fit to the minimum for a DESI QSO target at z=3.3963z = 3.3963. The redshift step size and number of points included in the final fit were selected to balance algorithmic performance, robustness to fit failures, and computational cost.

Figure 1. Schematic diagram of χ2\chi^2 vs. zz scan and minimum selection.

Example chi-squared versus redshift scan for a QSO

Figure 2. Example χ2\chi^2 vs. zz scan for a QSO. The upper plot shows χ2\chi^2 vs. zz for the coarse redshift scan for GALAXY and QSO templates; the lower plot shows a zoom in of the finer redshift scan around the χ2\chi^2 minimum and the final parabolic fit to the 3 points about the minimum.

After determining the fits to the best 3 minima of each template set, these are then compared to select the best overall redshift. Failed minima fits are excluded, and the lowest χ2\chi^2 of the remaining fits is chosen. A fit is considered failed if its minimum is outside the range of points being fit, the parabola has zero or negative curvature, the χ2\chi^2 vs. zz parabola minimum is negative, or the linear algebra fitting routine (numpy.polyfit) raises an exception (a defensive check, e.g., for non-finite χ2\chi^2 values when no valid data remain). In the case where the minimum is at an endpoint (e.g., z=1.7z = 1.7 for galaxies), the refined scan spans only the single coarse step on the interior side, since templates are never evaluated outside their configured redshift range. If χ2\chi^2 is still decreasing toward the boundary, the parabola minimum falls outside the fitted points and the candidate is considered a failed fit and excluded.

Although different template sets may have different numbers of coefficients (as is the case for the default DESI template set), Redrock compares the total χ2\chi^2, not the reduced χ2\chi^2, when selecting the best overall redshift. While this slightly biases the solution towards templates with more eigenspectra, this convention was used for all DESI data productions to date. In § 6 we show that ranking by reduced χ2\chi^2 instead would have a negligible effect on the redshifts of confidently classified spectra. In addition to the single best overall classification/redshift, Redrock also saves the original χ2\chi^2 vs. zz

scan for each template, and the refined scans and fits of the best 3 fits per classification (galaxy, QSO, or star). For example, although there are 8 different stellar templates, only the best 3 across all stellar templates are kept, even if the 4th best stellar fit is better than the best galaxy fit.

Figure 3 shows Redrock fits to the 3 primary DESI target types observed during dark time: an LRG, ELG, and QSO. Redrock does not distinguish between galaxy subtypes, and thus fits both the LRG and the ELG with the same galaxy PCA templates even though they have dramatically different continuum vs. emission line properties. While the Redrock fits (dark lines) are to the unsmoothed data, the data in the figure (light lines) have a 2.4 Å (3 wavelength bin) Gaussian smoothing for visual clarity. Inset plots illustrate the ability of the templates to accurately model distinct galaxy features, such as the Ca H&K absorption lines for the LRG, and the [O II] λλ3726, 29 doublet for the ELG.

Figure 3. Example Redrock fits to an LRG (top, with inset for Ca H&K), an ELG (middle, with inset plot for [OII]), and a QSO (bottom). The targets plotted are TARGETIDs 39633118721739723 (LRG), 39633123197060417 (ELG), and 39633123192868556 (QSO) from tile 325 of the Iron (DR1) data production. The data are shown in cyan with a 2.4 Å Gaussian smoothing for visual clarity, with the best-fit template overlaid in black. The inset plots do not smooth the data.

During early Redrock development using simulated DESI data, a significant cause of incorrect redshifts was unphysical negative [O II] fits with the galaxy templates caused by noise fluctuations. This failure case was mitigated by penalizing the χ2\chi^2 for galaxy template fits if the [O II] model flux integrated over rest-frame wavelengths 3724≤λ≤37333724 \le\lambda\le3733 Å is negative. The penalty term is simply the absolute value of the integrated flux in units of 10−17erg s−1 cm−210^{-17}\mathrm{erg\ s^{-1}\ cm^{-2}}. There is no particular mathematical justification for this choice; it pragmatically worked and development moved on. Internal DESI studies indicate that sub-percent improvements to ELG purity could be achieved by making this more rigorous through accounting for the measured noise, also fitting for the continuum, and making the penalty vary with the square of the significance instead of an unweighted linear penalty. These possible changes have not been implemented in Redrock production code, however, and the ad hoc linear penalty for negative [O II] remains.

Default Templates

Accurate spectroscopic redshifts require high-quality spectrophotometric templates which faithfully represent the spectral diversity spanned by galaxies and QSOs over cosmic time. In this section we describe the procedure used to develop the default galaxy, QSO, and stellar templates used by DESI, available at https://github.com/desihub/redrock-templates. Other projects could develop alternate templates for additional target types such as Lyman-α\alpha Emitter (LAE) galaxies.

Principal Component Analysis Templates

Because Redrock always transforms the templates to match the data (see § 3), the templates should ideally be defined at higher spectral resolution than the data. As outlined in the following subsections, the galaxy and most of the stellar templates satisfy this requirement with a resolution more than twice the maximum resolution of the DESI spectrographs and a rest-frame wavelength grid of 0.1 Å. The quasar templates and the cataclysmic variable template are exceptions. They are empirically derived from SDSS/BOSS data (R≈1500\mathcal{R} \approx1500–2500), and thus include the instrumental broadening of those spectra. Redrock nonetheless convolves them with the DESI resolution matrix like any other template. For the broad emission lines that dominate quasar redshift fits (FWHM of thousands of km s−1^{-1}), the additional broadening is negligible, but narrow features in the quasar templates are modeled at somewhat lower resolution than the DESI data. This is discussed further in § 6.

Galaxy templates

To construct the galaxy PCA templates, we start from physically motivated galaxy spectral models. We use these models to generate a large number of synthetic galaxy spectra whose properties are matched to the observed DESI galaxy populations, and then perform PCA on this set to derive a compact set of eigenspectra spanning the range of galaxy spectra observed by DESI.

The synthetic spectra are built from the set of basis templates described in Appendix § 11, which span a wide range of stellar-continuum and emission-line properties. Specifically, we generate 10,000 random realizations of ELGs, 5,000 LRGs, and 5,000 galaxies matching the DESI BGS sample. These were generated for rest-frame wavelengths 1,228–11,000 Å on a linear 0.1 Å grid. Each spectrum was normalized to have median(flux) = 1 before performing PCA so that the eigenvector variation would capture differences between the spectra and not just normalization variations. The mean flux was not subtracted prior to PCA, such that the 0th component represents the approximate mean spectrum as an output of PCA. Due to the large size of the input matrix (20k by 97.7k), the PCA solution was determined iteratively using the EMPCA algorithm2 described in S. Bailey [12].

The final galaxy templates use the top 10 PCA eigenvectors as shown in Figure 4. The number of eigenvector templates was selected to balance code runtime with algorithmic performance on eBOSS and pre-DESI simulated data, but it was not optimized in detail. The code used to generate the galaxy PCA templates is in the bin/rgaltemplate script at https://github.com/desihub/redrock.

Figure 4. Galaxy eigenspectra used by Redrock, scaled for clarity. The [O II] inset illustrates how the different eigenspectra capture variation in emission line profile.

Quasar templates

Quasar spectra exhibit extreme diversity in their emission and absorption properties. As such, Redrock relies on empirically derived templates (unlike with galaxies and stars) to maximize the information content of the spectral models.

The original version of Redrock used the same QSO templates as SDSS. A. S. Bolton et al. [15] documents the details of their construction.3 These include 4 eigenvectors on a Δlog⁡(λ)=0.0001\Delta\log(\lambda) = 0.0001 logarithmic restframe wavelength grid from 450.2450.2 Å to 10399.210399.2 Å. The Lyman-series forest is present at λRF<λLyα\lambda_{\mathrm{RF}} < \lambda_{\mathrm{Ly}\alpha} in the spectra of high redshift objects, leading to an overall redshift-dependent suppression of flux blueward of this wavelength (e.g., M. McQuinn [65]). The expected flux deficit at the redshift being fit is accounted for by applying a wavelength-dependent correction to the templates at λRF<λLyα\lambda_{\mathrm{RF}} < \lambda_{\mathrm{Ly}\alpha} following the model of F. Calura et al. [20].4 This version of the QSO templates was used for the DESI spectroscopic pipeline included in its Early Data Release (EDR; DESI Collaboration et al. [31]).

After the EDR dataset was internally frozen and released to the DESI collaboration, a new set of QSO templates was developed by A. Brodzeller et al. [17]. Their §4.1 describes the improved spectral diversity coverage of these templates relative to the EDR version, particularly for systems with dust-reddened continua or those exhibiting strong absorption. These used a much larger set of input SDSS DR16 quasars (B. W. Lyke et al. [62]), updated the Lyman-series optical depth model (V. Kamble et al. [48]), and split the sample into separate low-redshift (LOZ, 0.05<z<1.60.05 < z < 1.6) and high-redshift (HIZ, 1.4<z<71.4 < z < 7) templates, shown in Figure 5. Algorithmically, the LOZ and HIZ template sets are treated as QSO subtypes; every target is fit with both LOZ and HIZ QSO templates over their individual redshift ranges (see Table 1), and the lowest 3 QSO χ2\chi^2 fits across either template set are kept for comparison with other templates. If the true redshift lies within the overlap range of the templates 1.4≤z<1.61.4 \le z < 1.6, typically both templates will have a minimum at the same redshift and the one with the lower χ2\chi^2 is selected. QSOs with a true redshift just under the boundary of z=1.4z = 1.4 typically have a good QSO-LOZ minimum fit, but the QSO-HIZ fit may extrapolate beyond its redshift range and result in an unreliable extrapolated minimum. This is flagged as a bad QSO-HIZ fit and discarded and the QSO-LOZ is kept instead. A similar effect occurs in reverse for targets just above the z=1.6z = 1.6 boundary. These cases require no QSO-specific code: an extrapolated minimum outside a template’s redshift range fails the minimum-fit criteria described in § 3 and is discarded by the generic ranking of fits across templates. This also makes it possible for future galaxy templates to be customized for different redshift ranges.

Figure 5. QSO eigenspectra used by Redrock for Data Release 2. The eigenspectra fluxes are scaled for clarity.

Stellar templates

The stellar templates for Redrock were derived from the main-sequence stellar models from C. Allende Prieto et al. [7]. These high-resolution (R=10,000R = 10{,}000) models span a wide range of stellar effective temperature (TeffT_{\mathrm{eff}}), surface gravity (log⁡10g\log_{10} g), and iron abundance ([Fe/H]). The basic parameters of the stellar models used are detailed in Table 2.

ParameterValue Range
TeffT_{\mathrm{eff}}3500−30,0003500 - 30{,}000 K
log⁡10g\log_{10} g0.0−5.00.0 - 5.0 cm s−2^{-2}
[Fe/H]−2.5−0.5-2.5 - 0.5
Wavelength grid3000−10999.53000 - 10999.5 Å

Table 2. Parameters for theoretical stellar models.

The stellar template training sample consisted of 10,000 random realizations from these models generated on a linear 0.1 Å wavelength grid from 3000 Å to 11000 Å. Due to the significant spectral variation of stars with TeffT_{\mathrm{eff}}, a single set of PCA eigenvectors was not sufficient for accurate classification — a small number of PCA eigenvectors were unable to capture the variation found in stars, while a large number of PCA eigenvectors enabled too much flexibility for unphysical fits and was additionally computationally prohibitive to use. To accommodate the underlying stellar diversity, the training sample was split by effective temperature TeffT_{\mathrm{eff}} into separate samples to generate PCA eigenvectors roughly corresponding to the physical stellar subtypes listed in Table 3. Input spectra with TeffT_{\mathrm{eff}} on the boundary between subtypes were used by both samples, thus the sum of the individual sample sizes exceeds the original 10,000 generated. The top 5 eigenvectors were kept for each stellar subtype.

Subtypemin TeffT_{\mathrm{eff}}max TeffT_{\mathrm{eff}}sample size
B10,00030,0002,182
A7,00010,0001,466
F6,0007,5001,705
G5,2006,000955
K3,7005,2001,437
M3,5003,7003,432

Table 3. Effective temperature ranges and sample size used for each Redrock stellar template subtype.

A separate white dwarf PCA template set was generated using 10,000 DA and 10,000 DB subtype models (D. Koester [52]) on the same wavelength grid as the other stellar spectra, also keeping the top 5 eigen-spectra. Finally, a 3-component cataclysmic variable (CV) stellar template was constructed by reformatting the spEigenCVstar-55734.fits model from the SDSS/BOSS idlspec2d code (A. S. Bolton et al. [15]).

Although Redrock splits stellar templates by subtype, this is intended primarily as an algorithmic method to accommodate broad spectral diversity while limiting the phase space of possible template fits. The Redrock stellar subtypes were not designed for a rigorous stellar classification. Compared to the more detailed TeffT_{\mathrm{eff}} fits in S. Koposov et al. [53], Redrock’s best fit stellar template matches only ∼65%\sim65\% of the time, though the neighboring template (higher- or lower-temperature range) is typically the selected one when they don’t match.

Redrock stellar template eigenspectra are shown in Figure 6. The code used to generate the stellar PCA templates is in the bin/rrstartemplate script at https://github.com/desihub/redrock.

Figure 6. Redrock eigenspectra for the eight stellar subtype templates. Flux is in arbitrary units.

Archetypes

Similar to PRIMUS (R. J. Cool et al. [25]), eBOSS used archetype templates both with the redmonster software package (T. A. Hutchinson et al. [46]) and with Redrock. The archetypes in Redrock improved purity by avoiding unphysical solutions (A. J. Ross et al. [80]); these are available in a separate repository https://github.com/desihub/redrock-archetypes tag 0.1. The eBOSS-optimized archetypes did not work well for DESI, which observed a broader diversity of galaxy targets, so new galaxy archetypes were developed for DESI with details described in A. Anand et al. [8]. These are available as tag v1.0.074, though these have not yet been used in an official production run scheduled for public release.

Here, we provide a brief summary of the method. In the archetype-based approach, galaxy spectra are modeled using a set of physically motivated spectral templates, known as archetypes. These archetypes represent realistic galaxy spectral energy distributions (SEDs) and effectively capture physical features such as emission and absorption lines observed in the data. These archetypes are stored separately from the core pipeline, allowing them to be independently developed and updated.

To prevent unphysical solutions, the linear coefficients associated with these archetypes are constrained to be strictly positive using a Bounded-Value Least Squares (BVLS, P. B. Stark & R. L. Parker [84]) method. This constraint eliminates non-physical modeling artifacts, such as inverted emission or negative absorption features. Additionally, in archetype mode, we incorporate Legendre polynomials per camera to flexibly model and absorb spectrophotometric calibration issues (see J. Guy et al. [41]; A. Anand et al. [8], for details). These include additive offsets arising from CCD amplifier bias mismatches at camera boundaries and chromatic distortions due to fiber positioning and focal plane throughput variations. While PCA templates have the flexibility to partially absorb these effects, archetypes do not, since they are constrained to be physically meaningful, thus additional polynomial terms are helpful to absorb the unphysical effects. The Redrock fitting algorithm allows users to define a prior on the χ2\chi^2 contribution from the Legendre polynomial terms. This ensures that the polynomial correction primarily addresses CCD calibration issues and prevents the polynomials from mistakenly modeling intrinsic spectral features, such as the quasar power-law continuum, or calibration issues. For further details, see A. Anand et al. [8].

By combining physical archetypes with per-camera polynomial corrections, this approach produces redshift fits that are more physically realistic, while preserving the speed and robustness of the pipeline on DESI spectra. In the pipeline, the archetype-based method can be invoked by passing the archetypes using the --archetypes option to redrock.external.desi.rrdesi.

Another algorithmic feature that Redrock supports in archetype mode is the ability to combine multiple nearby archetypes (along with Legendre polynomial terms), rather than relying solely on the single best-fit archetype when fitting for the redshift. This approach effectively performs a “sub-grid” interpolation by taking the best-fitting archetype and combining it with its NN nearest neighbors in χ2\chi^2 space. As detailed in A. Anand et al. [8], this method provides slightly improved χ2\chi^2 values for some spectra due to the increased flexibility from a larger number of fitting coefficients. However, it also introduces significantly higher computational cost—approximately three times slower—because of the expanded template set and greater degrees of freedom. This mode can be enabled by passing the --n-nearest NUMBER option to redrock.external.desi.rrdesi. The archetype mode was extensively tested on a large volume of DESI spectral data, and its performance is described in detail in A. Anand et al. [8]. While Redrock performs slightly better in archetype mode, this improvement comes at the cost of longer runtime.

Algorithmic Performance on DESI Data

Redrock’s performance on the DESI extragalactic data set was validated as a part of DESI’s Survey Validation phase (SV; [32]). T.-W. Lan et al. [59] presents the results of the validation study on the galaxy (BGS, LRG, and ELG) sample, while D. M. Alexander et al. [6] reports analogous results for the QSO sample. As part of this validation process, more than 15,000 DESI spectra were visually inspected (VI) to construct high-fidelity truth catalogs.6 These truth catalogs informed the definitions of the large-scale structure catalogs used for DESI’s key cosmological analyses (A. G. Adame et al. 2025a,b; M. Abdul Karim et al. 2025a). We compare these VI truth catalogs to the Redrock results on data from the Loa production for the upcoming DESI DR2 and repeat a similar validation analysis here. Throughout this section, true redshifts, spectral types, and quality flags are taken from the VI_Z, VI_SPECTYPE, and VI_QUALITY columns of the VI catalogs.

The targets in the VI catalogs each received multiple exposures, up to ten times the nominal depth, which were coadded to create high S/N spectra for robust VI. The nominal depth for objects observed by DESI is 240 seconds for bright-time targets (BGS and most stellar targets) and 1000 seconds for dark-time targets (LRG, ELG, QSO). We exclusively use the Redrock results on spectra coadded to nominal depth to estimate the typical performance expected for the main survey. Classifications with non-zero ZWARN attributes (see § 8) are excluded, excepting the SMALL_DELTA_CHI2 bit triggered by the first and second best solutions having Δχ2<9\Delta\chi^2 < 9. We further exclude SPECTYPE=GALAXY with redshift estimates z>1.6z > 1.6. Beyond this, the [O II] emission feature redshifts outside of DESI wavelength coverage, and therefore reliable galaxy classifications are not expected (e.g., [94, 79]). Finally, a high-quality VI classification is required, defined as VI_QUALITY > 2.5.

We first measure redshift recovery rate, sample completeness, and sample purity for each of DESI’s extragalactic target classes. Redshift recovery rate RR is defined as

R=N(dz<dzlimit&IS_OBJ)N(IS_OBJ)(2)R = \frac{N(dz < dz_{\mathrm{limit}} \mathbin{\&} \mathrm{IS\_OBJ})}{N(\mathrm{IS\_OBJ})} \tag*{(2)}

where IS_OBJ is either true galaxy type or true quasar type and

dz=∣zVI−zredrock∣1+zVI.(3)dz = \frac{\lvert z_{\mathrm{VI}} - z_{\mathrm{redrock}}\rvert}{1 + z_{\mathrm{VI}}}. \tag*{(3)}

For galaxies, it measures the percentage of true galaxies that receive Redrock redshift estimates with dz<0.0033dz < 0.0033 (equivalent to dv≈1000 km s−1dv \approx1000\ \mathrm{km\ s}^{-1}). For quasars, the redshift recovery rate uses dzlimit=0.01dz_{\mathrm{limit}} = 0.01 (dv≈3000 km s−1dv \approx3000\ \mathrm{km\ s}^{-1}). The relaxed criterion relative to galaxies accommodates redshift uncertainty introduced by broad emission lines (e.g., [44]).

Sample completeness CC, on the other hand, additionally requires a correct SPECTYPE assignment from Redrock.

C=N(dz<dzlimit&IS_OBJ&SPECTYPE=OBJ)N(IS_OBJ)(4)C = \frac{N(dz < dz_{\mathrm{limit}} \mathbin{\&} \mathrm{IS\_OBJ} \mathbin{\&} \mathrm{SPECTYPE} = \mathrm{OBJ})}{N(\mathrm{IS\_OBJ})} \tag*{(4)}

The sample completeness is always lower than the redshift recovery rate, due in part to the ambiguity introduced by AGN activity. This is discussed more in § 6.

Finally, sample purity PP measures the percent of SPECTYPE=GALAXY classifications that are true galaxies with dz<0.0033dz < 0.0033, and similarly for SPECTYPE=QSO with dz<0.01dz < 0.01.

P=N(dz<dzlimit&IS_OBJ&SPECTYPE=OBJ)N(SPECTYPE=OBJ)(5)P = \frac{N(dz < dz_{\mathrm{limit}} \mathbin{\&} \mathrm{IS\_OBJ} \mathbin{\&} \mathrm{SPECTYPE} = \mathrm{OBJ})}{N(\mathrm{SPECTYPE} = \mathrm{OBJ})} \tag*{(5)}

The results are summarized in Table 4.

Target ClassRedshift Recovery RateSample CompletenessSample PurityLSS Redshift Purity
BGS98.2%98.0%96.9%> 99.9%
LRG97.9%97.4%97.3%99.6%
ELG95.9%95.9%94.7%> 99.6%
QSO92.6%86.3%98%99%

Table 4. The redshift recovery rate, completeness, and purity achieved by Redrock for the primary extragalactic target classes in DESI. These metrics are measured for classifications with ZWARN = [0, 4]. Restricting to ZWARN = 0 results in slightly lower (∼1-3%) redshift recovery rates and completeness, but can improve purity (notably for ELGs). The values in the LSS Redshift Purity column are those reported by T.-W. Lan et al. [59] and D. M. Alexander et al. [6]. The LSS samples use additional quality cuts to maximize success in the redshift ranges used for cosmological analyses.

Figure 7 illustrates the dependence of purity and completeness on the DELTACHI2 parameter. As illustrated in the figure, Δχ2<9\Delta\chi^2 < 9 is an adequate threshold to generically indicate lower confidence classifications. This parameter, however, can be tuned for specific use cases as is done with the DESI large-scale structure catalogs (LSS; [4]). The LSS catalogs use optimized selection cuts for each target class to meet the scientific requirements for DESI ([1]). For example, the BGS sample uses a Δχ2>40\Delta\chi^2 > 40 and requires z<0.6z < 0.6 ([42]) while the LRG sample is defined by Δχ2>15\Delta\chi^2 > 15 and 0.4<z<1.10.4 < z < 1.1 ([94]). The ELG and QSO target classes were more difficult to optimize owing to the nature of the sources, requiring additional classifiers to construct the

Sample purity and completeness as a function of log10 Delta chi squared for each target class

Figure 7. The dependence of sample purity and completeness on Δχ2\Delta\chi^2, the difference in χ2\chi^2 between the first and second best Redrock solution, for each target class. The vertical dashed line at Δχ2=9\Delta\chi^2 = 9 indicates the threshold to trigger the SMALL_DELTA_CHI2 ZWARN bit.

LSS catalogs (see [79, 22], for complete details on these classifiers). The DESI LSS redshift purity rates are included in Table 4 for comparison to the Redrock baseline.

The random error on Redrock redshift estimates is determined by comparing the results for the same object in multiple exposures. The velocity offset between redshift pairs (i,j)(i,j) is calculated as

dvij=c(zi−zj)/(1+zj)(6)dv_{ij} = c(z_i - z_j)/(1 + z_j) \tag*{(6)}

We then use the normalized median absolute deviation (NMAD) of this distribution as an estimator for random redshift error, defined as:

NMAD=MAD×1.48282(7)\mathrm{NMAD} = \frac{\mathrm{MAD} \times1.4828}{\sqrt{2}} \tag*{(7)}

This statistic is chosen over the standard deviation because it is more robust against catastrophic failures. The velocity offset distribution for each DESI target class is shown in Figure 8, with the corresponding NMAD values annotated. ELG targets are expected to have the lowest random redshift error (8.6 km s−1^{-1}) due to their sharp emission lines, while QSOs have the largest random errors (62.7 km s−1^{-1}) due to their broad lines. All target classes exhibit non-Gaussian tails in their repeat-observation dvdv distributions.

Random redshift error distributions for DESI extragalactic target classes

Figure 8. Random redshift error measured from the distribution of redshift-pair offsets for each DESI extragalactic target class.

We next use the redshift pairs to estimate the accuracy of Redrock’s ZERR parameter. If ZERR is an accurate representation of redshift uncertainty, then the distribution of (zi−zj)/ZERRi2+ZERRj2(z_i-z_j)/\sqrt{\mathrm{ZERR}_i^2+\mathrm{ZERR}_j^2} will resemble a Gaussian with (μ,σ)=(0,1)(\mu,\sigma)=(0,1). Figure 9 shows these distributions for the four DESI extragalactic target classes. A Gaussian is fit to each of these distributions, and the standard deviation σ\sigma is annotated. The LRG and quasar samples exhibit significant tails, so we additionally fit them with a Lorentzian distribution and report the best-fit half-width at half-maximum, scaled to represent the standard deviation. The Lorentzian tails for the LRGs and QSOs are driven by pairs that both have median SNR less than 1.5, indicating the error model is less reliable in this regime.

Distributions of estimated redshift errors for DESI target classes

Figure 9. Accuracy of the estimated redshift error ZERR from Redrock for DESI’s four primary extragalactic target classes. The solid lines represent the best-fitting Gaussian functions. The dotted lines represent the best-fitting Lorentzian functions, if applicable to the given distribution.

We conclude that ZERR accurately reflects redshift uncertainty for the quasar population; however, it is under-estimated for BGS by ∼70%, and for ELGs by ∼10%. Restricting to pairs with SNR > 1.5, we find ZERR for LRGs is underestimated as well by about 65%. For comparison, BOSS underestimated galaxy errors by 20–30% and QSOs by a factor of 2 ([15]).

Finally, we use the Milky Way Survey (MWS) catalog produced by the RVSpecFit7 (RVS) software ([54] (T. S. Li et al. 2019)) to check performance on stellar spectra. In short, RVS is run on the subset of spectra in the Loa production that are suspected stellar candidates (i.e., objects with MWS targeting bits or SPECTYPE=STAR from Redrock). The output catalog contains maximum likelihood estimates of various stellar parameters, including radial velocity accurate to approximately 1 km s−1^{-1}. RVS also provides a boolean SUCCESS flag per object to indicate whether the results are reliable. Complete details on the RVS software with respect to the DESI MWS are provided by S. E. Koposov et al. [55]; A. P. Cooper et al. [26]. S. E. Koposov et al. [55] demonstrated that requiring RVS SUCCESS=True and SPECTYPE=STAR produces a relatively clean stellar sample. We use the RVS radial velocity measurements from this sample to estimate the radial velocity accuracy of the stellar templates. For each object, the offset dvraddv_{\mathrm{rad}} is computed as

dvrad=vRVS−c∗zredrock.(8)dv_{\mathrm{rad}} = v_{\mathrm{RVS}} - c * z_{\mathrm{redrock}}. \tag*{(8)}

The distribution indicates fair agreement between the two estimators, with a mean of 0.14 km s−1^{-1} and a standard deviation of 5.3 km s−1^{-1}. We do not validate other stellar parameters since the stellar templates are not intended for robust subtype classifications (§ 4.1.3). In addition, Redrock imposes a limit of ∣cz∣<600|cz| < 600 km s−1^{-1} for SPECTYPE=STAR, limiting its accuracy for high-velocity stellar targets. Owing to the detailed physical modeling employed for the MWS catalog, that catalog is recommended for scientific analyses of the DESI stellar sample.

Known Issues

Physical Constraints

PCA templates provide a way to flexibly describe a spectrum with a small number of eigenvectors that can be fit with fast linear algebra, but they can also be overly flexible and result in unphysical fits. For example, a small flux calibration offset between two spectrograph arms could be fit as an inverse 4000Å break, or a missubtracted sky line could be fit with a negative emission line. Optional archetypes and a χ2\chi^2 penalty on negative [O II] flux are current methods by which Redrock mitigates unphysical fits, but more could be done. Ongoing work includes adding support for Non-Negative Matrix Factorization (NMF) templates ([95]), improving the negative-emission line penalties, and exploring templates as an interpolation of models on a grid of physical parameters similar to the standard star fits in J. Guy et al. [41] §4.8.

Template Degrees of Freedom

As described in § 3, Redrock selects the best classification using total χ2\chi^2 without accounting for the different number of coefficients in each template set. This mildly favors the 10-coefficient galaxy templates for the default DESI template set. To quantify the impact, we re-ranked the Redrock solutions by reduced χ2\chi^2 instead of total χ2\chi^2 for a random 30% of DESI DR1 tiles. An estimated 0.3% of target spectra would receive a different SPECTYPE; however, these changes are dominated by spectra already flagged with SMALL DELTA CHI2. Among spectra with ZWARN=0, less than 0.1% would receive a different SPECTYPE. The overwhelming majority of these changes would be from GALAXY to QSO-LOZ or to a stellar subtype at effectively the same redshift.

Galaxies with AGN

The default Redrock templates do not include Active Galactic Nucleus (AGN) galaxies in their training sample. These galaxies typically have a mix of broad and narrow emission lines and thus could be fit at the same redshift by either galaxy or QSO templates and assigned to either SPECTYPE=QSO or SPECTYPE=GALAXY. Future work could expand the galaxy templates to include AGN-like broad line features, perhaps as a separate galaxy template subtype. The current lack of an AGN subtype does not pose any issues for LSS studies in DESI however since it would simply be an additional subclassification, rather than meaningfully impacting redshifts. AGN-like galaxies are predominantly assigned a correct redshift even if assigned SPECTYPE=QSO. Further, achieving high completeness for the QSO spectral type classification has proven more difficult than with galaxy spectral type [6] so the potential effect of some current SPECTYPE=QSO SUBTYPE=LOZ QSOs being instead classified as SPECTYPE=GALAXY SUBTYPE=AGN would need to be carefully assessed.

Lyman Series Optical Depth

The original default QSO templates used for the DESI Early Data Release (EDR; [31]) and the QSO-HIZ v1.0 templates used for DESI Data Release 1 (DR1; [33]) both had a mismatch with the Redrock code for how the mean Lyα\alpha absorption should be handled (in the templates vs. in the code). This led to an increasing redshift bias for QSOs at z>2z > 2 (e.g., Q. Wu & Y. Shen 2023). The average redshift bias ranged from −109±17-109 \pm17 km s−1^{-1} at z∼2z \sim2 to −358±41-358 \pm41 km s−1^{-1} at z>2.5z > 2.5 in EDR ([13]) and 9±299 \pm29 km s−1^{-1} to −84±31-84 \pm31 km s−1^{-1} in DR1 ([17]). This was corrected in the QSO-HIZ v1.1 templates used for the Loa production to be released with DESI Data Release 2. Corrected QSO redshifts using QSO-HIZ v1.1 templates are included in DESI DR1 as a “zlya” value-added catalog8 (constructed for the BAO analysis presented by [3]).

Quasar Diversity

The current QSO templates have 4 basis vectors for each of the HIZ and LOZ subtypes. This is sufficient for the primary DESI QSO sample, but does not capture the full diversity of QSOs with significant Broad Absorption Lines (BALs), highly reddened QSOs, or QSOs whose properties lie well outside of the standard SDSS/BOSS and DESI QSO target selection ([92, 47]). This could be improved by training a new set of QSO templates directly on DESI data, which would also have the added benefit of improving QSO template resolution. However, initial studies have found it surprisingly difficult to improve upon the current templates without inadvertently adding too much flexibility causing a performance degradation through false-positive fits of galaxy data. For DESI, the current Redrock QSO performance is augmented through additional QSO-specific algorithms using a neural net ([18, 36, 40]) and fitting for the Mg II emission line ([22]). These are run separately from Redrock and are used in combination with Redrock when generating the DESI QSO catalogs.

Exceptionally Narrow Emission Lines

The redshift resolution of the current galaxy templates (Table 1) corresponds to a spacing between the redshift grid points of dz=0.0007dz = 0.0007 at z=0z = 0 and dz=0.0019dz = 0.0019 at z=1.7z = 1.7. This resolution was chosen to balance performance with compute time and output file size. However, in rare instances where a spectrum exhibits only one atypically narrow emission line, this resolution is low enough that it can step over this feature. We tested a galaxy redshift grid with half the current step size, finding only a handful of cases where the solution improved while many of the changed solutions now confused sky lines for emission lines. We therefore concluded the default step size is preferred for the current DESI instrumentation and target classes. A finer grid, or one with constant steps in zz instead of steps uniform in log⁡(1+z)\log(1+z), should be considered if Redrock is used for higher-redshift galaxy classification.

Increased Catastrophic Failure Rate for z>1.5z>1.5 DESI ELGs

As galaxy redshifts increase, fewer emission lines are available for fitting until eventually only the [O II] emission line remains visible to the DESI spectrographs. At z>1.5z > 1.5, the [O II] line coincides with regions of strong sky emission and sky-subtraction residuals can persist even in high S/N spectra. These residuals impact Redrock’s ability to obtain secure redshifts for these galaxies, causing the rate of catastrophic redshifts for ELG targets to noticeably rise. §7 of [79] explores the impact of sky residuals on ELG classification in detail.

Computational Performance

Table 5 shows the runtime for processing 5000 DESI spectra (one exposure) using a GPU node on the Perlmutter system at the National Energy Research Scientific Computing Center (NERSC)9; these nodes have a 64-core AMD EPYC CPU and four NVIDIA A100 GPUs. Other GPUs, e.g., those in Apple-silicon laptops, are not currently supported, and Redrock runs in CPU-only mode on such systems. Timing numbers are shown for using just the CPU and for using the CPU and the GPUs together.10 The “Initial redshift scan” step is dramatically faster on GPUs than on CPUs. This comes at a cost of internal data structure complexity and bookkeeping moving data between the GPUs and CPUs which causes “Rescan + fit minima” step to be slower on the GPUs, though the combined results are still faster when using GPUs.

StepCPU-only [seconds]CPU+GPU [seconds]
I/O24.831.5
Rebin templates2.61.0
GPU overhead0.01.6
Initial redshift scan274.534.2
Rescan + fit minima66.7178.0
Finalize results10.612.2
Total379.2258.5

Table 5. Timing results for processing 5000 DESI spectra (one exposure) on a NERSC Perlmutter GPU node.

One exposure of processed DESI data has 2.1 GB of input coadded spectra and 1.3 GB of Redrock outputs.11 It takes less than 5 minutes to process all 5000 spectra for a DESI exposure on these GPU nodes. For the final DESI survey of ∼60\sim60 million targets, this corresponds to ∼1000\sim1000 node-hours on Perlmutter. For reference, this accounts for ∼13%\sim13\% of the node-hours required by the full pipeline from calibrations through to redshifting.

Output files

Redrock is a Python software package with experiment-agnostic algorithms, along with separate wrapper scripts for experiment-specific input and output formats. This section documents the formats output by the DESI wrapper (redrock.external.desi.rrdesi), while noting that other experiments could use the same underlying algorithms with different input and output formats (as eBOSS did in the redrock.external.rrboss wrapper).

The primary output file is a multi-HDU (header data unit) FITS format file ([77]), redrock-*.fits, summarized in Table 6. The REDSHIFTS HDU contains the Redrock classification and redshift output, while the other HDUs propagate input metadata about the targets and spectra so that the files are usefully self-contained. Further details about the REDSHIFTS HDU are listed in Table 7. Columns ZERR, ZWARN, CHI2, COEFF, NPIXELS, NCOEFF, and DELTACHI2 use more bits than necessary (int64 or float64) and may be stored as int32 or float32 in future DESI data releases.

HDU NumberNameDescription
0(not set)Empty
1REDSHIFTSBest fit classification and redshift for each input spectrum
2FIBERMAPInput target metadata, e.g. fluxes and targeting bits
3EXP_FIBERMAPExposure-specific target metadata, e.g. fiber positions on-sky
4TSNR2Template signal-to-noise ratios squared

Table 6. Format summary of the DESI-specific redrock*.fits output file. The REDSHIFTS HDU is the only new information added by Redrock; the other HDUs are propagated from the input coadded spectra files. For further details see https://desidatamodel.readthedocs.io/en/latest/DESI_SPECTRO-REDUX/SPECPROD/tiles/GROUPTYPE/TILEID/GROUPID/redrock-SPECTROGRAPH-TILEID-GROUPID.html

ColumnTypeDescription
TARGETIDint64Unique target identifier
Zfloat64Redshift
ZERRfloat64Estimated redshift error
ZWARNint64Bitmask of fit warnings; 0=good
CHI2float64χ2\chi^2 of best fit template to data
COEFFfloat64[10]PCA coefficients of best fit
NPIXELSint64Number of input pixels (wavelengths) included in fit
SPECTYPEbyte6Spectral classification
SUBTYPEbyte20Spectral subtype
NCOEFFint64Number of PCA coefficients used
DELTACHI2float64difference in χ2\chi^2 to next best fit

Table 7. Format of the REDSHIFTS binary table HDU for the DESI-specific redrock*.fits output file.

Redrock encodes warnings about the quality of the fit in the ZWARN bitmask column of the REDSHIFTS HDU of the Redrock output FITS file. Table 8 lists the bits defined in Redrock. Bits 0-9 inherit their name and meaning from SDSS (see A. S. Bolton et al. [15]), though bits 4 (MANY_OUTLIERS), 6 (NEGATIVE_EMISSION), and 8 (BAD_TARGET) are currently not implemented in Redrock.

Bit numberNameDescription
0SKYsky fiber
1LITTLE_COVERAGEtoo little wavelength coverage
2SMALL_DELTA_CHI2chi-squared of best fit is too close to that of second best
3NEGATIVE_MODELarchetype fit model is negative
4MANY_OUTLIERSUNUSED; More than 5% of data points are > 5σ5\sigma from best model fit
5Z_FITLIMITchi-squared minimum at edge of the redshift fitting range
6NEGATIVE_EMISSIONUNUSED; a QSO line exhibits negative emission
7UNPLUGGEDthe fiber was unplugged/broken, so no spectrum obtained
8BAD_TARGETUNUSED; catastrophically bad targeting data
9NODATANo data for this fiber, i.e., all input wavelengths are masked or have ivar=0
10BAD_MINFITBad parabolic fit to the χ2\chi^2 minimum
11POORDATAPoor input data quality but try fitting anyway
12-15ReservedReserved for future use by Redrock
16-23ReservedReserved for future use by experiment-specific post-Redrock processing
24-31ReservedReserved for future use by Redrock

Table 8. ZWARN bits defined by Redrock.

Bits 16–23 are reserved for experiment-specific post-Redrock processing, that is, Redrock never sets these bits, so that the ZWARN bitmask can be propagated to downstream files while setting those bits for other purposes. DESI uses these for augmenting the Redrock output with quality assurance (QA) warning flags in the “merged target list,” downstream from the Redrock output itself ([82]). Bits 12–15 and 24–31 are currently not used, but may be used for additional Redrock warning flags in the future.

More detailed outputs are available in HDF5 format12 in the rrdetails-*.h5 files, including the best 3 redshift fits per template SPECTYPE for each TARGETID (zfit/TARGETID/zfit table); and the χ2\chi^2 vs. zz per target per template SPECTYPE (zscan/SPECTYPE::SUBTYPE/zchi2 and redshifts arrays). HDF5 supports a nested hierarchy of datasets as shown in Figure 10. For example, zscan/QSO::HIZ/redshifts contains the array of redshifts scanned for the QSO HIZ template, and zscan/QSO::HIZ/zchi2[i] gives the χ2\chi^2 fit values for target targetids[i] at each of those redshifts.

Summary of the nested structure of Redrock details HDF5 files
rrdetails HDF5 file structure:
    targetids: int64 array[numtargets] of input unique target identifiers
    zscan:
        SPECTYPE or SPECTYPE:::SUBTYPE (e.g. "GALAXY" or "QSO:::HIZ"):
            redshifts: 1D array[numredshifts] of redshifts fit for this SPECTYPE
            zchi2: 2D array[numtargets,numredshifts]
                    chi2 values for this SPECTYPE and this redshift
            zcoeff: 3D array[numtargets,numredshifts,numcoeff]
                    best-fit PCA coefficients for this SPECTYPE at this redshift
            penalty: 2D array[numtargets,numredshifts]
                    chi2 penalty values
    zfit:
        TARGETID (str, not int):
            zfit: table of top 3 redshift fits per SPECTYPE for this TARGETID

Figure 10. Summary of the nested structure of Redrock details HDF5 files.

The final DESI Redrock output file rrmodel-*.fits contains the pre-rendered best-fit templates for each target. This file mimics the format of the input spectra files such that the ith row of the model data corresponds to the ith input spectrum.

Code

Redrock code is available from https://github.com/desihub/redrock using an open source BSD 3-clause license.13 Templates and Archetypes are kept in separate repositories so that they can be developed, versioned, and tagged independently of the code using them. The templates used by DESI are available at https://github.com/desihub/redrock-templates, and archetypes at https://github.com/desihub/redrock-archetypes. The DESI data processing runs for the Early Data Release used Redrock tag 0.15.4 and tem-

plates tag 0.7.2. Data Release 1 used Redrock tag 0.17.0 and templates tag 0.8. Neither used archetypes, which were still under development at the time of those data processing runs.

Redrock is written in Python, leveraging NumPy14 ([43]) and SciPy15 ([89]) for efficient compiled-code wrappers to matrix and linear algebra operations. It additionally uses Numba16 ([58]) for just-in-time (JIT) compilation of the custom trapezoidal integration used for template rebinning; prior to using Numba this step dominated the runtime. NVIDIA Graphics Processing Units (GPUs) are supported through the use of CuPy which provides a NumPy compatible API to GPU algorithms as well as JIT compilation of custom CUDA kernels. Redrock supports parallelism through Message Passing Interface (MPI) mpi4py ([27]) or with Python multiprocessing. Overall, Redrock is designed to be capable of running on a laptop with no GPU or MPI installed, while leveraging MPI and GPUs on a supercomputer for large-scale data processing.

The primary Redrock code is experiment-agnostic, with anything DESI-specific isolated to redrock.external.desi, e.g. file I/O format wrappers and interpreting what is meant by the “POORDATA” ZWARN bit (see § 8). Keeping the templates separate from the code also facilitates reusing the Redrock code with new templates optimized for different types of galaxies, e.g., DESI has explored custom templates for Lyman-α\alpha emitter (LAE) galaxies in preparation for future observing programs.

The code structure of experiment-specific wrappers on top of an experiment-agnostic toolkit, plus making the code open-source from the start, enabled Redrock to be used by eBOSS well before DESI began operations. This benefited both collaborations — eBOSS gained a redshift fitter that outperformed their default code, while at the same time they contributed improvements and real data testing that accelerated DESI’s readiness for operations.

Template file format

Redrock uses the environment variable $RR\_TEMPLATE\_DIR to define a directory containing templates to use. This is kept separate from the Redrock code itself to enable future projects to develop templates customized for their needs while still using the same Redrock code. Templates used by DESI include galaxy, QSO, and star templates. By default, Redrock will use the template files listed in templates-default.txt, though it can optionally use other files to define which templates to load, e.g., templates-fuji.txt defines the templates used in the “Fuji” production included in the DESI Early Data Release ([31]), templates-iron.txt defines the set used for DESI Data Release 1 ([33]), and templates-loa.txt defines the set used for future DESI Data Release 2.17

The templates are stored in a FITS-format ([77]) file Header Data Unit (HDU) 0 with EXTNAME=BASIS_VECTORS. The templates are a 2D array of number of templates by number of wavelengths. Header keywords CRVAL1 and CDELT1 define the starting wavelength and wavelength step, in Angstroms. If present, keyword LOGLAM=1 indicates that the wavelength grid is expressed as log⁡10(λ)\log_{10}(\lambda) instead of a linear wavelength grid. Keywords RRTYPE and RRSUBTYPE define the spectral type (classification) and subtype (blank if not applicable). Authors of new templates are strongly encouraged to include a VERSION keyword for traceability. Note that VERSION refers to the version of the individual template, not the tagged version of the Redrock code nor any tags of the redrock-templates repository.

The templates provided with Redrock follow the naming convention rrtemplate-RRTYPE-RRSUBTYPE-VERSION.fits. This allows downstream code to reconstruct the matching template name using the RRTYPE, RRSUBTYPE, and VERSION metadata in the Redrock output files, though this naming scheme is not required by the Redrock code.

Other HDUs are allowable but ignored. For example, the rrtemplate-GALAXY-None-v2.6.fits templates include a second HDU recording the coefficients of the PCA fits to the training data used to generate the 10 PCA templates in HDU 0 BASIS_VECTORS.

Conclusions

Redrock is a PCA-based spectral classifier designed for high-accuracy, automated spectral typing and redshift estimation. It is tailored to the needs of the DESI survey, but remains generic enough to be used by other spectroscopic surveys (e.g., SDSS). One of the key features of Redrock is that it efficiently leverages the full spectrum for classification, rather than relying on a specific subset of emission lines. The Redrock software package includes PCA template sets for several stellar subtypes, galaxies, and quasars. While fitting, Redrock convolves its templates with the per-spectrum resolution matrix, accurately modeling the non-Gaussian, wavelength-dependent instrumental resolution while preserving the uncorrelated error model of the data. The performance of Redrock with this template suite on a high-fidelity truth-labeled catalog of DESI spectra demonstrates its efficacy, achieving excellent redshift recovery rates for all extragalactic target classes and accurate stellar radial velocities. Redrock has proven to be an accurate, robust, and computationally efficient core component of the DESI spectroscopic pipeline, capable of classifying and fitting redshifts for the survey’s diverse target populations. Its open design allows for continuous improvement and application to future spectroscopic endeavors.

DATA AVAILABILITY

The plots in this paper are based upon data released as part of DESI Data Release 1 (DR1), except the performance analysis of § 5 which uses the forthcoming DR2. The code to reproduce the figures is available at https://github.com/desihub/redrockpaper.

ACKNOWLEDGMENTS

SB is the developer and current maintainer of the Redrock software. AB developed the default DESI QSO PCA templates and led the analysis presented in § 5. JM developed the default DESI galaxy PCA templates and conducted various efficiency studies. AA developed the DESI-based archetypes and validated the performance of Redrock’s archetype mode on DESI data. CW ported Redrock to GPUs. TK implemented the MPI parallelization. The authors thank Hélion du Mas des Bourboux for early Redrock development as part of eBOSS. JM gratefully acknowledges funding support for this work from the U.S. Department of Energy, Office of Science, Office of High Energy Physics under Award Number DE-SC0020086.

This material is based upon work supported by the U.S. Department of Energy (DOE), Office of Science, Office of High-Energy Physics, under Contract No. DE–AC02–05CH11231, and by the National Energy Research Scientific Computing Center, a DOE Office of Science User Facility under the same contract. Additional support for DESI was provided by the U.S. National Science Foundation (NSF), Division of Astronomical Sciences under Contract No. AST-0950945 to the NSF’s National Optical-Infrared Astronomy Research Laboratory; the Science and Technology Facilities Council of the United Kingdom; the Gordon and Betty Moore Foundation; the Heising-Simons Foundation; the French Alternative Energies and Atomic Energy Commission (CEA); the Secretariat of Science, Humanities, Technology and Innovation (SECHTI) of Mexico; the Ministry of Science, Innovation and Universities of Spain (MICIU/AEI/10.13039/501100011033), and by the DESI Member Institutions: https://www.desi.lbl.gov/collaborating-institutions. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the U. S. National Science Foundation, the U. S. Department of Energy, or any of the listed funding agencies.

The authors are honored to be permitted to conduct scientific research on I’​​oligam Du’ag (Kitt Peak), a mountain with particular significance to the Tohono O’odham Nation.

Facility: Mayall (DESI)

Software: iSEDfit (J. Moustakas [67]), NumPy (C. R. Harris et al. [43]), SciPy (P. Virtanen et al. [89]), Numba (S. K. Lam et al. [58]), mpi4py (L. Dalcin et al. [27]), cupy (R. Okuta et al. [75]), astropy (Astropy Collaboration et al. [9, 10, 11]), Matplotlib (J. D. Hunter [45]), seaborn (M. Waskom [90])

Galaxy Basis Templates

DESI observes galaxy targets spanning a broad range of redshifts and intrinsic spectral properties, making it essential that our galaxy templates represent this diversity (J. Moustakas et al. 2026, in preparation). BGS (C. Hahn et al. [42]) targets a magnitude-limited sample at 0≲z≲0.60 \lesssim z \lesssim0.6 that encompasses the full range of galaxy spectral types, from massive quiescent systems with old stellar populations to actively star-forming galaxies with young stellar populations and strong emission lines. LRG (R. Zhou et al. [94]) targets at 0.4≲z≲1.10.4 \lesssim z \lesssim1.1 are predominantly old, metal-rich galaxies exhibiting a prominent 4000-Å break and little ongoing star formation. And ELG (A. Raichoor et al. [79]) targets at 0.6≲z≲1.60.6 \lesssim z \lesssim1.6 are actively star-forming galaxies characterized by strong, high-equivalent-width nebular emission lines, particularly the [O II] λλ3726\lambda\lambda3726, 29 doublet.

To represent this diversity in galaxy type and astrophysical properties, our strategy is to construct a large parent sample of basis templates grounded in observations of real galaxies. The AGN and Galaxy Evolution Survey (AGES; [51]) provides the BGS training sample at 0≲z≲0.750 \lesssim z \lesssim0.75; the Deep Extragalactic Evolutionary Probe 2 (DEEP2; [74]) provides the ELG training sample at 0.75≲z≲1.450.75 \lesssim z \lesssim1.45; and a photometric and spectroscopic compilation of color-selected galaxies from the DESI Legacy Imaging Surveys Data Release 7 (Legacy Surveys DR7; [34]) provides the LRG training sample at 0.2≲z≲1.20.2 \lesssim z \lesssim1.2.18

We generate the basis templates using a data-driven approach. We start by modeling each object’s available broadband photometry (at its spectroscopic redshift) using stellar population synthesis (SPS) models. SPS models yield a model of the stellar continuum at high spectral resolution (R≈10,000R \approx10{,}000), without the instrumental effects of each original survey, and over a broad range of rest-frame wavelength (0.10.1–6 μm6\ \mu\mathrm{m}) extending well beyond what survey spectroscopy alone provides. Then, we use empirical correlations between observed nebular line ratios and the 4000-Å break, Dn(4000)D_n(4000) (the ratio of the mean flux density FνF_\nu in the 4000–4100 Å and 3850–3950 Å rest-frame windows), to tie this continuum model to an inferred emission-line spectrum, yielding a semi-empirical description of each galaxy’s full spectral energy distribution. This semi-empirical treatment of the emission lines avoids having to predict line strengths from first-principles photoionization modeling, which remains highly uncertain, particularly for forbidden-line ratios.

In §A.1 we describe this approach in more detail as well as the SPS and emission-line modeling common to all three template sets, and in §§A.2, A.3, and A.4 we describe the specific construction of the BGS, ELG, and LRG basis templates, respectively.

Stellar Continuum and Emission-Line Modeling

The rest-frame UV/optical spectral energy distributions of galaxies consist of two principal components: a stellar continuum arising from the galaxy’s composite stellar population, which encodes its star formation and chemical evolution history, and a series of narrow emission lines produced in H II regions—T≈104 KT \approx10^{4}\ \mathrm{K} gas photoionized by hot, young stars ([49, 23, 50]). Galaxies with no ongoing star formation produce pure stellar continua, while actively star-forming galaxies can exhibit emission-line equivalent widths of hundreds to thousands of Angstroms. In addition, dust grains attenuate both components by wavelength-dependent amounts ([23], and references therein).

For all three template sets, we model the stellar continuum of each training galaxy using the iSEDfit Bayesian spectral energy distribution (SED) fitting code ([72, 67]).19 We build simple stellar populations (SSPs) from the theoretical C3K stellar library (CKC14; C. Conroy 2014, private communication; see also [24]), Padova stellar evolution isochrones ([39, 63]), and a P. Kroupa [57] initial mass function (IMF) spanning 0.10.1–100 M⊙100\ M_\odot. We allow the stellar metallicity to range from Z=0.004Z = 0.004 to 0.030.03 (20%–160% solar). The spectral coverage of these models spans 0.10.1–1000 μm1000\ \mu\mathrm{m} at a resolution of R=10,000R = 10{,}000 between 0.150.15 and 1 μm1\ \mu\mathrm{m}—more than twice the maximum instrumental resolution of the DESI spectrographs ([41, 1])—ensuring that the models can be convolved to match any instrumental line spread function without loss of information. To model the dust attenuation, we use the simple [21] dust law, τ(λ)∝(λ/5500 A˚)−n\tau(\lambda) \propto(\lambda/5500\ \text{Å})^{-n}, where τ(λ)\tau(\lambda) is the wavelength-dependent optical depth and we take n=0.7n = 0.7.

For the BGS and ELG samples, we parameterize each galaxy’s star formation history (SFH) as an exponentially declining τ\tau-model, ψ∝e−t/τ\psi\propto e^{-t/\tau}, supplemented by stochastic, constant star formation bursts of varying duration and burst fraction. We generate 30,000 Monte Carlo realizations of the model parameters spanning ages t∈[0.1,12.5] Gyrt \in[0.1, 12.5]\ \mathrm{Gyr}, e-folding times τ∈[0,10] Gyr\tau\in[0, 10]\ \mathrm{Gyr}, and assuming a 20% burst probability. For the LRG training sample, which predominantly consists of quiescent galaxies dominated by evolved stellar populations, we adopt a delayed-τ\tau SFH, ψ∝te−t/τ\psi\propto te^{-t/\tau}, t∈[1.0,11.05] Gyrt \in[1.0, 11.05]\ \mathrm{Gyr}, τ∈[0,6] Gyr\tau\in[0, 6]\ \mathrm{Gyr}, and no burst component. The maximum-likelihood SED model for each galaxy yields its rest-frame stellar continuum spectrum at R=10,000R = 10{,}000, normalized to 1 M⊙1\ M_\odot at 10 pc.

Figure 11 summarizes the distributions of four physical properties—redshift, Dn(4000)D_n(4000), stellar mass, and dust optical depth τV\tau_V—across all three basis template sets, illustrating the complementary physical parameter space each class occupies.

Distributions of redshift, $D_n(4000)$, stellar mass, and dust attenuation for BGS, ELG, and LRG basis templates

Figure 11. Distributions of four physical properties for the BGS (green), ELG (blue), and LRG (orange) basis templates, derived from Bayesian SED modeling of the respective training samples (see §§A.2–A.4). The three classes of objects occupy complementary regions of parameter space: BGS spans the full range of stellar populations and dust content at low redshift; ELGs are young, low-mass, moderately dusty star-forming galaxies at intermediate redshift; and LRGs are massive, evolved, nearly dust-free galaxies at z≈0.2z \approx0.2–1.11.1.

Next, we construct the integrated emission-line spectrum of each object. Generating physically realistic emission-line spectra—across the full rest-frame optical through near-infrared wavelength range—is considerably more challenging to do from first principles alone. The absolute and relative emission-line strengths depend on the complex interplay between ionizing photon production, gas-phase abundance, excitation conditions in the gas, and geometry, which are difficult to infer even for individual H II regions [85, 19]. We therefore use an empirical approach in which we measure the primary emission-line anchor for each template class—HβH\beta for BGS and [O II][\mathrm{O\,II}] for ELGs—directly from the observed spectrum of the training galaxy and then build the rest of the emission-line spectrum using relations calibrated on local star-forming galaxies and H II regions.

The strongest forbidden lines in the optical are [O II] λλ3726,29[\mathrm{O\,II}]\,\lambda\lambda3726,29, [N II] λλ6548,84[\mathrm{N\,II}]\,\lambda\lambda6548,84, and [S II] λλ6716,31[\mathrm{S\,II}]\,\lambda\lambda6716,31, whose strengths relative to HβH\beta (and to one another) vary significantly with [O III] λλ4959,5007/Hβ[\mathrm{O\,III}]\,\lambda\lambda4959,5007/H\beta. Moreover, the [O III][\mathrm{O\,III}] doublet is itself sensitive to gas-phase abundance and excitation. To quantify these variations, we assemble a dataset of 619 extragalactic H II regions (J. Moustakas et al. [70]), 188 integrated galaxy spectra (807 objects total; [68, 69]), and ≈ 10510^5 galaxies from the SDSS ([16, 87]), and present the observed line-ratio distributions in Figure 12.

Observed forbidden emission-line ratios relative to Hβ

Figure 12. Observed forbidden emission-line ratios relative to Hβ, used to calibrate the six-component GMM. Each panel shows a different line ratio versus log⁡10([O III] λ5007/Hβ)\log_{10}([\mathrm{O\,III}]\,\lambda5007/\mathrm{H}\beta): SDSS contours (gray; [16, 87]), extragalactic H II regions (orange squares; [70]), and integrated galaxy spectra of low-redshift star-forming galaxies (green circles; [68, 69]). Only the H II region and integrated spectral atlas data (807 objects total) enter the GMM fit; we show the SDSS contours for context only. The GMM assigns the fluxes of these four forbidden lines to the BGS and ELG basis templates (§§A.2 and A.3).

To model the four-dimensional distribution of log⁡10([O III] λ5007/Hβ)\log_{10}([\mathrm{O\,III}]\,\lambda5007/\mathrm{H}\beta), log⁡10([O II] λ3727/Hβ)\log_{10}([\mathrm{O\,II}]\,\lambda3727/\mathrm{H}\beta), log⁡10([N II] λ6584/Hβ)\log_{10}([\mathrm{N\,II}]\,\lambda6584/\mathrm{H}\beta), and log⁡10([S II] λ6716/Hβ)\log_{10}([\mathrm{S\,II}]\,\lambda6716/\mathrm{H}\beta), we use a multi-component Gaussian mixture model (GMM) fitted to just the H II region and integrated galaxy spectra. We use the Bayesian information criterion (BIC) to determine the number of GMM components needed to explain the data without overfitting, eventually settling on N=6N = 6 components.

With the GMM covariance matrices in hand, we proceed to construct each galaxy’s full emission-line spectrum using the following procedure. First, we set the absolute strength of each galaxy’s “anchor line” by multiplying the spectroscopically measured rest-frame equivalent width by the continuum flux density at the anchor wavelength predicted by that object’s best-fitting SED model. The anchor line for BGS and ELG targets is Hβ\beta and [O II], respectively, both of which we measure for all AGES and DEEP2 spectra used in our analysis (see §§A.2 and A.3). This measured equivalent width also correlates with the 4000-Å spectral break strength Dn(4000)D_n(4000), which traces the age of the stellar population (Figure 13); we calibrate this relationship separately for each training sample in §§A.2 and A.3, and use it in §A.5 to generate Monte Carlo realizations of the basis templates.

Rest-frame emission-line equivalent width versus $D_n(4000)$ break strength for the BGS and ELG training samples

Figure 13. Rest-frame emission-line equivalent width (EW) versus Dn(4000)D_n(4000) break strength for the BGS and ELG training samples. (aa): EW(Hβ\beta) for the BGS training sample from AGES; green circles are Hβ\beta-detected objects and purple triangles are 1σ1\sigma upper limits. (bb): EW([O II] λλ3726\lambda\lambda3726, 29) for the ELG training sample from DEEP2; blue circles are the full sample and orange squares are the subset satisfying DESI ELG target-selection color cuts (A. Raichoor et al. [79]). In each panel the solid curve shows the best-fit second-order polynomial (Equations (9) and (10)), and dashed curves show the ±1σ\pm1\sigma intrinsic scatter.

Next, we use the empirically calibrated GMM to draw a random realization of the four forbidden-to-Hβ\beta line ratios, [O III] λ5007\lambda5007, [O II] λ3726,29\lambda3726,29, [N II] λ6584\lambda6584, and [S II] λ6716\lambda6716. Because the GMM retains the full covariance of the training data, each realization preserves the physical correlations among the lines.

We then utilize the expected doublet ratio for each of these four lines. Atomic transition probabilities fix the [O III] λ5007\lambda5007/[O III] λ4959\lambda4959 and [N II] λ6584\lambda6584/[N II] λ6548\lambda6548 ratios at 2.8875 and 2.93579, respectively. The [O II] λ3726\lambda3726/[O II] λ3729\lambda3729 and [S II] λ6716\lambda6716/[S II] λ6731\lambda6731 doublets, by contrast, are density-sensitive, but we fix them to a representative value characteristic of the low-density limit—0.73 for [O II] and 1.3 for [S II]—appropriate for the low-density H II-region gas that dominates the nebular emission in our training samples.

The templates also include three additional (albeit weak) forbidden doublets—[O I] λλ6300,63\lambda\lambda6300,63, [S III] λλ9069,9532\lambda\lambda9069,9532, and [Ar III] λλ7135,7751\lambda\lambda7135,7751, six lines in all—that lie beyond the four line ratios modeled by the GMM; for simplicity, we instead fix the overall strength of each doublet to a representative ratio relative to Hβ\beta (R. Kotulla et al. [56]). As before, we assume, for simplicity, fixed doublet ratios given by atomic transition probabilities: [O I] λ6300\lambda6300/[O I] λ6363\lambda6363 (3.03502), [S III] λ9532\lambda9532/[S III] λ9069\lambda9069 (2.4686), and [Ar III] λ7135\lambda7135/[Ar III] λ7751\lambda7751 (4.16988).

Finally, we compute the strength of the hydrogen and helium recombination lines (Hα\alpha, Hγ\gamma, Hδ\delta, He I, and others; see Table 9, all scaled by the Hβ\beta line-strength, using standard Case B recombination ratios assuming a He/H abundance ratio of 0.0897 ([76, 56]).

Recombination LineVacuum Wavelength (Å)Relative Flux
Lyα\alpha1215.67023.54656
Hα\alpha6564.6132.863158
Hβ\beta4862.6831.000000
Hγ\gamma4341.6840.4683401
Hδ\delta4102.8920.2589474
Hϵ\epsilon3971.1950.1590283
H63890.1510.1050202
H73836.4720.07312550
H83798.9760.05302830
H93771.7010.03971660
H103751.2170.03053440
H113735.4300.02399190
H123722.9970.01920650
H133713.0270.01561130
H143704.9060.01286640
H153698.2040.01073680
H163692.6050.009052600
Paα\alpha18756.130.3386235
Paβ\beta12821.590.1632389
Paγ\gamma10941.090.09044530
Paδ\delta10052.130.05545750
Paϵ\epsilon9548.5910.03656680
Pa99231.5470.02543320
Pa109017.3850.01842910
Pa118865.2170.01378950
Pa128752.8760.01059920
Brα\alpha40522.620.08021050
Brβ\beta26258.670.04546560
Brγ\gamma21661.200.02781380
Brδ\delta19450.870.01825910
He I λ\lambda31883188.6620.04076080
He I λ\lambda38893889.7520.1027011
He I λ\lambda39653965.8520.01022650
He I λ\lambda40264027.3480.02115760
He I λ\lambda44714472.7550.04445050
He I λ\lambda49224923.3040.01199870
He I λ\lambda50165017.0790.02568980
He I λ\lambda58765877.2990.1186800
He I λ\lambda66786679.9940.03360660
He I λ\lambda70657067.1980.02173860
He I λ\lambda1083010833.220.2404832
Recombination LineVacuum Wavelength (Å)Relative Flux

Table 9. Emission Lines. Table 9 continued.

We model each of these emission lines as a single Gaussian centered on its rest-frame vacuum wavelength, so the lines share the systemic redshift of the stellar continuum, with no relative velocity offsets, asymmetries, or broad components. All the lines in a given spectrum have the same intrinsic velocity width (§A.5).

The following three sections apply this shared SPS and emission-line framework to each target class in turn, describing the training sample, selection cuts, and template-specific calibrations we use to construct the BGS, ELG, and LRG basis templates.

BGS Basis Templates

We construct the BGS basis templates from AGES, which obtained intermediate-resolution optical spectroscopy of an IAB<20.45I_{\mathrm{AB}} < 20.45 magnitude-limited sample of ≈11,000\approx11{,}000 galaxies at 0≲z≲0.80 \lesssim z \lesssim0.8 over ≈8\approx8 deg2^2 using the Hectospec multi-fiber spectrograph on the MMT. The AGES spectra span approximately 3700–9200 Å at R≈1000R \approx1000 (1.2 Å pixel−1^{-1}), providing access to Hβ\beta throughout the full survey redshift range. Each galaxy has aperture-matched broadband UBWRIzJHKsUBWRIzJHK_s photometry, unWISE W1 and W2 forced-photometry at 3.4 and 4.6 μ\mum (D. Lang et al. [60])20, and a statistical weight correcting for photometric, targeting, and redshift incompleteness. We measure emission-line fluxes and equivalent widths for the full AGES sample, including Hβ\beta, Hα\alpha, and the principal forbidden lines, using the spectral-fitting methods described in J. Moustakas et al. [70, 71].

From the full AGES catalog, we select the BGS training sample by applying the following cuts:

  • 0.05<z<0.750.05 < z < 0.75;

  • INDWFS<20.4I_{\mathrm{NDWFS}} < 20.4 (AB, extinction-corrected); and

  • photometric detections in at least six broadband filters.

In Figure 13a we show the correlation between EW(Hβ\beta) and Dn(4000)D_n(4000) for this sample of 7636 galaxies. The filled

green circles show the 4187 objects (55%) where Hβ\beta is detected with S/N >3> 3 and rest-frame EW(Hβ\beta) >1> 1 Å, while the open purple triangles show the remaining 3449 galaxies (45%) where Hβ\beta is an upper limit. For the subset of objects where Hβ\beta is well-detected, we fit the correlation with a second-order polynomial,

log⁡10EW⁡(Hβ)=∑i=02aiDn(4000)i(9)\log_{10} \operatorname{EW}(\mathrm{H}\beta) = \sum_{i=0}^{2} a_i D_n(4000)^i \tag*{(9)}

where a={1.28520974,−4.94408026,4.9617704}\mathbf{a} = \{1.28520974,-4.94408026,4.9617704\} with a scatter of approximately 0.2 dex. In §A.5 we describe how we use this fit to generate Monte Carlo template realizations of BGS-like templates.

Finally, we use the methodology described in §A.1 to construct a complete high-resolution SED of each object, using Hβ\beta (where it is well-detected) as the anchor line we use to generate the emission-line spectrum. The resulting 7636 BGS basis templates span 0.1–6 μ\mum at R≈10,000R \approx10{,}000 and a pixel size of 50 km s−1^{-1}. These templates are publicly released as bgs_templates_v2.3.fits.

ELG Basis Templates

We construct the ELG basis templates from DEEP2/DR4 (J. A. Newman et al. [74]), which obtained high-resolution optical spectroscopy of more than 50,000 galaxies using the DEIMOS multi-object spectrograph on the Keck 2 telescope. The spectra span approximately 6500–9300 Å at R≈6000R \approx6000 (0.33 Å pixel−1^{-1}), fully resolving the [O II] λλ3726,29\lambda\lambda3726,29 doublet for galaxies at z≈0.7z \approx0.7–1.4. From the public DR4 catalog, we select 35,682 galaxies with high-quality redshifts (Q≥3Q \ge3; J. A. Newman et al. [74]) and well-calibrated one-dimensional spectra. We assemble a photometric catalog for each galaxy by matching to the extended photometric catalog of D. J. Matthews et al. [64], which provides BRIBRI photometry and ugrizugriz photometry from the CFHTLS surveys (DEEP2 Field 1) or SDSS (Fields 2–4), and add WISE W1 and W2 photometry from unWISE forced-photometry measurements at the positions of DEEP2 sources brighter than R=24.1R = 24.1 (D. Lang et al. [60]).

We model the broadband photometry with iSEDfit (§A.1), fitting Field 1 and Fields 2–4 with appropriate filter transmission curves but otherwise identical

SPS modeling priors. We measure emission-line fluxes and equivalent widths using the spectral-fitting methods of J. Moustakas et al. [70, 71], fixing the [O II] λ3726/λ3729\lambda3726/\lambda3729 flux ratio to its measured median value of 0.73. We consider an emission line detected if its amplitude exceeds 1.5 times the local continuum rms; otherwise we record a 1σ1\sigma upper limit. However, because the DEEP2 spectra are only approximately flux-calibrated, we derive the integrated [O II] flux for each galaxy following G. Zhu et al. [97], multiplying the rest-frame equivalent width from the spectral fit by the continuum flux density at 3727 Å estimated from the best-fitting iSEDfit SED model.

From the full DEEP2 catalog, we select the ELG training sample by applying the following cuts:

  • 0.75<z<1.450.75 < z < 1.45;

  • rCFHTLS<23.5r_{\mathrm{CFHTLS}} < 23.5 (AB, extinction-corrected);

  • SED-fitting χ2<40\chi^2 < 40 with photometric detections in at least six broadband filters;

  • [O II] doublet detected with S/N >3> 3; and

  • EW([O II] λλ3726\lambda\lambda3726, 29) >1> 1 Å.

These cuts result in a sample of 7,735 galaxies. In Figure 13b we show the relationship between EW([O II]) and Dn(4000)D_n(4000) for this sample (filled blue circles) and, for reference, the subset of objects which satisfy the DESI ELG color-cuts (A. Raichoor et al. [79]). As for the BGS training sample, we fit the relationship with a second-order polynomial,

log⁡10EW([O II] λλ3726,29)=∑i=02biDn(4000)i(10)\log_{10}\mathrm{EW}([\mathrm{O\ II}]\ \lambda\lambda3726,29)=\sum_{i=0}^{2}b_iD_n(4000)^i \tag*{(10)}

where b={1.34323087,−5.02866474,5.43842874}\mathbf{b}=\{1.34323087,-5.02866474,5.43842874\}, with an intrinsic scatter of approximately 0.3 dex. §A.5 describes how we use this fit to generate Monte Carlo template realizations.

Finally, we generate the full integrated stellar continuum and emission-line spectrum for every galaxy using the methodology described in §A.1 with [O II] as our anchor emission line. The resulting 7,735 ELG basis templates share the same wavelength grid as the BGS templates: 0.05–6 μ\mum at R≈10,000\mathcal{R}\approx10{,}000 and 50 km s−1^{-1} pixels. These templates are publicly released as elg-templates_v2.2.fits.

LRG Basis Templates

We construct the LRG basis templates from a spectroscopic compilation of galaxies assembled to be statistically representative of the photometric LRG population targeted by DESI (R. Zhou et al. [94]). We begin by selecting 111,114 DESI-like LRGs at 0.2≲z≲1.20.2 \lesssim z \lesssim1.2 using the Legacy Surveys DR7 grzW1W2grzW1W2 photometry and the R. Zhou et al. [93] photometric redshift catalog. We cross-match this sample against a wide range of public spectroscopic catalogs from SDSS, (e)BOSS, AGES, DEEP2, GAMA, OzDES, VIPERS, VVDS, and COSMOS to identify 75,315 LRGs satisfying the following requirements:

  • 0.2<z<1.20.2 < z < 1.2;

  • at least three observations in each of the gg, rr, and zz bands (nobsgrz≥3n_{\mathrm{obs}_{grz}} \ge3);

  • measured flux in all five grzW1W2grzW1W2 bands.

  • not flagged as a WISE artifact or lying near a bright star (wisemask = brightstarinblob = False); and

Because this spectroscopic sample is not uniform across the sky, we assign each object a statistical weight proportional to the number of photometric LRG candidates within its neighborhood in the joint space of redshift, apparent magnitude, and observed color. This weight ensures that the final template set statistically mirrors the photometric parent population of >3.3> 3.3 million LRGs with precise photometric redshifts (R. Zhou et al. [93]).

We model the grzW1W2grzW1W2 photometry at the spectroscopic redshift with iSEDfit (§A.1), adopting the delayed-τ\tau star-formation history appropriate for this predominantly quiescent population. We do not include emission lines in this sample, even though a small fraction of LRGs are expected to exhibit weak line-emission typically due to residual star formation (e.g., G. Zhu et al. [96]). From the fitted sample, we select 3,000 basis templates via a probability-weighted random draw, in which each galaxy is selected with probability proportional to its statistical weight; this method preferentially samples galaxies that best represent the photometric LRG population while maintaining diversity across the full parameter space of the spectroscopic training set.

The resulting 3,000 LRG basis templates share the same wavelength grid as the BGS and ELG templates: 0.05–6 μ\mum at R≈10,000\mathcal{R} \approx10{,}000 and 50 km s−1^{-1} pixels. These templates are publicly released as lrg-templates_v2.2.fits.

Monte Carlo Template Realizations

The basis templates described in this appendix represent a fixed, discrete set of real training galaxies. To build the larger, continuous ensemble of synthetic spectra needed to derive the final galaxy PCA templates (§ 4.1.1)—10,000 ELG, 5,000 LRG, and 5,000 BGS realizations—we use the BGS, ELG, and LRG classes of the desisim software package,21 each of which subclasses a common GALAXY base class and exposes a make_templates() method for generating any number of Monte Carlo realizations from a single input random seed.

For each realization, make_templates() draws a random redshift and apparent magnitude from class-specific ranges, then randomly selects one of the basis-template continua from §§A.2–A.4. For BGS and ELG targets, it also draws a new synthetic anchor-line equivalent width from the calibrated Dn(4000)D_n(4000) relation (Figure 13) and its intrinsic scatter, together with a new realization of the four forbidden-to-Hβ\beta line ratios from the GMM described in §A.1. Both draws are independent of the values used for the parent basis template, decoupling the number of Monte Carlo emission-line realizations from the fixed number of underlying continua. For a BGS realization built from an Hβ\beta upper-limit basis template (§A.2), this synthetic equivalent width is instead set to zero, so the realization retains the parent galaxy’s stellar continuum without injected emission lines. LRG templates skip the emission-line draw entirely, since the LRG basis templates contain no emission lines. Each realization also draws a velocity dispersion uniformly from 50–150 km s−1^{-1} (ELG), 120–300 km s−1^{-1} (BGS), or 150–300 km s−1^{-1} (LRG), which sets the width of every emission line and broadens the stellar continuum. make_templates() then assembles the resulting spectrum, optionally applies the target class’s DESI selection color-cuts, and repeats the process until it produces the requested number of passing models. A single input seed fully determines every random draw, making the realizations fully reproducible.

Intrinsic velocity shifts of quasar emission lines

The non-uniform velocity shifts of quasar emission lines relative to their host galaxy are a notorious limitation to redshift accuracy. Owing to the finite number of principal components, a set of PCA quasar templates cannot fully capture the diversity of outflow properties (and thus emission line profiles) present in the DESI spectroscopic sample. Further, because of their empirical nature, the templates will incorporate any redshift biases present in the training sample.

The quasar templates used in this manuscript were derived from the SDSS Data Release 16 quasar catalog (DR16Q; B. W. Lyke et al. [62]). The redshift biases of this sample were mitigated by correcting individual spectra to the measured Mg II restframe (A. Brodzeller et al. [17]), chosen for its relative stability compared with other quasar emission lines (e.g., Y. Shen et al. [83]; P. C. Hewett & V. Wild [44]) and visibility over a wide redshift range. This line, however, is not a perfect indicator of systemic redshift, often exhibiting a velocity shift on the order of tens of km s−1^{-1}. This appendix explores the accuracy of quasar redshift estimates obtained with these templates for DESI through a spectral stacking analysis.

We use spectral stacking to enhance the signal-to-noise of weak features associated with quasar host galaxies, such as [O II] and Ca II K. The offset of these features relative to the expectation in the absence of redshift error estimates the average redshift accuracy for the stacked sample. We also measure the offset of the quasar emission lines Mg II and C IV, since at z≳1.5z \gtrsim1.5 only broad lines are observable, thus these drive the redshift estimates. The offsets for these two features cannot be used directly as estimators of accuracy, however, because they incorporate an intrinsic velocity shift from the systemic redshift. Instead, we use Mg II’s average offset from Ca II K as an estimate for the average outflow velocity for Mg II, and use that to extrapolate the average redshift accuracy at higher redshifts when galaxy features are no longer visible. We include C IV only to illustrate the complex quasar dynamics that challenge template redshift estimation, particularly at high redshifts.

We use the DR2 Lyα\alpha quasar catalog ([3]), which incorporates information from the quasar afterburner algorithms to reduce catastrophic failures caused by line confusion (see E. Chaussidon et al. [22]). Although additional algorithms are used to construct this catalog, all final redshifts come from Redrock. We exclude known BAL quasars ([37]), since this sub-class introduces additional redshift uncertainties unrelated to the PCA template bias and outflow velocities within the sample (e.g., [38]).

We bin the quasar catalog on Δz=0.1\Delta z = 0.1 over 0.35<z<3.50.35 < z < 3.5, and compute the error-weighted mean spectrum of each bin after shifting the individual spectra to the Redrock rest-frame solution. We fit the mean spectra in the regions of the Ca II K, [O II], Mg II, and C IV emission lines (absorption line in the case of Ca II K), if visible for the given redshift bin. The fit to each line consists of a power-law to describe the underlying continuum plus a multi-component Gaussian for the line. The fits are visually inspected to confirm quality, and the number of Gaussians is fixed to one for Ca II K and [O II], and two for Mg II and C IV.

We measure the average velocity offset of each line from its expected rest-frame wavelength in the absence of redshift errors — and absence of intrinsic shifts in the case of broad lines — in two ways. First, using the difference between the centroid of the narrow Gaussian and the vacuum wavelength (Table 10), and then using the location of the peak flux of the emission line model described in the previous paragraph. The results are shown in Figure 14. The two methods yield consistent

Average velocity offset of prominent emission lines

Figure 14. Average velocity offset of prominent emission lines relative to the Redrock redshift estimates in various redshift bins as measured by the line centroid (markers) and the location of the line’s peak flux (line). The grey-shaded region indicates the overlap between the LOZ and HIZ quasar templates, where either template set can provide the best-fit redshift solution.

LineVacuum Wavelength [Å]
Ca II K3934.78
[O II]3728.48
Mg II2798.75
C IV1549.06

Table 10. The vacuum rest-frame wavelength used for calculating line offsets in Appendix § 12, taken from D. E. Vanden Berk et al. [88].

tent results for the galaxy features and are within ∼15 km s−1^{-1} for Mg II.

For the following discussion, we assume Ca II K to be a reliable indicator of true redshift. That is, the velocity offset measured for Ca II K can be entirely attributed to redshift errors — a reasonable assumption given that it originates from stellar absorption. With this in mind, the LOZ quasar templates (0<z<1.60 < z < 1.6) display a consistent bias of roughly −75 km s−1^{-1}. In other words, redshifts are overestimated by this magnitude on average with the LOZ quasar templates. This is unsurprising, given that Mg II was the preferred rest-frame for the templates’ parent sample. The preferred rest frame is further illustrated by the near-zero velocity offset of Mg II across the full LOZ redshift range. Informed by this study, a new version of the LOZ templates (v1.1) was produced for future DESI data releases, in which a positive velocity shift was applied to the wavelength grid, making Ca II K more consistent with a zero velocity offset.

The transition from LOZ to HIZ is apparent in Figure 14 with a clear shift in bias level. At z≳1.5z \gtrsim1.5, prominent emission features of the host galaxy are redshifted beyond the wavelength coverage of the DESI spectrograph. Thus, Redrock must rely on sufficient flexibility in the quasar templates to accommodate emission-line diversity while anchoring to the systemic redshift. If the difference between the velocity offset of Mg II and that of Ca II K is roughly constant for the sample (∼75 km s−1\sim75\ \mathrm{km\ s^{-1}}), this implies excellent average accuracy for HIZ redshifts.

We note that there is still relatively large scatter in redshift error (Figure 8), but the average redshift inaccuracy is expected to be rather small. This is supported by the analysis from A. Bault et al. [13] who reported an average redshift inaccuracy for DESI quasars consistent with zero at −8±42 km s−1-8 \pm42\ \mathrm{km\ s^{-1}} at z>2z > 2 with these HIZ templates through cross-correlation with the Lyα\alpha forest (their Figure 9).

References

  1. [1]Abareshi, B., Aguilar, J., Ahlen, S., et al. 2022, AJ, 164, 207. https://arxiv.org/abs/2205.10939
  2. [3]Abdul Karim, M., Aguilar, J., Ahlen, S., et al. 2025b, PhRvD, 112, 083514, doi: 10.1103/2wwn-xjm5
  3. [4]Adame, A. G., Aguilar, J., Ahlen, S., et al. 2025a, JCAP, 2025, 017, doi: 10.1088/1475-7516/2025/07/017DOI
  4. [6]Alexander, D. M., Davis, T. M., Chaussidon, E., et al. 2023, AJ, 165, 124, doi: 10.3847/1538-3881/acacfcDOI
  5. [7]Allende Prieto, C., Koesterke, L., Hubeny, I., et al. 2018, A&A, 618, A25, doi: 10.1051/0004-6361/201732484DOI
  6. [8]Anand, A., Guy, J., Bailey, S., et al. 2024, The Astronomical Journal, 168, 124, doi: 10.3847/1538-3881/ad60c2DOI
  7. [9]Astropy Collaboration, Robitaille, T. P., Tollerud, E. J., et al. 2013, A&A, 558, A33, doi: 10.1051/0004-6361/201322068
  8. [10]Astropy Collaboration, Price-Whelan, A. M., Sipócz, B. M., et al. 2018, AJ, 156, 123, doi: 10.3847/1538-3881/aabc4f
  9. [11]Astropy Collaboration, Price-Whelan, A. M., Lim, P. L., et al. 2022, ApJ, 935, 167, doi: 10.3847/1538-4357/ac7c74DOI
  10. [12]Bailey, S. 2012, PASP, 124, 1015, doi: 10.1086/668105DOI
  11. [13]Bault, A., Kirkby, D., Guy, J., et al. 2024, arXiv e-prints, arXiv:2402.18009. https://arxiv.org/abs/2402.18009
  12. [14]Bolton, A. S., & Schlegel, D. J. 2010, PASP, 122, 248, doi: 10.1086/651008DOI
  13. [15]Bolton, A. S., Schlegel, D. J., Aubourg, É., et al. 2012, AJ, 144, 144, doi: 10.1088/0004-6256/144/5/144DOI
  14. [16]Brinchmann, J., Charlot, S., White, S. D. M., et al. 2004, MNRAS, 351, 1151
  15. [17]Brodzeller, A., Dawson, K., Bailey, S., et al. 2023, The Astronomical Journal, 166, 66, doi: 10.3847/1538-3881/ace35dDOI
  16. [18]Busca, N., & Balland, C. 2018, arXiv e-prints, arXiv:1808.09955. https://arxiv.org/abs/1808.09955
  17. [19]Byler, N., Dalcanton, J. J., Conroy, C., & Johnson, B. D. 2017, ApJ, 840, 44. https://arxiv.org/abs/1611.08305
  18. [20]Calura, F., Tescari, E., D’Odorico, V., et al. 2012, MNRAS, 422, 3019, doi: 10.1111/j.1365-2966.2012.20811.xDOI
  19. [21]Charlot, S., & Fall, S. M. 2000, ApJ, 539, 718
  20. [22]Chaussidon, E., Yèche, C., Palanque-Delabrouille, N., et al. 2023, ApJ, 944, 107, doi: 10.3847/1538-4357/acb3c2DOI
  21. [23]Conroy, C. 2013, ARA&A, 51, 393. https://arxiv.org/abs/1301.7095
  22. [24]Conroy, C., Villaume, A., van Dokkum, P. G., & Lind, K. 2018, ApJ, 854, 139. https://arxiv.org/abs/1801.10185
  23. [25]Cool, R. J., Moustakas, J., Blanton, M. R., et al. 2013, ApJ, 767, 118, doi: 10.1088/0004-637X/767/2/118DOI
  24. [26]Cooper, A. P., Koposov, S. E., Allende Prieto, C., et al. 2023, ApJ, 947, 37, doi: 10.3847/1538-4357/acb3c0DOI
  25. [27]Dalcin, L., Paz, R., & Storti, M. 2005, Journal of Parallel and Distributed Computing, 65(9), 1108, doi: 10.1016/j.jpdc.2005.03.010DOI
  26. [28]DESI Collaboration, Aghamousa, A., Aguilar, J., et al. 2016a, arXiv e-prints, arXiv:1611.00037. https://arxiv.org/abs/1611.00037
  27. [30]DESI Collaboration, Abareshi, B., Aguilar, J., et al. 2022, AJ, 164, 207, doi: 10.3847/1538-3881/ac882b
  28. [31]DESI Collaboration, Adame, A. G., Aguilar, J., et al. 2024a, AJ, 168, 58, doi: 10.3847/1538-3881/ad3217
  29. [32]DESI Collaboration, Adame, A. G., Aguilar, J., et al. 2024b, AJ, 167, 62, doi: 10.3847/1538-3881/ad0b08
  30. [33]DESI Collaboration, Abdul Karim, M., Adame, A. G., et al. 2026, AJ, 171, 285, doi: 10.3847/1538-3881/ae4c43
  31. [34]Dey, A., Schlegel, D. J., Lang, D., et al. 2019, AJ, 157, 168, doi: 10.3847/1538-3881/ab089dDOI
  32. [35]Drinkwater, M. J., Jurek, R. J., Blake, C., et al. 2010, MNRAS, 401, 1429, doi: 10.1111/j.1365-2966.2009.15754.xDOI
  33. [36]Farr, J., Font-Ribera, A., & Pontzen, A. 2020, JCAP, 2020, 015. https://arxiv.org/abs/2007.10348
  34. [37]Filbert, S., Martini, P., Seebaluck, K., et al. 2024, MNRAS, 532, 3669, doi: 10.1093/mnras/stae1610DOI
  35. [38]García, L. Á., Martini, P., Gonzalez-Morales, A. X., et al. 2023, MNRAS, 526, 4848, doi: 10.1093/mnras/stad2993DOI
  36. [39]Girardi, L., Bertelli, G., Bressan, A., et al. 2002, A&A, 391, 195. https://arxiv.org/abs/astro-ph/0205080
  37. [40]Green, D., Kirkby, D., Aguilar, J., et al. 2025, arXiv e-prints, arXiv:2505.01596, doi: 10.48550/arXiv.2505.01596DOI
  38. [41]Guy, J., Bailey, S., Kremin, A., et al. 2023, AJ, 165, 144. https://arxiv.org/abs/2209.14482
  39. [42]Hahn, C., Wilson, M. J., Ruiz-Macias, O., et al. 2023, AJ, 165, 253, doi: 10.3847/1538-3881/accf18
  40. [43]Harris, C. R., Millman, K. J., van der Walt, S. J., et al. 2020, Nature, 585, 357. https://arxiv.org/abs/2006.10256
  41. [44]Hewett, P. C., & Wild, V. 2010, MNRAS, 405, 2302, doi: 10.1111/j.1365-2966.2010.16648.xDOI
  42. [45]Hunter, J. D. 2007, Computing in Science and Engineering, 9, 90
  43. [46]Hutchinson, T. A., Bolton, A. S., Dawson, K. S., et al. 2016, AJ, 152, 205, doi: 10.3847/0004-6256/152/6/205DOI
  44. [47]Juneau, S., Canning, R., Alexander, D. M., et al. 2024, arXiv e-prints, arXiv:2404.03621, doi: 10.48550/arXiv.2404.03621DOI
  45. [48]Kamble, V., Dawson, K., du Mas des Bourboux, H., Bautista, J., & Scheinder, D. P. 2020, ApJ, 892, 70, doi: 10.3847/1538-4357/ab76bdDOI
  46. [49]Kennicutt, Jr., R. C. 1992, ApJ, 388, 310, doi: 10.1086/171154
  47. [50]Kewley, L. J., Nicholls, D. C., & Sutherland, R. S. 2019, ARA&A, 57, 511. https://arxiv.org/abs/1910.09730
  48. [51]Kochanek, C. S., Eisenstein, D. J., Cool, R. J., et al. 2012, ApJS, 200, 8, doi: 10.1088/0067-0049/200/1/8DOI
  49. [52]Koester, D. 2010, Mem. Soc. Astron. Italiana, 81, 921
  50. [53]Koposov, S., Li, T. S., Allende Prieto, C., et al. 2026, The Open Journal of Astrophysics, 9, 55260, doi: 10.33232/001c.155260
  51. [54]Koposov, S. E., Gilmore, G., Walker, M. G., et al. 2011, ApJ, 736, 146, doi: 10.1088/0004-637X/736/2/146DOI
  52. [55]Koposov, S. E., Allende Prieto, C., Cooper, A. P., et al. 2024, MNRAS, 533, 1012, doi: 10.1093/mnras/stae1842DOI
  53. [56]Kotulla, R., Fritze, U., Weilbacher, P., & Anders, P. 2009, MNRAS, 396, 462, doi: 10.1111/j.1365-2966.2009.14717.xDOI
  54. [57]Kroupa, P. 2001, MNRAS, 322, 231
  55. [58]Lam, S. K., Pitrou, A., & Seibert, S. 2015, in Proceedings of the Second Workshop on the LLVM Compiler Infrastructure in HPC, 1–6
  56. [59]Lan, T.-W., Tojeiro, R., Armengaud, E., et al. 2023, ApJ, 943, 68, doi: 10.3847/1538-4357/aca5faDOI
  57. [60]Lang, D., Hogg, D. W., & Schlegel, D. J. 2016, AJ, 151, 36, doi: 10.3847/0004-6256/151/2/36DOI
  58. [62]Lyke, B. W., Higley, A. N., McLane, J. N., et al. 2020, ApJS, 250, 8, doi: 10.3847/1538-4365/aba623DOI
  59. [63]Marigo, P., Girardi, L., Bressan, A., et al. 2017, ApJ, 835, 77. https://arxiv.org/abs/1701.08510
  60. [64]Matthews, D. J., Newman, J. A., Coil, A. L., Cooper, M. C., & Gwyn, S. D. J. 2013, ApJS, 204, 21, doi: 10.1088/0067-0049/204/2/21DOI
  61. [65]McQuinn, M. 2016, ARA&A, 54, 313, doi: 10.1146/annurev-astro-082214-122355DOI
  62. [66]Miller, T. N., Doel, P., Gutierrez, G., et al. 2024, AJ, 168, 95, doi: 10.3847/1538-3881/ad45feDOI
  63. [67]Moustakas, J. 2017, iSEDfit: Bayesian spectral energy distribution modeling of galaxies, Astrophysics Source Code Library http://ascl.net/1708.029
  64. [68]Moustakas, J., & Kennicutt, Jr., R. C. 2006, ApJS, 164, 81
  65. [69]Moustakas, J., Kennicutt, Jr., R. C., & Tremonti, C. A. 2006, ApJ, 642, 775
  66. [70]Moustakas, J., Kennicutt, Jr., R. C., Tremonti, C. A., et al. 2010, ApJS, 190, 233. https://arxiv.org/abs/1007.4547
  67. [71]Moustakas, J., Zaritsky, D., Brown, M., et al. 2011, ArXiv e-prints. https://arxiv.org/abs/1112.3300
  68. [72]Moustakas, J., Coil, A. L., Aird, J., et al. 2013, ApJ, 767, 50. https://arxiv.org/abs/1301.1688
  69. [73]Newman, J. A., Cooper, M. C., Davis, M., et al. 2013a, ApJS, 208, 5, doi: 10.1088/0067-0049/208/1/5DOI
  70. [74]Newman, J. A., Cooper, M. C., Davis, M., et al. 2013b, ApJS, 208, 5. https://arxiv.org/abs/1203.3192
  71. [75]Okuta, R., Unno, Y., Nishino, D., Hido, S., & Loomis, C. 2017, in Proceedings of Workshop on Machine Learning Systems (LearningSys) in The Thirty-first Annual Conference on Neural Information Processing Systems (NIPS). http://learningsys.org/nips17/assets/papers/paper_16.pdf
  72. [76]Osterbrock, D. E. 1989, Astrophysics of gaseous nebulae and active galactic nucleiDOI
  73. [77]Pence, W. D., Chiappetti, L., Page, C. G., Shaw, R. A., & Stobie, E. 2010, A&A, 524, A42, doi: 10.1051/0004-6361/201015362DOI
  74. [78]Poppett, C., Tyas, L., Aguilar, J., et al. 2024, AJ, 168, 245, doi: 10.3847/1538-3881/ad76a4DOI
  75. [79]Raichoor, A., Moustakas, J., Newman, J. A., et al. 2023, AJ, 165, 126, doi: 10.3847/1538-3881/acb213DOI
  76. [80]Ross, A. J., Bautista, J., Tojeiro, R., et al. 2020, MNRAS, 498, 2354, doi: 10.1093/mnras/staa2416DOI
  77. [81]Ruhlmann-Kleider, V., Yèche, C., Magneville, C., et al. 2024, JCAP, 2024, 059, doi: 10.1088/1475-7516/2024/08/059
  78. [82]Schlafly, E. F., Kirkby, D., Schlegel, D. J., et al. 2023, AJ, 166, 259, doi: 10.3847/1538-3881/ad0832DOI
  79. [83]Shen, Y., Brandt, W. N., Richards, G. T., et al. 2016a, ApJ, 831, 7, doi: 10.3847/0004-637X/831/1/7DOI
  80. [84]Stark, P. B., & Parker, R. L. 1995, Computational Statistics, 10, 129. https://www.stat.berkeley.edu/~stark/Preprints/bvls.pdf
  81. [85]Stasińska, G., & Izotov, Y. 2003, A&A, 397, 71. https://arxiv.org/abs/astro-ph/0209050
  82. [86]Tonry, J., & Davis, M. 1979, AJ, 84, 1511, doi: 10.1086/125569
  83. [87]Tremonti, C. A., Heckman, T. M., Kauffmann, G., et al. 2004, ApJ, 613, 898
  84. [88]Vanden Berk, D. E., Richards, G. T., Bauer, A., et al. 2001, AJ, 122, 549, doi: 10.1086/321167DOI
  85. [89]Virtanen, P., Gommers, R., Oliphant, T. E., et al. 2020, Nature Methods, 17, 261. https://arxiv.org/abs/1907.10121
  86. [90]Waskom, M. 2021, The Journal of Open Source Software, 6, 3021
  87. [92]Yang, J., Fan, X., Gupta, A., et al. 2023, The Astrophysical Journal Supplement Series, 269, 27, doi: 10.3847/1538-4365/acf99bDOI
  88. [93]Zhou, R., Newman, J. A., Mao, Y.-Y., et al. 2021, MNRAS, 501, 3309, doi: 10.1093/mnras/staa3764DOI
  89. [94]Zhou, R., Dey, B., Newman, J. A., et al. 2023, AJ, 165, 58, doi: 10.3847/1538-3881/aca5fbDOI
  90. [95]Zhu, G. 2016, arXiv e-prints, arXiv:1612.06037, doi: 10.48550/arXiv.1612.06037DOI
  91. [96]Zhu, G., Blanton, M. R., & Moustakas, J. 2010, ApJ, 722, 491, doi: 10.1088/0004-637X/722/1/491DOI
  92. [97]Zhu, G., Moustakas, J., & Blanton, M. R. 2009, ApJ, 701, 86. https://arxiv.org/abs/0811.3035

Paper details

Contents