The AMBRE Project: Spectrum normalisation influence on Mg abundances in the metal-rich Galactic disc

The abundance of {\alpha}-elements provides an important fossil signature in Galactic archaeology to trace the chemical evolution of the different disc populations. High-precision chemical abundances are crucial to improving our understanding of the chemodynamical properties present in the Galaxy. However, deriving precise abundance estimations in the metal-rich disc ([M/H]>0 dex) is still challenging. The aim of this paper is to analyse different error sources affecting magnesium abundance estimations from optical spectra of metal-rich stars. We derived Mg abundances for 87522 high-resolution spectra of 2210 solar neighbourhood stars from the AMBRE Project. For this purpose, the GAUGUIN automated abundance estimation procedure was employed. The normalisation procedure has a strong impact on the derived abundances, with a clear dependence on the stellar type and the line intensity. For non-saturated lines, the optimal wavelength domain for the local continuum placement should be evaluated using a goodness-of-fit criterion, allowing mask-size dependence with the spectral type. Moreover, for strong saturated lines, applying a narrow normalisation window reduces the parameter-dependent biases of the abundance estimate, increasing the line-to-line abundance precision. In addition, working at large spectral resolutions always leads to better results than at lower ones. The resulting improvement in the abundance precision makes it possible to observe both a clear thin-thick disc chemical distinction and a decreasing trend in the magnesium abundance even at supersolar metallicities. In the era of precise kinematical and dynamical data, optimising the normalisation procedures implemented for large spectroscopic stellar surveys would provide a significant improvement to our understanding of the chemodynamical patterns of Galactic populations.


