skip to main content

gaia data release 4 documentation

16.3 Apsis modules

16.3.4 GSP-Spec

Author(s): Pedro Alonso Palicio, Alejandra Recio-Blanco, Marco A. Álvarez

16.3.4.1 Goal

The General Stellar Parameteriser from Spectroscopy, hereafter GSP-Spec, is a module implemented in the Gaia APSIS pipeline dedicated to the physicochemical characterisation of stellar atmospheres through the analysis of spectra collected by the RVS instrument. More precisely, it determines the main atmospheric parameters and the abundances of 20 chemical elements relative to iron. These main parameters include the effective temperature (Teff), surface gravity (log⁡g), global metallicity ([M/H]), and α-element content relative to iron ([α/Fe]); while abundances are provided for N, Na, Mg, Al, Si, P, S, Cl, K, Ca, Ti, Cr, Fe, Ni, Sr, Zr, Ce, Nd, Sm, and Hf. For hot stars, it also measures the abundance of ionised iron (Fe II).

16.3.4.2 Training data and models

GSP-Spec makes use of two sets of synthetic grids of stellar spectra as reference, corresponding to two temperature regimes. For effective temperatures between 2750 K and 8000 K, we computed the synthetic spectra adopting the MARCS models (Gustafsson et al. 2008), as explained in Recio-Blanco et al. (2023) for Gaia DR3; while at hotter temperatures (up to 14,000 K) we considered the grids specified in Blomme et al. (2017). In the cool regime, the synthetic spectra were generated by solving the radiative transfer equation with the TURBOSPECTRUM code (version 19.1.5, Plez 2012) over the wavelength range [842.0, 876.0] nm, with a step size of 0.001 nm. This process makes use of a custom list of atomic and molecular lines, as detailed in Contursi et al. (2021), and the solar values for the abundances reported in Grevesse et al. (2007).

As a result, TURBOSPECTRUM returns high-resolution spectra with R∼300 000 , which are subsequently convolved with the mean Line Spread Function (LSF) of Gaia– i.e., the average LSF of the two fields of view (FOV) of the telescope – to simulate the effective resolution of the RVS, R≈11 500 . In contrast to the previous data release, where no broadening was considered, for Gaia DR4 we adopt seven different values of broadening (see Table 16.13), resulting in multiple synthetic grids for each interval of the parameter vbroad. Finally, the red and blue edges of the spectra are trimmed by 4 nm to match the RVS wavelength domain: [846.0, 870.0] nm.

The other parametrisation method implemented in GSP-Spec is the Artificial Neural Network (ANN), described in Recio-Blanco et al. (2016) and detailed in Section 16.3.4.5. While in Gaia DR3 the ANN was trained using the synthetic spectral grids described above, in Gaia DR4 the method adopts a data-driven approach based on observed Gaia RVS spectra. The training set consists of spectra sampled over 962 pixels and was built by cross-matching Gaia DR3 with the APOGEE-DR17 and GALAH-DR3 catalogues. Only stars fulfilling a set of quality criteria were retained, namely uncertainties below 200 K in Teff, 0.2 dex in log g, 0.1 dex in [M/H], and 0.1 dex in [α/Fe], together with an RVS signal-to-noise ratio greater than 50. After applying these selection criteria, the final training sample comprised 64 305  spectra, of which approximately 82% originated from the Gaia-APOGEE cross-match and the remaining 18% from the Gaia-GALAH cross-match.

Table 16.13: Intervals of vbroad considered in each grid of synthetic spectra. Values are expressed in units of  km⁢s−1
Grid number Minimum Maximum Used
A 0 – 0
B 4.5 9 7
C 9 14 11
D 14 20 16
E 20 30 24
F 30 50 37
G 50 – 65

Notes. Grid A is used for spectra with a low signal-to-noise ratio (<15), independently of their reported broadening.

16.3.4.3 Inputs

In contrast to other APSIS modules, GSP-Spec exclusively requires the RVS spectra to be analysed as input. Prior to GSP-Spec processing, these input spectra have been corrected for Doppler shifts, deblended, and pre-normalised by Gaia DPAC Coordination Unit 6 (Katz et al. 2023). For the vast majority of sources, the spectra analysed by GSP-Spec result from the combination of those collected during multiple transits of the Gaia FOVs across the objects. However, for a small number of variable sources of scientific interest, these epoch spectra are analysed individually.

16.3.4.4 Outputs

The products of GSP-Spec are stored in three tables: ap_rvs, which mainly contains the atmospheric parameters inferred from stacked spectra; ap_chem, which provides the chemical abundances of individual elements; and ap_rvs_epoch, which contains the atmospheric parameters extracted from the epoch spectra of a selected sample of variable sources.

Each GSP-Spec atmospheric parameter published in ap_rvs is associated with multiple columns:

  • •

    The median value of the atmospheric parameter obtained from all MCMC realisations of the input spectra is stored in the column named parameter_gspspec, where parameter can be teff (effective temperature), logg (surface gravity), mh (global metallicity), or alphafe (global α-abundance).

  • •

    The lower (upper) confidence level of the parameter, corresponding to the 16th (84th) percentile of its MCMC realisations, is indicated by the suffix _lower (_upper) in the column name.

  • •

    When compared with values from the literature, GSP-Spec parameters may exhibit biases that require correction. Once corrected, the calibrated parameters are stored in the corresponding columns with the suffix _calib.

Finally, additional quality information regarding the atmospheric parameters is stored in flags: flags_ gspspec. These flags are strings in which each character encodes the quality of measurements according to predefined criteria.

GSP-Spec determines the chemical abundances of twenty elements with atomic lines in the RVS spectral domain. These abundances, along with their associated uncertainties, calibrations, and flags, are summarised in the ap_chem table:

  • •

    With the exception of iron – both in its neutral and first ionisation states – all abundance measurements are relative to iron (i.e., [X/Fe]). The median of all MCMC realisations of the abundance estimates is stored in columns of the form xfe_gspspec, where x refers to the element name in lowercase notation. In contrast, iron abundances are computed relative to the global metallicity [M/H], and are denoted as fem_ gspspec and feiim_ gspspec for the neutral and ionised states, respectively.

  • •

    The lower and upper bounds of the confidence intervals, corresponding to the 16th and 84th percentiles, are provided in columns of the form xfe_gspspec_lower and xfe_gspspec_upper, respectively, with analogous naming for the iron abundances mentioned above.

  • •

    The number of lines used in the abundance determination is recorded in columns with the suffix _nlines. This number can vary by element, as some lines are more likely to yield reliable abundance estimates than others.

  • •

    For elements with multiple lines in the RVS domain, the column xfe_gspspec_linescatter provides the standard deviation of the abundance measurements derived from the individual lines.

  • •

    The minimum abundance value that can be extracted from the input spectra is treated as an upper limit; its median value across all MCMC realisations is stored in xfe_gspspec_ulim.

  • •

    Similarly to the atmospheric parameters, the calibrated values for the abundances and their confidence limits are stored in the columns xfe_gspspec_calib, xfe_gspspec_calib_lower, and xfe_gspspec_calib_upper.

For scientific interest, the epoch spectra of certain variable stars are analysed by the GSP-Spec module in addition to their stacked counterparts (i.e., the spectra obtained by combining multiple epoch observations). This specific analysis includes the characterisation of their atmospheres, DIB features, and chemical composition; the resulting parameters are summarised in the ap_rvs_epoch table. This table contains GSP-Spec fields identical to those described above for the ap_rvs and ap_chem tables.

16.3.4.5 Method

The GSP-Spec module workflow combines multiple algorithms in the APSIS pipeline to estimate stellar parameters and abundances. Firstly, a decision tree named DEGAS (Bijaoui et al. 2010) determines a first estimation of the atmospheric parameters from the input RVS spectrum. These parameters are used as initial values for the MATISSE algorithm, an iterative algorithm for multilinear regression. For each atmospheric parameter, the MATISSE algorithm projects the input spectrum onto the space spanned by a set of vectors – the BF functions – precomputed during the training phase, prior to their ingestion into the APSIS pipeline. These BF functions result from a linear combination of the reference synthetic spectra, with weighting coefficients that depend on the variability of the flux with respect to the atmospheric parameter under consideration. In each iteration, MATISSE considers only those BF functions associated with the neighbourhood of the previous solution (Δ⁢Teff=±500 K, Δ⁢log⁡g=±0.5, Δ⁢[M/H]=±0.25 dex, Δ⁢[α/Fe]=±0.2 K) until convergence or ten iterations are reached. The output of MATISSE is refined by GAUGUIN (Bijaoui 2012; Recio-Blanco et al. 2016), a Gauss-Newton optimisation algorithm that iteratively updates the solution by minimising the difference between the observed spectrum and a synthetic spectrum interpolated from the previous iteration. As for MATISSE, GAUGUIN’s iterations finish after convergence or ten iterations.