Introduction
Disentangling the chemodynamical signatures present in the disc's stellar populations is essential to unveiling the formation and evolution of the Milky Way. Since the first thin-thick disc identification (Yoshii 1982;Gilmore & Reid 1983), chemical signatures (preserved in FGK-type stars' atmospheres) have been suggested as the best criteria to differenciate between Galactic stellar populations. Numerous studies (e.g. Adibekyan et al. 2012;Recio-Blanco et al. 2014;Bensby et al. 2014;Wojno et al. 2016;Ivanyuk et al. 2017;Buder et al. 2019;Haywood et al. 2019;Hayden et al. 2020) have characterised these two Galactic components in the solar neighbourhood.
In particular, the α-elements abundance (e.g. O, Mg, Si, S, Ca, Ti) has been widely analysed to chemically disentangle the Galactic thin-thick disc populations (Fuhrmann 2011;Adibekyan et al. 2012;Recio-Blanco et al. 2014;Hayden et al. 2017). The observed thick disc has been reported to be [α/Fe]enhanced relative to the thin disc for most metallicities, unveiling distinct chemical evolution histories in both disc components. The abundance of [α/Fe] is used as a good chronological proxy. This is due to the timescale delay between core-collapse supernovae (Type II SNe) of the most massive stars (M 8M ), which enrich the ISM with α-elements predominantly, and Type Ia SNe, which release mainly iron-peak elements (Matteucci & Greggio 1986). However, both high-and low-α sequences seem to overlap at supersolar metallicites, showing a flat trend for most α-process elements (not expected by chemical evolution models) being impossible to chemically identify to which stellar population they belong. In addition, different features of the disc [α/Fe] abundances as the intermediate α populations at high metallicities (Adibekyan et al. 2012;Mikolaitis et al. 2017) and the gap between these stars and the high-α metal-poor population (Adibekyan et al. 2012;Gazzano et al. 2013), are still matter of debate.
In the solar neighbourhood and beyond, several spectroscopic stellar surveys have provided valuable chemical information and constraints, such as SEGUE (Yanny et al. 2009, LAMOST (Zhao et al. 2012, GES (Gilmore et al. 2012), RAVE (Steinmetz et al. 2006, R∼7500), APOGEE (Majewski et al. 2017, R∼22500), and GALAH (De Silva et al. 2015, R∼28000). Nevertheless, the flattening of the [α/Fe] abundances at supersolar metallicities is a common feature of many different studies. For instance, Anders et al. (2014) and Hayden et al. (2015) showed the [ Buder et al. (2019) found similar signatures over the sample of dwarfs and turn-off stars from GALAH DR2, showing a remarkable agreement with the results of Adibekyan et al. (2012). Similarly, Mikolaitis et al. (2017) defined both Galactic discs chemically finding the flattening trend in the [Mg/Fe] ratio for stars with metallicity [Fe/H] > -0.2 dex in a dwarf star sample from AMBRE data.
Theoretically, two-infall chemical evolution models (Chiappini et al. 1997;Romano et al. 2010) predict a steeper slope in the metal-rich regime ([Fe/H] > 0.0 dex), underestimating the measurement of Mg abundances with respect to the observed flat trend. More recent models (e.g. Kubryk et al. 2015) seem to reproduce this flattening including stellar radial migration, introduced by Schönrich & Binney (2009), through churning and blurring. Observational evidence of radial migration has also been noticed in several studies, using data from different surveys (Kordopatis et al. 2015;Hayden et al. 2017;Feltzing et al. 2020). Updated chemical evolution models developed by Grisoni et al. (2017Grisoni et al. ( , 2018 conclude also that other mechanisms are needed, in addition to the inside-out formation scenario, to reproduce the flattened trend in the Galactic disc at supersolar metallicites. On the basis of these apparent discrepancies, the study of chemical signatures requires the best possible precision and accuracy in the abundance measurement. Precise abundances are mandatory to detect stellar populations that differ in their elemental abundances from each other (Lindegren & Feltzing 2013). Magnesium is probably the most representative and commonly used α-element (c.f. Carrera et al. 2019). It is known to have a high number of measurable spectral lines in optical spectra. In addition, the ratio of the Mg abundance with respect to iron, [Mg/Fe], shows a large absolute separation of the Galactic thick-thin disc populations, along with a smaller scatter and a shallower trend with temperature and metallicity (Brewer et al. 2016;Bergemann et al. 2017;Ivanyuk et al. 2017;Buder et al. 2019), making this element possibly the best tracer.
A detailed exploration of possible error sources is crucial to interpreting the reality of the observed chemical signatures in the Galactic stellar populations and the resulting implications on chemodynamical relations (such as the contribution of radial migration in the solar neighbourhood or the use of [Mg/Fe] as a good age proxy), which are mainly constrained by the abundance precision. The main issues concerning the determination of high-precision abundances are characterised by the need for both high signal-to-noise ratio (S/N) and spectral resolution, and predominantly by the definition of continuum to normalise the observed spectral data. The latter issue can be responsible for the largest fraction of the uncertainty in the abundance estimations, which is still complex for cool metal-rich stars due to the high presence of blended and molecular lines (as reviewed by Nissen & Gustafsson 2018;Jofré et al. 2019). In particular, the continuum normalisation is not fully optimised for different stellar types in large spectroscopic stellar surveys.
In this paper, we present a detailed spectroscopic analysis of the Mg abundance estimation for a sample of 2210 FGKtype stars in the solar neighbourhood observed and parametrised at high spectral resolution within the context of the AMBRE Project (de Laverny et al. 2013). We point out that we refer to the observed high-and low-[Mg/Fe] sequences as thick and thin disc populations hereafter, although we have not applied any kinematic selection to the sample. The paper is organised as follows. In Sect. 2, we introduce the observational data sample used in this work. The automatic abundance estimation method is described in Sect. 3. We present the sources of error caused by the normalisation procedure in Sect. 4. In Sect 5, we show the final derived [Mg/Fe] abundances of the sample. We conclude with a summary in Sect 6.

The AMBRE:HARPS observational data sample
The AMBRE Project (de Laverny et al. 2013) is a collaboration between the Observatoire de la Côte d'Azur (OCA) and the European Southern Observatory (ESO), of which the main goal is to determine the stellar atmospheric parameters (T e f f , log(g), [M/H], [α/Fe]) of archived stellar spectra of the FEROS, HARPS, and UVES ESO spectrographs. The stellar parameters were derived by the multi-linear regression algorithm MATISSE (MATrix Inversion for Spectrum SynthEsis, Recio-Blanco et al. 2006), developed at OCA and used in the Gaia RVS analysis pipeline (Radial Velocity Spectrometer, see Recio-Blanco et al. 2016), with the AMBRE grid of synthetic spectra .
For the present paper, we derived [Mg/Fe] abundances over a sample of 87522 HARPS spectra 1 , corresponding to 2210 stars. These spectra sample was selected according to the goodness of fit between the synthetic and the observed spectrum, keeping those that present a quality label of 0 or 1 (see Table 3 of De Pascale et al. 2014). The signal-to-noise ratio (S/N) distribution of the sample is shown in Fig. 1. We only considered the HARPS spectra sample due to the high spectral resolution (R∼115000, Mayor et al. 2003) and to avoid biases among the different spectrographs included in the AMBRE Project.  The HARPS sample contains a large number of repeated observations for some stars. A cross-match with the Gaia DR2 catalogue (Gaia Collaboration et al. 2018) allowed us to assign a Gaia ID to each spectrum, identifying the different spectra of the same star. In order to be statistically significant and avoid spurious effects in single spectra, we analysed the stars with more than four observed spectra (≥ 4 repeats), only selecting stars with T e f f > 4700 K, as cooler stars could have larger errors in the parameters (c.f. Fig. 12  star we excluded spectra whose atmospheric parameters differ by more than two sigma from the mean value of said star. This allows us to discard possible mismatches and avoid the propagation of uncertainties on the atmospheric parameters to the stellar abundances. These different quality selections lead to a total of 76502 spectra, corresponding to 1172 stars. The estimated dispersion on the stellar atmospheric parameters from the different spectra of the same star are shown in Fig. 2. The average dispersion on T e f f , log(g) and [M/H] are 18.6 K, 0.03 dex and 0.01 dex, respectively.
To avoid any possible source of uncertainties from linebroadening, we only kept spectra with FWHM CCF 2 ≤ 8 km s −1 . As a consequence, the selected AMBRE:HARPS sample is restricted to the stellar atmospheric parameters shown in Fig. 3, mostly dwarf stars cooler than 6200K.
2 Cross-correlation function between the observed spectra and the corresponding templates used for the radial velocity estimation.

Method
From the high-resolution observational spectra sample described in the previous section, we derived and analysed the [Mg/Fe] abundances using 9 Mg I spectral lines in the optical range automatically, via the optimisation method GAUGUIN (Bijaoui et al. 2012;Guiglion et al. 2016;Recio-Blanco et al. 2016), and using a reference synthetic spectra grid produced in the framework of the Gaia-ESO Survey (GES) project (Gilmore et al. 2012). GAU-GUIN was part of the analysis pipeline of GES for the GIRAFFE spectra , and is also used for Gaia RVS spectra .
The atmospheric parameters (T e f f , log(g), [M/H], [α/Fe]) were used as an input (independently determined by the AM-BRE Project, as described above). A first global normalisation procedure was iteratively attached to the parameter estimation. This iteration is described in Worley et al. (2012) and was performed by De Pascale et al. (2014). For the present abundance analysis, an initial global normalisation was applied, considering a large wavelength domain of 70Å. In addition, a local normalisation around the considered spectral line was performed to optimise the continuum placement. Different widths of the local normalisation window were explored (c.f. Section 4). The local normalisation is not iterative. The details regarding the normalisation algorithm are described hereafter.
Moreover, the radial velocity correction was performed using the accurate estimated provided by the ESO:HARPS reduction pipeline, except for a small proportion of the spectra with no HARPS radial velocity available, for which it was estimated by the AMBRE analysis procedure with similar precision (see Worley et al. 2012;De Pascale et al. 2014).

The normalisation procedure
The observed spectrum flux was normalised over a given wavelength interval centred on the analysed line. For this purpose, the observed spectrum (O) was compared to an interpolated synthetic one (S) with the same atmospheric parameters. First, the most appropriate pixels of the residual (R = S/O) were selected using an iterative procedure implementing a linear fit to R followed by a σ-clipping. The clipping values vary from the first to the final iteration, starting with σ +5 −0.5 and ending with σ +2 −1 . Then, a final residual was calculated (R f inal = S* norm /O* norm ), where S* norm and O* norm are the synthetic and observed flux values in the previously selected pixels, applying an additional 0.2σclipping. Finally, the normalised spectrum was obtained after dividing the observed spectrum by a linear function resulting by the fit of R f inal . No convolution was carried out during the normalisation procedure, so the original spectral resolution is conserved. As an example, Fig. 4

The GAUGUIN automated abundance estimation algorithm
The GAUGUIN code is a classical optimisation method based on a local linearisation around a given set of parameters from the reference synthetic spectrum, via linear interpolation of the derivatives. The abundance estimate is performed considering the spectral flux in a predefined wavelength window, which is always inside the defined local normalisation one. The abundance window (∆λ Abund , c.f. Fig. 4) was set around 0.5Å for nonsaturated lines, and 2.5Å for strong saturated ones (see classification in Sect 3.4 below, ∼ 1.5-2 times the FWHM of each line in a solar-type star). We tested different local continuum intervals, always larger than these abundance estimation windows, to study the normalisation influence on the derived abundances for each type of line. It is worth noting that the local normalisation interval is not always perfectly symmetric around the analysed line. For some cases, due to contiguous strong absorption lines present on a particular side of the line, an asymmetric window is chosen in order to maximise the number of pixels close to the continuum level (see Appendix A for further details). For those particular configurations (only a few among the total analysed cases), the abundance window although included in the normalisation interval would be off centre. The observed abundance trends for these cases are consistent with the results obtained from symmetrically selected windows. Once the observed spectrum is normalised, a new specificreference synthetic spectra grid is interpolated at the input atmospheric parameters in order to measure the abundance from the analysed spectral line. This grid now includes a large range of the element abundance dimension (A X ). For the α-elements abundance determination, the grid covers different [α/Fe] values. A minimum quadratic distance is then calculated between the reference grid and the observed spectrum 3 , providing a first guess of the abundance estimate (A 0 ). Then, this first guess is optimised via a Gauss-Newton algorithm, carrying out iterations through linearisation around the new solutions. The algorithm stops when the relative difference between two consecutive iterations is less than ∆A X 4 /100. Figure 5 illustrates, for the observed solar spectrum, the fit carried out by the automated code GAUGUIN for the Mg line 5711.09 Å.

Synthetic spectra grid
A high-resolution optical synthetic grid (4200-6900Å; R∼300000, 18452 spectra) of non-rotating FGKM type spectra was used as a reference for the GAUGUIN procedure. Onedimensional LTE MARCS atmosphere models (Gustafsson et al. 2008) and the spectrum synthesis code TURBOSPECTRUM for radiative transfer (Alvarez & Plez 1998) were adopted, together with the solar chemical abundances of Grevesse et al. (2007). The covered atmospheric parameter ranges are: This grid was computed in a similar way to the original AM-BRE grid , which was adopted for the parameter estimation. It does however contain some more recent specificities. First, we adopted the Gaia-ESO Survey atomic and molecular line lists (Heiter et al. , 2019submitted). Next, we considered more realistic values of the microturbulent velocity for the spectra computation by adopting a polynomial relation between V mic and the main atmospheric parameters (M. Bergemann, private communication). Finally, we always considered perfectly consistent [α/Fe] enrichments between the selected MARCS models and the calculated emerging spectra. To be in agreement with the observational spectra data set, we reduced the resolution of the synthetic spectra to the observed resolving power (R = 115000) by convolving with a Gaussian kernel.

Selected Mg I lines
The abundance analysis was performed using nine magnesium spectral lines in the optical range shown in Table 1, adopting the atomic data of Heiter et al. (2015).

Mg I (Å):
Non We performed an in-depth analysis of each line separately in order to test their reliability at different metallicity regimes. For a solar-type star, the selected lines could be classified in two categories: non-saturated (4730.04, 5711.09, and triplet: 6318.7, 6319.24, 6319.49 Å) and strong saturated lines (Mg Ib triplet: 5167.3, 5172.7 & 5183.6, and the line 5528.4 Å). Both cases are illustrated in Fig. 6. The number of pixels available for strong lines are approximately five times higher than for non-saturated lines. We only considered non-saturated lines for spectra with FWHM CCF ≤ 7 km s −1 to avoid possible uncertainties from linebroadening (see Appendix B for further details).
The selected lines in Table 1 have been widely used in the literature to determine both [Mg/Fe] and [α/Fe] abundances. Bergemann et al. (2014Bergemann et al. ( , 2017 analysed different approximations for radiative transfer and spectral line formation in model atmospheres, focused on their effect on Mg abundance determination using lines in the optical and infrared, among which there are four lines used in our analysis (5172, 5183, 5528, and 5711Å). They find no significant differences between 1D LTE and 1D NLTE abundances, and for the lines in common with ours, they present a quite robust behaviour with respect to the full 3D NLTE calculations in cool FGK stars. Small NLTE effects on Mg I line formation were also found by Zhao et al. (2016) and Alexeeva et al. (2018). In conclusion, 1D LTE Mg abundances are accurate enough for our selected sample and computationally cheaper than applying NLTE corrections. The results and discussions presented in this paper are therefore based on 1D LTE Mg abundances.
The methodology to calculate the final stellar [Mg/Fe] abundance from all the Mg lines information is described as follows. For a given spectrum, a weighted average of the individual lines results was calculated following Adibekyan et al. (2016), where the distance from the median abundance was considered as a weight. This method allows us to avoid the combined random uncertainties of the different lines, minimising the error when more lines are considered. Next, as at least four spectra were available for each star in the sample, the final [Mg/Fe] abundance of each object was calculated from the median value of the repeats.

Optimising the spectral normalisation for different stellar types
In large spectroscopic stellar surveys, an automatic adjustment of the continuum is performed over the observed spectrum, generally via few iterations, searching for possible line-free regions (Valenti & Piskunov 1996;Sousa et al. 2007;García Pérez et al. 2016). Most of the spectral analysis pipelines for determining chemical abundances and stellar atmospheric parameters carry out the same normalisation procedure for all stellar types, applying a constant continuum interval around the considered spectral feature. Mikolaitis et al. (2014) used a spectral fitting method to correct the local continuum in regions of ±5Å and ±15Å for weak and strong lines, respectively. Adibekyan et al. (2012) applied similar normalisation intervals on the measurement of equivalent widths (private communication). The width of the constant normalisation window is assumed to find continuum information around the analysed line for any stellar type. As a consequence, the methodology is not optimised to the difficulty of identifying the continuum, which depends on the spectral type.  Cool metal-rich stars 5 are a particularly difficult case due to the presence of blended and molecular lines. For instance, in the case of the APOGEE survey, Holtzman et al. (2015) remark how challenging it is to identify a true continuum in the observed spectra of these stellar types, leading to a 'pseudo-continuum' normalisation. Similarly, after an analysis of systematic errors using six different methods, Jofré et al. (2017) concluded that the definition of continuum may be responsible for the largest fraction of the uncertainty in abundance estimations. The automated abundance estimation code GAUGUIN is not an exception on the continuum placement performance. As described in Sect 3.2, it carries out an iterative procedure over a local window around the analysed line. For that reason, we studied the normalisation influence on the derived abundances applying (for each Mg I line; see Table 1) different local continuum intervals (from narrow, ∆λ norm ∼ 1Å, to very large ranges, ∆λ norm ∼ 70Å. See Appendix A). For this purpose, we evaluated the quality of the resulting normalisation, using a goodness of fit (χ 2 ) between the interpolated synthetic spectrum (with the corresponding atmospheric parameters of the star) and the normalised observed one. This was performed over the abundance estimation window, as it is constant for each line (c.f. blue lines in Fig. 4 and the corresponding fit in Fig. 5).
As described in detail hereafter, our analysis reveals that the width of the local normalisation interval can have an important impact on the derived abundances. In fact, the optimal width of the normalisation window depends clearly on the stellar type (T e f f , log g, [M/H]). As a consequence, if a constant wavelength interval is chosen, independently of the stellar parameters, different biases appear depending on the effective temperature, the surface gravity, and the global metallicity, especially in the metalrich regime ([M/H] ≥ 0 dex), blurring the chemical features of the studied population. 5 We use the following nomenclature: (metal-rich); T e f f 5400 K (hot) As expected, the environment and the intensity of the spectral line drastically influence the selection of the appropriate normalisation interval where the continuum placement should be defined for each case. In the following, we summarise the results of our study for the two characteristic cases mentioned in Table 1 and illustrated in Fig. 6 for the normalised observed solar spectrum.   Fig. 7. The use of a larger normalisation interval can drop artificially the observed flux, leading to higher abundance estimates. More difficult pseudo-continuum placements due to contiguous absorption lines can explain this continuum drop, and the poorer goodness-of-fit values observed in Fig. 7.

Non-saturated lines
As for the 4730.04 Å line, the weak triplet lines around 6319Å (left panel in Fig. 6) are better fitted by applying a narrow normalisation interval. For the Mg line 5711.09 Å (see Fig. 4), which is stronger than the other non-saturated lines, the optimal local normalisation window is larger for cool metal-rich stars, for which the line is more intense although still not saturated.
In conclusion, for non-saturated lines, there is generally enough continuum information around and close to the line. As a consequence, it is convenient to optimise the normalisation interval, close to the considered spectral feature.

Strong saturated lines
For strong saturated lines like the Mg Ib triplet (5167.3, 5172.7, and 5183.6 Å) and the line 5528.4 Å, no pixels are available close to the continuum level for most of the stellar types (see bottom panel in Fig. 6) in the analysed region, and a pseudocontinuum normalisation has to be performed for the automatic fit, including part of the line wings.
However, two main difficulties affect the procedure. On the one hand, due to the line saturation, only the wings are sensitive to the abundance. As a consequence, an important degeneracy between the continuum placement and the derived [Mg/Fe] abundance appears. In other words, large changes in the continuum placement, like those induced by the use of different normalisation windows, can be compensated by a change in the abundance without degrading the line fitting quality. Figure 9 illustrates, for the different local normalisation intervals analysed around the 5183.6Å line, the comparison of the line χ 2 fitting values (top panel), and the corresponding derived abundance values (bottom panel). A negligible difference in the goodness of fit from the studied continuum intervals is observed, although, as shown below, it corresponds to notorious differences in the abundance estimations. Therefore, the χ 2 quality criterion, reliable to carry out an appropriate normalisation interval selection for the non-saturated lines (Sect. 4.1), is usually not discriminating enough in saturated lines.
On the other hand, the larger the local normalisation window, the larger the dependencies of the abundance results on the parameters and, as a consequence, the larger the dispersion on the perature and surface gravity. Clearly, the results obtained with the largest normalisation window (left panels) have a significant T e f f dependence and even a log g dependence, inducing a higher dispersion. Those effects are alleviated when the normalisation window is narrowed to 10Å (middle panels), and they practically disappear for the narrowest window of 6Å (right panels). In addition, broader windows tend to have lower [Mg/Fe] values for cooler and higher gravity stars. These trends do not disappear even if an iterative procedure involving local normalisation and abundance estimation is implemented. In addition, the parameter dependence is also observed when larger normalisation intervals are explored (going beyond the MgI triplet wings, up to ∆λ norm ∼ 70Å; 5140 -5210Å). In the following, we analyse in detail the reason for this observed pattern of strong saturated lines. To better illustrate this behaviour, Fig. 11 shows the synthetic spectra for a hot star (T e f f = 6000 K, left panel) and a cool star (T e f f = 5000 K, right panel), keeping the other atmospheric parameters constant to the following values: 4.5 dex in logg, + 0.25 dex for metallicity, and 0.0 dex in [α/Fe] abundance. The blue synthetic spectra consider all the absorption sources (atomic and molecular lines), while the red ones present only the Mg lines absorption source for comparison purposes. As illustrated in the right panel, the pseudo-continuum level is essentially driven by the Mg line absorption. As a consequence, when no pixels at the continuum are available (e.g. cool and metal-rich stars), the first Mg abundance guess has a strong influence in the pseudocontinuum placement. In our procedure, the normalisation step, taking as a reference a synthetic spectrum with the star's atmospheric parameters, assumes as a first guess that [Mg/Fe] is equal to the input [α/Fe] parameter (see Sect. 3.1).
To explore the dependence of the normalisation, and therefore of the resulting [Mg/Fe] estimates, on the initial abundance guess, we artificially substracted 0.  ulating a difference between the [α/Fe] and the [Mg/Fe] abundance. Figure 12 shows the difference in the resulting [Mg/Fe] estimate for two local normalisation windows of 6 and 15 Å around the saturated line 5183.6 Å (illustrated in Fig. 11 This result is in close agreement with the synthetic analysis showed in Fig. 11. The induced bias in the continuum-level estimation, and therefore in the derived [Mg/Fe] abundances, is always present but constant with the stellar atmospheric parameters if the narrow normalisation interval is applied around the strong saturated lines. This is not the case for the 15Å window, for which this induced bias is partially corrected but only to an extent that depends on the stellar parameters. The application of a large local continuum interval is only convenient for the stellar types with pixels reaching the continuum level. In those cases, as described before, the normalisation procedure is independent on the initial guess of the [α/Fe] value. In our sample, this condition only occurs for stars with 5500 ≤ T e f f ≤ 5750 K and 3.5 ≤ log g ≤ 4.5 dex. The corresponding [Mg/Fe] vs. [M/H] for these stars, using the large normalisation window (15Å), is shown in Fig. 13. It can be appreciated that the thin and thick disc sequences clearly separate up to a metallicity of ∼ +0.1 dex, and the trends at high metallicity do not flatten. These more accurate results are in agreement with the observed trends for the narrowest (6Å) normalisation window for all the stellar types (right panels of Fig. 10). We therefore conclude that our procedure, through narrow normalisation windows using the global [α/Fe] as an initial abundance guess, is a reliable way of using these strong saturated lines.
In conclusion, the dispersion on the [Mg/Fe] abundance estimation from strong saturated lines, with respect to [M/H], is dominated by the induced bias in the continuum-level estimation for the stellar types where a pseudo-continuum evaluation around the line is performed. The application of larger normalisation windows results in a parameter dependence of the obtained abundance and a larger line-to-line dispersion, each saturated line having its own level of continuum misplacement for a given star. The amplitude of this continuum placement error is smaller applying a narrower normalisation interval, therefore improving the abundance estimation precision. The strong link of the narrow normalisation window to the initial [α/Fe] guess through the pseudo-continuum reduces the atmospheric parameter dependence.

Mg abundances line-to-line scatter
The previous sections allow us to conclude that: (i) for weak non-saturated lines, the optimal wavelength domain for the local continuum placement has to be evaluated using a goodness-offit criterion, allowing a wavelength dependence with the spectral type. Generally, narrow normalisation windows between 1 and 2 Å provide the best line fittings (around two to four times the FWHM of each line in a solar-type star); (ii) for strong saturated lines, a narrow normalisation window allows us to reduce parameter-dependent biases of the abundance estimate, improving the precision (around two to four times the FWHM of each line in a solar-type star).
To evaluate the improvement in precision of the abundance results with our optimised procedure, we analysed the internal error estimation. Figure 14 shows the cumulative distribution of the line-to-line scatter per spectrum of the derived [Mg/Fe] abundances for non-saturated (top panel) and strong saturated lines (bottom panel) separately. For non-saturated lines, the improvement in precision is confirmed after the optimisation based on the goodness of fit (blue curve), and applying narrow normalisation windows around each line (∆λ norm ∼ 1-2 Å) shows the same behaviour in terms of line-to-line scatter (black curve). The reduced number of stars is due to the cut in FWHM CCF (see Sect. 3.4). For strong saturated lines, the application of a narrow normalisation interval (∆λ norm ∼ 3 -6 Å, two to four times their FWHM in a solar-type star) shows a remarkable improvement of the abundance estimation precision. It presents a small scatter of less than 0.03 dex in comparison with the continuum placement performance in the typical wavelength interval used in previous works (red curve) and with the consideration of the goodness of fit as the quality criterion of the resulting normalisation, despite the fact that we showed that it is not discriminating enough for these lines (see Fig. 9). In conclusion, our optimised normalisation procedure applies a goodness-of-fit criterion for weak non-saturated lines to choose the appropriate continuum interval, and a fixed narrow normalisation window for the strong saturated ones.
A similar behaviour is observed in Fig. 15 when all the Mg lines of different strengths are considered. We compare results for the normalisation windows used in the literature (red) and for our optimised normalisation procedure (blue). In the top panel, we can see the analysis over the whole spectra sample for which all the Mg lines are considered. In addition, 40 % of the sample  The blue curve describes the values that correspond to the normalisation interval that presents the lowest χ 2 fitting value, the red one corresponds to the continuum placement performance in the typical wavelength interval used in previous works in the literature, and the black curve corresponds to a narrower local normalisation interval around each line as proposed in this work. presents a scatter smaller than 0.05 dex choosing our best value in each case, while this is only the case for 20 % of the sample with the classical normalisation windows. This improvement in precision is even more significant if we focus the analysis on the metal-rich part ([M/H] > 0.0 dex), as shown in the bottom panel of Fig. 15. In the metal-rich regime, the percentage of spectra with a line-to-line scatter lower than 0.05 dex increases from 5 % to 40 %, thanks to our optimised procedure with respect to the classical one.
In conclusion, this reduction of the line-to-line scatter supports an improvement in the abundance estimate's precision with our procedure. In terms of accuracy, we identified four Gaiabenchmark stars (18 Sco, HD 22879, Sun, and τ Cet) from Jofré et al. (2015) in our sample, finding an excellent agreement with an overall average difference of 0.01 dex. We also tested the derived abundances for those stars applying the normalisation windows used in the literature, finding an average difference within one sigma error from the optimised value. In other words, our normalisation procedure improves the abundance estimation precision, preserving its accuracy.

Disentangling the thin and the thick disc populations
In this section, we summarise the final derived [Mg/Fe] abundances of our AMBRE:HARPS stellar sample (901 stars, see Fig. 3).
The results for each Mg I line are presented separately in Fig. 16. The four saturated lines (MgIb triplet: 5167.3, 5172.7 & 5183.6, and 5528.4 Å) and the intermediate-strength line 5711.09Å seem to reproduce the thin-thick disc sequences more precisely, also showing a decreasing trend in [Mg/Fe] even at supersolar metallicities. This is in agreement with the analysis of NLTE effects on Mg abundances done by Bergemann et al. (2017), where they highlight the robust behaviour of the strong lines 5172, 5183, 5528, and 5711 Å. The higher dispersion present on the abundance results for the weak non-saturated lines with respect to the strong saturated ones is due to different factors. On the one hand, for certain stellar types (towards hot metal-poor stars) and for lower Mg abundances (in terms of [Mg/H]), weak lines are closer to the spectral noise level. On the other hand, although saturated lines are less sensitive, pixel per pixel, to abundance variations (therefore presenting smaller flux variations per pixel), they span larger wavelength domains than non-saturated lines. As a consequence, the cumulative quantity of information on the abundance through all the considered pixels is very significant for strong lines, favouring a higher precision. This is confirmed by the study of the internal errors, through simulated noised theoretical spectra (see Appendix C). However, a high spectral resolution is required, even at high signal-to-noise values, to compensate the limited sensitivity of the lines to the abundance (c.f. Fig. C.1). Figure 17 illustrates the final stellar abundance ratios [Mg/Fe] relative to [M/H] for our selected stellar sample (left panel), along with their estimated dispersion from the repeated observed spectra (right panel). The chemical distinction between the Galactic thin-thick disc populations is clearly observed, and the trend in [Mg/Fe] abundances at high metallicity ([M/H] > 0 dex) does not flatten. In addition, the gap in the [Mg/Fe]enhanced disc stellar population, first observed by Adibekyan et al. (2012) and later confirmed by Mikolaitis et al. (2017), still seems to be present in Fig. 16 & Fig. 17  Recent studies analysing dwarf stars in the solar neighbourhood Fuhrmann et al. 2017) present Mg lines that are in common with our work (c.f. Table 1 and Table 2 of Mikolaitis et al. 2017 andFuhrmann et al. 1997, respectively). Mikolaitis et al. (2017) observed a different trend at high metallicities. However, as described before, Mikolaitis et al. (2017) did not optimise the continuum normalisation for different stellar types, applying a constant local interval depending on the intensity of the line. On the other side, the agreement of our results with those of Fuhrmann et al. (2017) is higher. Nevertheless, the slope of the low-alpha sequence in Fuhrmann et al. (2017) seems less pronounced than in our work. Fuhrmann et al. (2017) used the Mg I abundance estimate from weak lines as the input parameter to the Mg Ib lines (strong saturated). This first-guess abundance could have an important influence on the pseudocontinuum estimate, and therefore in the derived [Mg/Fe] abundance, for saturated lines. For cool or metal-rich dwarf stars, the impact of this first guess in the derived Mg Ib abundances could be stronger than for the other stars in the sample. As a consequence, possible parameter-dependencies in the results could remain.
Finally, we checked the consistency of our first-guess assumptions by comparing (on the left panel of Fig. 18) our initial abundance guess, coming from the [α/Fe], and our final derived [Mg/Fe] abundances. The very good agreement between both quantities confirms the consistency of the procedure. In addition, the right panel of Fig. 18 compares our initial guess with other suggested initial input in the literature, the abundance result from the weak lines (4730.04 and 5711.09 Å) used by Fuhrmann et al. (2017). There is a very good agreement between our initial guess (the global [α/Fe]) and the [Mg/Fe] from the weak lines, with only a few cool stars with [α/Fe] around 0.1 dex with lower [Mg/Fe] weaklines values. Those few cases correspond to cool stars with supersolar metallicities. This suggests that the two weak lines could suffer from blends in the very crowded spectra, affecting the continuum placement and therefore the abundance estimate. As we can indeed see in Fig. 16, the results of the two weak lines are more dispersed. On the other hand, the global [α/Fe] parameter value was derived considering the complete HARPS wavelength domain (De Pascale et al. 2014). Therefore, it is also less affected by continuum placement problems. For this reason, we believe that the global [α/Fe] determined by the AM-BRE pipeline, although very similar to the results of the weak lines, is a more precise initial guess for our application. Our analysis allows a remarkable improvement with regard to previous efforts to chemically disentangle the Galactic thinthick disc populations, and emphasises the importance of the normalisation procedure to properly interpret the chemical evolution of the disc. In conclusion, the feasibility of an optimal treatment on strong saturated lines to derive precise nonparameter-dependent abundances represents a major advancement. It will allow us to appropriately study the chemical signatures in the Galactic stellar populations and the resulting implications on chemodynamical relations, such as the abundance ratio [Mg/Fe] as a good age proxy, or the contribution of radial migration in the solar neighbourhood (Santos-Peral, in prep.).

Conclusions
We carried out a detailed spectroscopic analysis of the Mg abundance estimation over a sample of 2210 FGK-type stars in the solar neighbourhood observed and parametrised at high spectral resolution (R=115000) within the context of the AMBRE Project. From this sample, we selected 1172 stars that have more than four observed spectra (≥ 4 repeats).
We explored the possible sources of uncertainties in deriving chemical abundances, focusing on the continuum normalisation. From different stellar populations and nine Mg I spectral lines in the optical range, we observed different behaviours depending on the stellar type and the intensity of the line. The normalisation procedure has an important impact on the derived abundances, with a strong dependence on the stellar parameters (T e f f , log g, [M/H]). Contrary to what is currently done in large spectroscopic surveys, the continuum placement procedure therefore has to be optimised for each stellar type and each spectral line. As expected, the intensity of the spectral lines has a drastic influence in the optimal width of the normalisation interval: -Non-saturated lines: the optimal wavelength domain for the local continuum placement could be evaluated using a goodness-of-fit criterion, allowing a wavelength dependence with the spectral type. It is generally convenient to optimise the normalisation window close to the considered line (around two to four times their FWHM). For strong (although not saturated) lines like 5711.09 Å, a larger interval could be necessary when dealing with cool metal-rich stars ([M/H] > -0.2 dex ; T e f f < 5400 K).
-Saturated lines: no pixels are available at the continuum level for most of the stellar types in the analysed region, and a pseudo-continuum normalisation has to be performed for the automatic fit. The level of the pseudo-continuum depends on the Mg abundance itself, which is at first assumed to be equal to the global α-element abundance (or to another first-guess abundance). The induced bias in the Mg estimate is only partially corrected by the Mg line fitting due to a degeneracy between the fitting quality and the continuum placement (as the line is saturated, only the wings profile changes). In addition, the bias correction depends on the pseudo-continuum level itself. In this situation, one possibility consists in reducing the analysis of the saturated lines to the stellar types presenting continuum in the spectra (hot metal-poor stars). Alternatively, we have demonstrated that using a narrow normalisation window (around two to four times the FWHM of each line in a solar-type star) drastically reduces the parameterdependence of the abundance estimate, increasing the lineto-line precision. This relies on the assumption that the Mg We implemented a test with theoretical spectra to evaluate the internal error sources in our method of [Mg/Fe] estimation, concentrating on the strong lines of the MgIb triplet (5167.3, 5172.7, 5183.6 Å). This error assessment leaves out the error sources restricted to real data, like the uncertainties in the line-broadening or the continuum normalisation, described in the body of the paper. In particular, the theoretical internal error analysis allows us to identify possible internal biases. We built statistically significant sets of interpolated spectra from the high-resolution synthetic spectra grid, convolving to six different spectral resolutions, in the range from R ∼ 2000 to R ∼ 110000 (the HARPS resolution), and artificially adding random Gaussian noise (SNR = 10, 25, 50, 75, and 100). We defined four different stellar types; cool dwarf (4000 ≤ T e f f ≤ 5000K, 4.4≤ log(g) ≤5.0 cm s −2 ) turn-off (5800 ≤ T e f f ≤ 6200K, 3.5≤ log(g) ≤ 4.1 cm s −2 ) solar-type (5500 ≤ T e f f ≤ 6000K, 4.2≤ log(g) ≤ 4.7 cm s −2 ) red clump (4000 ≤ T e f f ≤ 4700K, 2.0≤ log(g) ≤ 3.0 cm s −2 ).
For each case, at a given spectral resolution, we generated 250000 spectra (50000 per  First of all, no biases with stellar parameters are present in the results regardless of the resolution or signal-to-noise ratio of the data. Secondly, it appears that working at high resolution always leads to better results, independently of the stellar type and the metallicity range. In Fig. C.1, the errors in the average [Mg/Fe] estimate (among the three MgIb lines) are given as a function of the SNR and for different resolutions. The three panels correspond to the three metallicity intervals. In Fig. C.2, the abundance error is shown for the four considered stellar types (cool dwarf, turn-off, solar-type and red clump) at solar metallicity and changing the spectral resolution from 2000 (left) to 20000 (right).
These two figures illustrate that the abundance estimation precision depends principally on the spectral resolution and secondly on the target's effective temperature and metallicity. On the one hand, despite the fact that the considered lines are very large, the uncertainty increases critically when the spectral resolution is degradated. Although, as expected, this effect is more significant at low signal-to-noise values, increasing the SNR does not always compensate a resolution loss. In addition, even at high signal to noise, significant dependences of the uncertainty with the stellar type appear, if the spectral resolution is not high enough. In fact, the abundance uncertainties observed at low resolution are more dependent on the stellar type than those obtained at high resolution. This highlights the importance of working at high resolution for spectroscopic surveys targeting a variety of stellar types and metallicity ranges, in order to achieve more precise and homogeneous results, even when strong lines are used. Moreover, the pseudo-continuum is expected to become more significant (fewer pixels close to the continuum level) at lower spectral resolutions.
These results are in agreement with the analysis of Nissen & Gustafsson (2018) regarding high-precision stellar abundances, underlining the relevance of carefully balancing the need for a large sample of stars against the spectral resolution and the S/N necessary to achieve a good precision in abundances.