The output of GAUGUIN does not constitute the final solution but is instead used to renormalise the input spectrum. More precisely, a reference spectrum is computed by interpolating the synthetic grid at the atmospheric parameters returned by GAUGUIN. The fluxes of this reference spectrum are then divided by those of the observed spectrum, resulting in a wavelength-dependent trend. This trend is modelled by a third-degree polynomial (after performing outlier removal via σ-clipping, as detailed in Santos-Peral et al. (2020)) and used to renormalise the observed spectrum. The modified spectrum is then reintroduced into the workflow, and the MATISSE+GAUGUIN procedure is repeated until a maximum of five renormalisations is reached.

In order to determine individual chemical abundances from each absorption line included in the line list, a 1D synthetic grid is generated assuming the final values of the atmospheric parameters, as obtained by the procedure described above, in which each spectrum has associated with it a different value of chemical abundance. This 1D grid is then used as a reference for the renormalisation algorithm, which refines the local continuum level around the absorption line (second normalisation), before GAUGUIN iteratively minimises the quadratic distance between the input spectrum and the 1D grid. For chemical elements that present multiple lines in the line-list, their final abundances correspond to the weighted mean of the individual-line abundance values, where the weights are inversely proportional to the uncertainties.

In addition to the MATISSE+GAUGUIN workflow, GSP-Spec also includes an Artificial Neural Network (ANN) module (Recio-Blanco et al. (2016)) to estimate the stellar atmospheric parameters (the _ann fields). In DR3, the ANN followed a model-driven approach based on synthetic spectra, whereas in DR4 it has been redesigned as a data-driven method trained on observed spectra, as described in Section 16.3.4.2.

The ANN consists of a feed-forward neural network with three fully connected layers. The input layer receives the flux values of the RVS spectrum, while the output layer simultaneously predicts the four atmospheric parameters, namely effective temperature (Teff), surface gravity (log⁡g), metallicity ([M/H]) and α-element abundance ([α/Fe]). A single hidden layer with 100 neurons and logistic activation functions connects the input and output layers, whereas linear activation functions are used for the input and output layers.

Prior to inference, the input spectra undergo a min-max normalisation to place all flux values within the same numerical range and avoid geometric biases. In addition, the first 39 and last 27 pixels of each spectrum are discarded to remove edge artefacts, mainly produced by radial-velocity corrections, which could otherwise introduce spurious features affecting the network predictions. The trained network is then applied to the processed spectrum, and the resulting normalised atmospheric parameters are transformed back to their physical units.

As in the MATISSE+GAUGUIN workflow, parameter uncertainties are estimated through Monte Carlo propagation of the flux uncertainties. Multiple realisations of each spectrum are generated according to the associated flux errors, and the ANN is evaluated for each of them. The final atmospheric parameters correspond to the median of the resulting distributions, while the 16th and 84th percentiles provide the lower and upper confidence intervals, respectively.

The network is trained using the back-propagation algorithm with an early-stopping strategy to maximise its generalisation capability and prevent over-fitting. To reduce the dependence on the initial random weights, multiple networks with different initialisations are trained, and the model yielding the lowest validation error is selected for deployment.

16.3.4.6 Scope

The GSP-Spec module analyses both the combined spectra and the individual epoch spectra provided by CU6. A minimum signal-to-noise ratio (S/N) of 5 is required for the combined spectra, while no S/N constraint is imposed on the epoch spectra. Instead, the analysis of epoch spectra is restricted to a predefined list of scientifically interesting targets, mainly variable sources such as Cepheids and RR Lyrae stars. Due to the absence of any S/N restriction for these sources, the quality assessment of the output is delegated to post-processing.

As shown in Figure 16.11, the distribution of magnitudes in the GRVS band reveals 95% of GSP-Spec sources have magnitudes brighter than 14 mag, while the faint limit in the G band is 15.25 mag.

Refer to caption
Figure 16.11: Distribution of magnitudes for the RVS sample and the subset analysed by GSP-Spec. Left (right) panel refers to the G (GRVS) band. Vertical lines denote the 95 percentile of the samples.

16.3.4.7 Uses and limitations

The quality of GSP-Spec products is indicated by a set of flags contained in the field flags_gspspec of Table ap_rvs. These flags are stored as a string of integers, each encoding the quality of different GSP-Spec outputs or providing useful information for data selection. Typically, a flag value of zero indicates the best results, while nine corresponds to poor estimates, with intermediate values in between. The list of GSP-Spec flags for Gaia DR4 can be seen in Table 16.14.

Table 16.14: List of GSP-Spec flags contained in the flags_gspspec field of ap_rvs.
Flag Flag                         Flag    Possible
index name                     description     values
0 vbroadT Bias in Teff induced by vbroad 0,1,2,9
1 vbroadG Bias in log⁡g induced by vbroad 0,1,2,9
2 vbroadM Bias in metallicity induced by vbroad 0,1,2,9
3 vradT Bias in Teff induced by radial_velocity_error. 0,1,2,9
4 vradG Bias log⁡g induced by radial_velocity_error. 0,1,2,9
5 vradM Bias in [M/H] induced by radial_velocity_error. 0,1,2,9
6 fluxNoise Flux noise induced uncertainties 0,1,2,3,4,5,9
7 extrapol Extrapolation level of the parametrisation 0,1,2,3,4,9
8 negFlux Negative flux w⁢l⁢p 0,1,9
9 nanFlux NaN flux w⁢l⁢p 0,9
10 emission Emission line detected by CU6 0,9
11 nullFluxErr Null uncertainties w⁢l⁢p 0,9
12 validVbroad Valid vbroad 0,1,9
13 variabilityFlag Variability of the source provided by CU6 0,1
14 Mflag Maximum flux indicator for M-stars filtering 0,1,2,3
15 loggCalibFlag Calibration method used for log⁡g 0,1,2,3,4
16-56 XUpLim Flag concerning upper limit of the abundance 0,1,2,3,4
(even) of the X element.
17-57 XUncer Flag concerning uncertainty of the abundance 0,1,2,3,4
(odd) of the X element.

As for Gaia DR3, we recommend to use calibrated values rather than the not-calibrated ones, and make use of the flags listed in Table 16.14 for filtering. We suggest starting with the General Sample selection (32 130 497  stars), in which

GS⁢condition =[(log⁡gC⁢a⁢l.≥3.6)⁢or⁢(Teff,Cal.≥4150⁢K)⁢or⁢((log⁡gC⁢a⁢l.≤2.4)⁢and⁢(Teff,Cal.≥3800⁢K))] (16.27)
and⁢([M/H]Cal.≤0.75⁢dex).

Then, if the preliminary results still present large distortion, implement the Medium Quality (MQ) selection (9 503 176  stars):

MQ⁢condition =(GS⁢condition)⁢and⁢(Teff,Cal.>3500⁢K) (16.28)
and⁢(log⁡gC⁢a⁢l.>0)⁢and⁢(log⁡gC⁢a⁢l.<5)⁢and⁢(Teff,Error<375⁢K)
and⁢(log⁡gE⁢r⁢r⁢o⁢r<0.5)⁢and⁢([M/H]Error<0.25)⁢and⁢((Teff,Cal.≥3800⁢K)⁢or⁢(log⁡gCal.≤3.5))
and⁢((Teff,Cal.≥4150⁢K)⁢or⁢(log⁡gC⁢a⁢l.≤2.4)⁢or⁢(log⁡gC⁢a⁢l.≥3.6))
and⁢(((v⁢b⁢r⁢o⁢a⁢d⁢T<2)⁢and⁢(v⁢b⁢r⁢o⁢a⁢d⁢G<2)⁢and⁢(v⁢b⁢r⁢o⁢a⁢d⁢M<2)⁢and⁢(S/N<15))⁢or⁢(S/N≥15))
and⁢(v⁢r⁢a⁢d⁢T<2)⁢and⁢(v⁢r⁢a⁢d⁢G<2)⁢and⁢(v⁢r⁢a⁢d⁢M<2)
and⁢(f⁢l⁢u⁢x⁢N⁢o⁢i⁢s⁢e<4)⁢and⁢(e⁢x⁢t⁢r⁢a⁢p⁢o⁢l<3)⁢and⁢(M⁢f⁢l⁢a⁢g<3),

where the errors are computed as half of the difference between the upper and lower confidence intervals. If the number of stars provided by the MQ sample is large enough, one can refine the selection by using the High Quality (HQ) sample criteria (4,674,293 stars):

HQ⁢condition =(MQ⁢condition) (16.29)
and((((vbroadT+vbroadG+vbroadM)==0)and(S/N<15))or(S/N≥15))
and(vradT==0)and(vradG==0)
and(vradM==0)and(fluxNoise==0)and(extrapol<3)
and(Mflag<3)and(NegFlux==0)and(nanFlux==0)
and(emission==0)and(nullFluxErr==0).

We recall that the GS, MQ, and HQ selections constitute a suggested initial filtering. The user may consider relaxing or imposing additional conditions depending on the number of remaining sources and the scientific objectives.

For the chemical abundances, their specific flags should also be considered (last two columns in Table 16.14). Also, no calibrated abundance value should be used if its associated not-calibrated counterpart has null value. We remind that neither the calibration nor the validation of the [Cl/Fe] abundance was possible due to the lack of literature references. Therefore, these estimates should be treated with caution.

As a data-driven method, the ANN provides excellent predictive performance within the parameter space covered by the training sample. However, its estimates may inherit systematic biases and selection effects from the underlying reference catalogues. Consequently, the inferred atmospheric parameters should be interpreted with caution, particularly for stars located outside the domain adequately represented in the training data. To complement the parameter estimates, the Monte Carlo propagation of the flux uncertainties provides robust statistical confidence intervals, reported as the 16th and 84th percentiles. These intervals facilitate the assessment of the reliability of individual predictions and should be considered together with the atmospheric parameters during their scientific interpretation.

16.3.4.8 Changes with respect to Gaia DR3

The main changes in the GSP-Spec performance for Gaia DR4 operations, with respect to DR3, concern the synthetic grids. As mentioned in Section 16.3.4.2, the synthetic grid of spectra was extended towards the hot regime (Teff>8000 K), up to 14000 K. Conversely, an updated version of the Line Spread Function and a set of non-zero broadening velocities have been implemented in the convolution of the synthetic spectra, resulting in a specific grid for each interval of the broadening factor vbroad (see Table 16.13). Furthermore, the wavelength ranges [850.000, 850.075], [854.375, 854.500], and [866.425, 866.500] nm, which contain the cores of the Ca II IRT (infrared triplet), have been masked, as this was found to reduce the bias with respect to the literature values (see Sect. 3 in Palicio et al. 2026c, for the details). This masking also helps to minimise potential effects of NLTE and chromospheric activity on the spectral fits.

We have also implemented a new convergence criterion for the continuum normalisation: instead of using a fixed number of iterations, as in Gaia DR3, we now impose a minimum variation in the estimated atmospheric parameters between two consecutive iterations in order to continue the normalisation procedure. This improves the parameterisation of the continuum flux for problematic spectra (e.g., cool stars with molecular lines) and reduces the number of iterations for simpler cases.

Compared to Gaia DR3, the minimum signal-to-noise ratio (SNR) of spectra to be analysed by GSP-Spec has been reduced from 20 to 5, while additional SNR thresholds have been imposed during the estimation of chemical abundances, with the aim of increasing computational efficiency. Additionally, abundances of eight chemical elements (Na, Al, P, Cl, K, Sr, Sm, and Hf) have been added to the twelve already present in Gaia DR3.

Since many GSP-Spec products exhibit biases when compared to the literature, we have applied polynomial calibrations to compensate for such deviations, similar to those suggested for Gaia DR3 in Recio-Blanco et al. (2023). For Gaia DR4, however, these calibrations depend not only on log⁡g but also on Teff. Moreover, they are not only described in the documentation but also included in the Gaia archive tables. In contrast to Gaia DR3, we note that the bias in effective temperature Teff in Gaia DR4 should not be ignored and, consequently, a calibration for it is suggested. Additionally, given that each broadening interval uses a different grid, the proposed polynomial calibration for metallicity and alpha abundances also depends on vbroad.

For the particular case of surface gravities, we explored two alternative calibrations: one based on astrometry and another on asteroseismology. These were finally implemented together with the polynomial correction used for the remaining parameters. The choice of calibration is encoded in the loggCalibFlag flag contained in the flags_gspspec field, which has also been updated with respect to DR3 (see Table 16.14).

The main change introduced in the ANN parameterisation with respect to Gaia DR3 is the transition from a model-driven to a data-driven approach. While in DR3 the network was trained using the synthetic spectral grids employed by GSP-Spec, in DR4 the ANN is trained on observed Gaia RVS spectra with reference atmospheric parameters provided by external spectroscopic surveys.

The training dataset was constructed by cross-matching Gaia DR3 with the APOGEE-DR17 and GALAH-DR3 catalogues. Only stars satisfying stringent quality criteria were retained. This transition allows the ANN to learn directly from observational data, reducing its dependence on synthetic spectral models