The Mercator Library of High Resolution Stellar Spectroscopy

Aims. Over the past decades, libraries of stellar spectra have been used in a large variety of science cases, including as sources of reference spectra for a given object or a given spectral type. Despite the existence of large libraries and the increasing number of projects of large-scale spectral surveys, there is to date only one very high-resolution spectral library o ff ering spectra from a few hundred objects from the southern hemisphere (UVES-POP). We aim to extend the sample, o ff ering a finer coverage of e ff ective temperatures and surface gravity with a uniform collection of spectra obtained in the northern hemisphere. Methods. Between 2010 and 2020, we acquired several thousand echelle spectra of bright stars with the Mercator-HERMES spectrograph located in the Roque de Los Muchachos Observatory in La Palma, whose pipeline o ff ers high-quality data reduction products. We have also developed methods to correct for the instrumental response in order to approach the true shape of the spectral continuum. Additionally, we have devised a normalisation process to provide a homogeneous normalisation of the full spectral range for most of the objects. Results. We present a new spectral library consisting of 3256 spectra covering 2043 stars. It combines high signal-to-noise and high spectral resolution over the entire range of e ff ective temperatures and luminosity classes. The spectra are presented in four versions: raw, corrected from the instrumental response, with and without correction from the atmospheric molecular absorption, and normalised (including the telluric correction). Conclusions.


Introduction
Theoretical libraries of stellar spectra offer noiseless data with a virtually infinite spectral resolution and an excellent coverage of the stellar parameter space.However, such libraries suffer from model-dependent systematic uncertainties, and they depend on the existence of reliable databases of atomic and molecular line lists and opacities (Jofré et al. 2019).
Observational libraries, in contrast, do not rely on any assumption but often suffer from observational limitations in terms of spectral resolution, coverage of the parameter space,  (a)  131 115 2500 1000 Pickles (1998) NGSL (b)  378 167 1025 1000 Gregg et  Notes.The term N * refers to the number of targets.The term N sp indicates the number of spectra when it is different from the number of targets.The wavelengths are expressed in nanometers. (a) Pickles: spectra assembled from various sources. (b) NGSL, Gaia-FGK: High signal-tonoise. (c) MILES: spectrophotometry. (d) SDSS-BOSS: spectral templates assembled from low-resolution spectra extending down to spectral type L.
(Allende Prieto et al. 2008).In the visible, another example is the Gaia-ESO Survey (Gilmore et al. 2012(Gilmore et al. , 2022;;Randich et al. 2013Randich et al. , 2022)), which targeted 100 000 stars in all the components of the Milky Way at medium and high resolution with GIRAFFE and UVES spectrographs.Other surveys, such as the Gaia FGK Benchmark Stars project (Blanco-Cuaresma et al. 2014), use the high-quality spectra to provide the community with benchmarks for parameter determinations and abundance derivations (Jofré et al. 2017).Projects like BRASS (Laverick et al. 2018(Laverick et al. , 2019) ) and Ruffoni et al. (2014) exploit high-quality data to attack the uncertainties in atomic data parameters (i.e.part of the systematic uncertainties underlying the production of theoretical spectra).
While huge spectral libraries are becoming available and offer invaluable input for statistical analyses, they come at the price of mandatory trade-offs in the observable parameter space.Huge numbers of targets can only be observed with reduced spectral resolution or (but often and) reduced S/N.Moreover, the individual targets in these types of observations cannot benefit from the same care in data reduction as is possible for smaller-scale projects.
While this illustrates the need for such spectral libraries, a quick look at Table 1 also shows that a large collection of spectra that has high-resolution (significantly larger than 30 000), has a high S/N, widely covers the HRD and offers high-quality data products is still missing.A noticeable exception is UVES-POP (Bagnulo et al. 2003;Borisov et al. 2023), a filler programme on the ESO-VLT instrument UVES, which delivered a database consisting of 394 spectra of high-spectral resolution and high S/N.The data reduction pipeline applied to these echelle spectra was unfortunately sub-optimal in some aspects (e.g.order matching), resulting in imperfect representations of the spectral continua.These spectra were nevertheless instrumental in studies covering a wide range of applications (see the 350 citations to the UVES-POP Messenger article), re-enforcing the need for such high-quality, high-resolution, and high S/N spectral libraries.
From 2010 to 2020, we conducted a spectral survey of bright stars from the northern hemisphere as a filler programme with the Mercator-HERMES spectrograph (Raskin et al. 2011) attached to the Mercator telescope at the Roque de Los Muchachos Observatory on the island of La Palma, Spain.The resulting library combines high-spectral resolution (85 000) and high S/Ns.It was also designed for densely sampling the HRD using optically bright objects.
As our aim is to also offer high-quality data products, including automatically normalised spectra for quick-look analyses (while being science ready in most circumstances), the present database gathers some unique properties when compared to the other libraries reported in Table 1 in terms of coverage of the HRD, spectral resolution, S/N, high-quality data reduction, and sample size.The potential uses of such an empirical library include population synthesis for galactic and extra-galactic studies, references for stellar atmosphere models, spectral classification, and studies of binaries and outreach.It may also constitute a nice reference sample to train neural networks for data-driven machine learning applications.
We present the target selection and observations in Sect. 2 and the data processing steps in Sect.3, including the principle of the instrumental response correction and of the automatic spectral normalisation.The resulting database is presented in Sect.4, along with the distribution on the sky, in the HRD or in S/N.We present some brief conclusions in Sect. 5.

Target selection and observations
Our prime goal was to sample the HRD as densely as possible while minimising the required exposure time.It was also clear A107, page 2 of 17 from the beginning that assembling a large spectral database could only be possible in the context of a filler programme.Therefore, our targets would have to be bright and observable even in poor seeing conditions as well as through thin clouds.Finally, we had to ascertain a good distribution in right ascension in order to offer possibilities for short but useful observations whenever gaps in the regular observing programmes would appear.Consequently, the original target selection was based on simple criteria.
We started compiling our sample by collecting all objects at a declination higher than −30 degrees, due to the latitude of the observatory, and with an apparent magnitude of V < 8, given the filler nature of the programme.We retrieved the corresponding 34 263 objects from Simbad and rejected the non-stellar objects (360) as well as those bearing a bad V-band magnitude quality flag (flag 'E'; 402 objects), leaving 33 511 objects (10 entries were rejected for both criteria).
We then sorted the objects by spectral type, and out of the 2006 unique spectral type strings, we selected the well-behaved strings (i.e.rejecting classifications such as 'K2/K3IIICN...' or '∼').Our goal was to build a library of reference spectra from which spectral templates could potentially be derived, but we did not aim at maximising diversity.Hence, this selection automatically removed the stars known as emission line stars as well as those known to be magnetic and/or chemically peculiar.This first selection left us with 28 247 objects.In order to bring this number down to a reasonable requirement in terms of telescope time, we then limited the input catalogue to the ten brightest objects for each type, sub-type, and luminosity class (e.g.F8V or A0III), providing a selection of 2178 targets.
The exposure time calculator of the HERMES spectrograph was used in combination with Simbad's B and V magnitudes in order to estimate the required exposure times, targeting a S/N of 200.The filler nature of the programme made it so that the final S/N was often slightly inferior when the observer was not tracking the S/N in real time or when the exposure times were so short that this was not possible in practice.
The observations were acquired over 513 different nights between April 7, 2010, andFebruary 12, 2020.The observations acquired prior to September 28, 2010, were later excluded, as no reliable meteorological data exist for that period, which hampered the correction for the molecular absorption in the corresponding 125 spectra (Sect.3.2).
In April 2013, at the request of the BRITE consortium (K.Zwintz, priv.comm.), 95 objects brighter than m v = 4 and missing from the original list were added to the sample.Seventy four O-type stars were also re-introduced at the same time to compensate for their scarcity in the original catalogue as much as possible.
In May 2014, a majority of the targets had been observed already, and the complete catalogue was re-submitted to the scheduler of Mercator-HERMES.This would restore the availability of filler targets all year long while providing interesting information on the variability or binarity for our targets.For this resubmission, a few entries had to be manually edited, to correct for inaccurate information from Simbad.In particular, three duplicate entries were removed, leaving a total of 2360 objects.
Not all objects in the catalogue were actually observed.A bias exists against the faintest targets.These are indeed more difficult to schedule, especially in the context of a filler programme.We find it is worth noting, however, that a handful of objects that were not in the original catalogue were actually observed as part of this programme at the discretion of the observers on duty during the observation shift.

Data processing
At the entrance of the telescope, any stellar spectrum S can be decomposed in a number of factors: where A e is the atmospheric extinction, A m is the molecular absorption by the Earth's atmosphere (telluric lines), and S 0 = C • N is the stellar spectrum (including the interstellar reddening).Finally, C represents the stellar continuum, that is, the ratio between S 0 and the normalised spectrum N. The spectrum S contains the effect of the interstellar absorption, which we do not correct and is consequently included in C. In the present work, we aim at providing three types of data products: the responsecorrected spectra before and after correction for the telluric lines (i.e. S atm OBJ ≜ C • N • A m and S 0 OBJ ≜ C • N, respectively) and the normalised spectra N of the telluric-corrected spectrum.
To this aim, we considered three types of measurements: observations of scientific targets, observations of spectrophotometric calibrators, and flat-field exposures.After subtraction of the electronic offset, these measurements can be expressed as: The left-hand sides of these equations represent the three types of measurements, and FF SED expresses the global shape of the flat-field signal imposed by the spectrum of the lamps and the filters used for these measurements.ℜ ′ = ℜ • B • P describes the instrumental response in which B represents the blaze function driving the response inside every order of the echelle spectrometer, P is the pixel response non-uniformity (PRNU), and ℜ (hereafter called 'the response') captures the remaining instrumental effects.The complex shape of the response ℜ is determined by the flat-field procedure in the HERMES instrument, which relies on the combination of a high-powered tungsten lamp with red blocking filters to obtain enough blue photons and a low-powered tungsten lamp for the red spectral orders (Raskin et al. 2011).The response ℜ is both wavelength and time dependent.The wavelength dependence describes the relative spectral response function (RSRF), and the time dependence takes into account possible variations of the environmental conditions (temperature, atmospheric pressure, and humidity), instrument ageing, and (in our case) residuals with respect to the average atmospheric extinction (see Sect. 3.2 below).Formally, the response encapsulates the flux calibration coefficient, which we disregard in this work, as our spectra are not calibrated in flux.
The flat-field exposures are usually acquired at the beginning and the end of the night.The celestial calibrators are objects whose spectra are known from accurate modelling.One such object was observed every night whenever possible.We used the celestial calibrators to correct for the instrumental response (Sect.3.3).

Pipeline
The raw 2D echelle spectra were first processed with the standard HERMES pipeline, which includes bias correction, background subtraction, flat-field correction, cosmic-ray clipping, order merging, and wavelength calibration, including barycentric correction (Raskin et al. 2011).The wavelength calibration A107, page 3 of 17 is based on a spectral mask containing 1600 carefully selected isolated Th, Ar, and Ne lines.This mask contains the 2D pixel coordinates and identification of all lines.During the wavelength calibration, the positions of these lines were carefully measured in the 2D extracted pixel-order space.Except for the bluest and the two reddest orders, the wavelength calibration per order is based on 20 to 50 spectral lines.A 2D polynomial fit of the order (8,8) in pixel-order space determines the wavelength calibration.The inter-order calibration is typically better than 50 m s −1 , as evaluated from a cross-correlation measurement using a ThArNe spectral mask on a ThArNe extracted file.For order 40, which is the reddest spectral order, we had to derive the calibration from only one Ne line, and the wavelength calibration is significantly poorer.
We measured wavelength calibration frames typically just before and after the astronomical night, with one additional calibration in the middle of the night.Since the spectrograph is not mounted in a vacuum tank, it is subject to atmospheric pressure variations.Nevertheless, thanks to the control and stability of the temperature within the spectrograph room, the velocity stability is good, with a 1 σ level of 60 m s −1 on 3432 measured radial velocity standards over a period of 10 years.For the purpose of line identification and the spectral characterisation of stellar sources, this wavelength stability and calibration homogeneity is excellent.
The flat-field correction is a mandatory step to remove the PRNU and the effect of the blaze function in every order prior to order merging.Dividing by the flat-field nevertheless artificially imposes the shape of 1/FF SED onto every spectrum thus corrected.The output of the pipeline hence consists of 1D spectra still influenced by the effects of the Earth's atmosphere and the newly introduced shape of the flat-field.

Atmospheric extinction and telluric correction
To correct for the atmospheric extinction A e , a wavelength and airmass dependent atmospheric correction was applied following the tabulated values for the Roque de Los Muchachos Observatory on the island of La Palma 1 .This resulted in an underestimation of the extinction for part of the observations (e.g.those performed under thin clouds).We note however that despite the filler nature of our programme, a fair fraction of the observations were executed under average to good weather conditions, as the short exposure times and extensive coverage of the sky offered easy-to-schedule solutions to fill short gaps in the regular observing programmes.
To correct for the telluric contamination A m , we used the publicly available tool molecfit (Smette et al. 2015; Kausch et al. 2015).By combining essential input from the Mercator weather station with a molecular line database and a radiative transfer code, molecfit models the instrument line spread function and atmospheric content at the time of the observation2 .The wavelength ranges and molecules included in the fitting procedure are listed in Table 2.For every region included in the fit, the continuum is estimated locally using a first-order polynomial.The molecfit tool also corrects for any minor wavelength shifts by fitting the wavelength with a second-order Chebyshev polynomial.The differences with the original wavelength calibration  were found to be negligible (≤100 m s −1 ).Hence, we kept the original wavelength calibration in the final products.
After correction, the spectra showed residuals of ∼5% of the continuum in the telluric bands, with the exception of the saturated lines (Fig. 1).While fitting saturated lines, the division of two small numbers often results in large residuals (the oxygen band around 7600 Å is often impacted this way).In the region above 8950 Å , we observed 'P Cygni'-shaped residuals due to a small imperfection of the wavelength calibration solution at the very edge of the spectra.In order for the user to estimate the impact of molecfit on the data, we provide both versions of the spectra, that is, before and after correction.

Response correction
At this stage, the spectra could be expressed as: where 'FF' and '0' indicate that the flat-field and atmospheric corrections have been applied and f f ≜ FF SED • ℜ.
If we define an effective instrumental response R combining the system response with the effect of the flat-field process, that is, A107, page 4 of 17 Notes.Errors on the astrophysical parameters derived from atmospheric modelling in GSSP are on the order of 100 K in T eff , 0.1 dex in log g, 1 km s −1 in v sin i, 0.1 km s −1 in v mic , and 0.1 dex in [M/H]. (a) The model for this object was taken from the synthetic library of Munari et al. (2005).
we can express the final spectrum corrected from the instrumental response, the effects induced by the flat-field correction, and the effects from the atmosphere as: One calibration star was observed every night when possible as part of the normal calibration set of HERMES, aiming at a daily determination of R.These targets were carefully selected for this purpose, as they are well documented in the literature and have reliable models established by a series of independent publications.All of these targets were analysed with the LTE spectral-fitting code GSSP (Tkachenko 2015).The GSSP code generates synthetic spectra using the SYNTHV radiative transfer code (Tsymbal 1996) combined with a grid of atmospheric models from the LLMODELS code (Shulyak et al. 2004).These synthetic spectra were then fitted to the highest-S/N observed spectrum for each star in the HERMES archive.The atmospheric parameters T eff , log g, projected rotational velocity (v sin i), microturbulent velocity (v mic ), and the metallicity ([M/H]) as well as their corresponding uncertainties were then determined from the distribution of χ 2 values of the fit of each synthetic spectrum to the observed spectrum.We then used the parameters in the LLMODELS grid closest to our best-fitting values as the input to generate the spectral energy distribution models of our calibrators.An example of the fit is shown in Fig. 2. The list of calibrators, the astrophysical parameters of the selected models, and the number of nights they were observed are presented in Table 3.
We first smoothed the result of the division of the calibrator spectrum by the model in Eq. ( 7) with a median filter and then fitted it with a spline in order to produce a smooth yet accurate representation of the effective response before injecting it in Eq. ( 8).This was necessary in order to avoid introducing the noise resulting from the observation of the calibration star or local residuals from its model into the corrected spectra.The density of the knot points used to fit the spline was chosen locally, depending on the complexity of the response.Due to the intrinsic width of Hα, we noted that the spline occasionally overfitted that spectral line, introducing some local features at the few percent level around it in the response.Hence, we recommend some caution for this line, especially for nights where the response was derived from GSC4293-0432 or HD 46300 (identifiable from the fits header entry STDNAME; see Appendix A).
Once the effective response was established for the night, all spectra obtained over the corresponding night were divided by it, resulting in a reliable representation of the continuum shape.The derivation of the instrumental response for a night is illustrated in Fig. 3, and an example of response-correction of a sciencespectrum is displayed in Fig. 4.
At this stage, three of the coldest objects accepted as calibration stars in the observation planning had to be rejected because some low-frequency component of their continuum was not properly reproduced by the models, thus inducing systematic residual features in the instrument response model (HD 220657, HD 226826, and HD 185395, with T eff = 6000, A107, page 5 of 17 Fig. 3. Derivation of the effective response for a night (Eq.( 7)).The spectrophotometric calibrator star used in this example is HD 42818.Top: the spectrum corrected for flat-field and atmospheric effects ( f 0,FF cal ).Middle: model SED used to derive the response (S 0 CAL ).Bottom: the derived effective response in red which is fit with a spline in black ( R).The knot points used to fit the spline are shown with vertical lines.6500, and 6900 K, respectively).The corresponding nights were considered not to have any reference spectrum for the response derivation.Including those nights, no calibration star could be observed for over 129 of the 479 nights encompassed by this programme, corresponding to 1007 spectra in total (31%).The effective response derived for the nearest night in time was then used instead.We find it important to note that the shape of the flat-field affects the effective response.This change in the FF SED depends on the temperature of the lamps, which is not monitored.Hence, we cannot control the applicability of a given response (derived from another night) to a given night.As a result, for such nights, most of the response corrections have a higher degree of inaccuracy, which may lead to some low-frequency signatures in the instrument-response corrected spectra.In order to easily identify the corresponding spectra, we introduced a dedicated Boolean keyword called 'STDNIGHT' in the fits headers, and set it to zero when the response could not be computed from calibration observations obtained on the same night (see Appendix A).
To quantify the uncertainty introduced by correcting spectra with a response established from another night, we first re-scaled all responses to an average of one over the range [5400, 5600] Å.We then computed the ratio of each response by that of the next night in our programme.The standard deviation of the resulting dataset is presented in red in Fig. 5.The additional uncertainty is limited to less than 5% over the range between 4100 and 6750 Å.Beyond 7000 Å, the variability compared to our reference range is significantly larger, peaking at almost 17% at 7950 Å.This is expected because, as stated above, that part of the spectrum  is illuminated with a different lamp during the flat-field measurements, hence inducing larger differences between the bluest and reddest parts of the response as the two lamps may react differently to the various measurement conditions.For the sake of completeness, we also analysed the variability of the response over the entire programme.Therefore, we computed the median response and divided all of the responses by it.We then computed the standard deviation of the result as a function of the wavelength.The result is displayed in Fig. 5 and indicated by the grey dashed line.Although the variability over the entire programme is significantly larger than between subsequent observing nights, hence suggesting some kind of monotonic evolution of the response, we observed a more irregular behaviour.Our efforts to identify the driving parameters for A107, page 6 of 17  that variability (e.g.environmental parameters or ageing of the lamps) nevertheless remained unsuccessful.

Normalisation
The procedure to pseudo-normalise the HERMES spectra was eased by the previous steps of the data reduction, but it remained challenging since the spectral range to normalise runs over more than 5000 Å. Manual pseudo-normalisation tools exist, but they render the normalisation process highly time-consuming and do not ensure the repeatability of the result.Recent development to make automatic and tunable normalisation processes has emerged based on the convex-hull and alpha-shape theories, such as AFS (Xu et al. 2019) and RASSINE (Cretignier et al. 2020), and even based on machine learning techniques, for example, using deep neural networks (Różański et al. 2022).In this work, we rely on a more classical approach based on a iterative filtering method similar to the ones that use a sigmaclipping process, as done, for example, on a smaller wavelength extent in Muñoz Bermejo et al. ( 2013  We provide normalised spectra when the best d score is lower than 0.24.The spectra excluded from the normalisation process represent about 6% of the sample and are made of M-, S-, and C-type stars.See text for details.Paletou et al. (2015).Given that our approach to normalisation relies on the pseudo-continuum as measured rather than on the true continuum of the object, it underestimates the continuum in the blue, especially for cold objects, and we hence refer to it as 'pseudo-normalisation'.
It is often argued that high-order polynomials are not flexible enough.This is true when the normalisation process occurs directly on the merged échelle spectra (top panel of Fig. 4), which is not corrected from the instrumental response function (middle panel of Fig. 4).In our case, the polynomials are fitted to the response-corrected spectra, whose shapes are much smoother (bottom panel of Fig. 4), except for late M-type stars, where strong molecular bands render this approach inappropriate (and the normalisation is skipped; see below).
Our normalisation process can be divided into five steps: First, we smooth the response-corrected spectrum using a Savitzky-Golay filter with a third-order polynomial and a window length of 5 pixels.This allows for the smoothing of any possibly remaining cosmics or noisy parts of the spectrum (mainly below 4000 Å).Second, for computational reasons, we undersample the smoothed version of the response-corrected spectrum by a factor 20, resulting in spectra with about 8400 samples evenly spaced in log-wavelength.Third, we compute a grid of normalising functions.Those functions are Chebyshev polynomials of different degrees between zero and 40.Each function results from an iterative process described in the next paragraph.Fourth, a score is attributed to each of the normalisation functions reflecting their quality.Fifth, the score is used to select the best normalisation function in the grid.
The iterative process in the third step goes as follows: After the polynomial fit, we filter out all samples from the spectrum falling under the fit and proceed to fit the same polynomial on the remaining samples.At each iteration, a normalised spectrum is computed whose quality is assessed by a score 'd': A107, page 8 of 17 where p is the median of all flux samples above one and n is the median of all samples below one.As the best estimate of the normalised spectrum, we accept the result realising the smallest score d over all iterations and all polynomial orders (d is positive by construction).
This process nominally runs over ten iterations but is occasionally halted before by an additional stop-criterion that imposes a minimum sampling density over the entire wavelength range.We indeed imposed that at least 100 wavelength samples remain in the filtered spectrum per range of 1000 Å.Without this, the filtering, which is increasingly aggressive as iterations progress, may result in gaps in the wavelength coverage, leading to ill-behaved solutions to the fits.
An example of the selection of the best function for a given polynomial order is illustrated in Fig. 6 for an early-type (top panel) and a late-type spectrum (bottom panel).Figure 7 shows the behaviour of the d score computed in the course of the fitting process of the same spectra, that is, the successive iterations for a given polynomial order.
The d score is closer to zero when fewer absorption lines are present in the spectra (compare the left and right panels of Fig. 7 for a B2V-type star with fewer absorption features than the G5III-type star).High d scores reflect a poorer normalisation but may also be correlated with the decreasing sampling in wavelengths due to the filtering, as explained above.Of course, the error bars on the d score are also an indication of the quality of the normalising functions.The error bars on d are based on the median absolute deviation for scores p and n, as this is more robust to outliers than the standard deviation, and propagated to d via Eq.( 9). Figure 8 illustrates the final normalising functions and normalised spectra for the stars presented in Fig. 6.A polynomial degree 26 at the third iteration gives the best d score for HD3901 (B2V), and a polynomial degree 28 at the fourth iteration gives the best d score for HD 41116 (G5III).
The presence of telluric lines at the red end of the spectra resulted in poor access to and hence a poor representation of the continuum longwards of 8950 Å.This lead us to discard the last 50 Å of the normalised spectra.
Finally, we decided not to provide normalised spectra for the latest spectral types presenting significant molecular bands.We used a criterion based on the d score for the cut-off.The score indeed shows a positive trend with B − V, as displayed in Fig. 9.A turn-off appears around B − V = 1.6.It is produced by longperiod variables, which are all (asymptotic) red giants of spectral types M to C (Lebzelter et al. 2023).For the giants (luminosity class III), which make up the bulk of our sample of M-type stars, the B − V color index reaches a maximum value of 1.65 for M5, then decreases to 1.50 for M8, as shown in Table 1 of Fitzgerald (1970).The main sequence does not show this turnover, but our sample only includes three main-sequence M-type stars, explaining the depletion at larger B − V. Hence, to define the cut-off for the normalisation, we adjusted a quadratic B − V function with respect to the log d best score.This provided a maximum value of the d best = 0.24 for which we provide normalised versions of the spectra.We confirmed that the criterion is appropriate by visual inspection.The median B − V of the spectra with larger d best is 1.6.The excluded spectra represent about 6% of the MELCHIORS database (201 spectra corresponding to 156 stars) and are mainly made of M giant and sub-giant stars A107, page 9 of 17 Royer, P., et al.: A&A, 681, A107 (2024)  as well as S-and C-type stars, with significant expression of molecular bands.

Stellar content
The MELCHIORS database is made of 2043 stars (excluding the Sun) all above a declination of δ = −30 • since they were observed from the island of La Palma. Figure 10 shows the distribution of the MELCHIORS targets on the sky (in equatorial coordinates).An overdensity of early-type stars traces the disc of the Milky Way.The targets are colour-coded with their colour index B − V.The lowest values, representing the hottest stars, mainly trace the disc and bulge, while the highest values, representing the coolest, reddest, and the most likely to be giant stars, are rather located in the halo.The distribution of the targets in the V-band magnitude is displayed in Fig. 11 and includes the brightest stars of the northern hemisphere.The median V magnitude of the targets is 5.9.We compared our sample with the absolute numbers of stars in the Simbad database with a declination larger than −30 • , in bins of one magnitude 3 .The completeness of the MELCHIORS database compared to Simbad is ∼80% for V ≤ 4 but drops to 55% for V ≤ 6.Excluding the Sun, the apparent brightest target is Arcturus (α Boo), while the faintest star is HD 286340, which is an SC7/8 star.Most of the MELCHIORS stars have spectral types and Vband magnitudes available in Simbad.We cross-matched targets without a spectral type or V-band magnitude with the catalogue of Stellar Spectral Classifications (Skiff 2014) in order to gather the missing information.For HD 88133, we adopted the Gaia magnitude because the information was not available in Skiff (2014).For HD 114762, we adopted the V magnitude of the primary object (V = 7.3; removed from Simbad in 2018) rather than the most recent reference in Skiff (2014), corresponding to the very faint M9 companion (V = 15; Patience et al. 2002;Bowler et al. 2009).
Figure 12 presents the number of MELCHIORS stars per spectral type (OBAFGKM) also including a few Wolf-Rayet (WR) and evolved S-type and C-type (S/C) stars.Due to the bias of our sample towards low apparent magnitudes, this distribution does not reflect the stellar initial mass function.Instead, it is biased towards the brightest and hottest stars, while about 99% of all stars are of a spectral type later than A. The luminosity classes are also biased.While we expected about 10% of the stars to have 3 These numbers were obtained by using the 'Simbad: query by criteria' with the search expression Vmag >= X & Vmag < X + 1 & dec > -30 & otypes = '*', where X varies between −1 and 12 per step of 1 magnitude.The latest condition on otypes ensures the exclusion of the non-stellar objects from the query.evolved off the main sequence, giants and supergiants (luminosity classes I, II, and III) represent between one-quarter to more than one-half of the number of stars in our sample, as a function of the spectral type.About 11% of the targets do not have a luminosity class in the Simbad database and are represented in A107, page 10 of 17 grey in Fig. 12.The summary of the MELCHIORS database per spectral type and luminosity class is given in Table 4.
We display the distribution of MELCHIORS stars per Simbad type in Fig. 13.About 29% of the objects are normal single stars, and 27% are flagged as high proper motion stars.We stress that about 24% of the library is related to stellar multiplicity (227 spectroscopic binaries, 196 double or multiple stars, 42 eclipsing binaries, 22 variable star of β Cep type, 1 high-mass X-ray binary, 1 symbiotic star, 1 composite object, and 1 ellipsoidal variable star).This gives a general overview of the type of objects in the MELCHIORS database as reported in Simbad.(Nonetheless, we advise the reader to keep in mind that the Simbad database is constantly being updated and that the distribution of object types reflected in Fig. 13 provides but a snapshot of the knowledge gathered in the Simbad database around March 2022.)

Gaia colour-absolute magnitude diagram
We cross-matched the MELCHIORS database with Gaia DR3 using a cone search radius of 1 arcsec that was iteratively increased if no match was obtained until 3 arcsec at maximum.We obtained a positive cross-match for a sub-sample of 1690 of the 2043 stars.Among them, one has a negative parallax, and 97 do not have any parallax at all.These mainly correspond to very bright targets.A colour-absolute magnitude diagram of the MELCHIORS stars is displayed on Fig. 14 for the sub-sample of 1592 stars for which parallaxes and photometry are available from Gaia DR3.The main sequence is poorly populated in G, K, and M stars compared to the giant branch for those types, due to a combination of two factors.First, the magnitude-limited selection imposes a bias against cool main-sequence stars with respect to their giant counterparts (see Fig. 12 and Table 4).Second, the fraction of high proper-motion stars is important (80 of the ∼140 G, K, and M main-sequence stars), and those stars were filtered out by the cone search radius.The error bars on the colour and G magnitude were computed according to Eq. ( 12) of Merle et al. (2020) since it is not directly provided in the Gaia DR3.The uncertainties on the absolute magnitudes were obtained by propagating errors on parallaxes and G magnitudes.The position of the Sun is represented with the dotted line at G BP − G RB = 0.82 and M G = 4.67 (Casagrande & VandenBerg 2018).The asymptotic giant branch (AGB) reaches a saturation in absolute G magnitude due to strong molecular absorptions in this wavelength range, explaining the horizontal shape of the AGB in the Gaia colour-absolute magnitude diagram.

The spectra
The MELCHIORS database is made of 3256 high S/N spectra of the 2043 selected stars covering the wavelength range [3800, 9000] Å with the spectral resolution of R = 85 000 of the HERMES spectrograph on the Mercator telescope.Figure 15 shows the S/N distribution of the spectra at the effective wavelengths of the U, B, V, R, and I filters, as estimated from the counts in the corresponding wavelength bins of the original 2D spectra (spot checks in the final products indicate this to be conservative).Except in the U band, the median S/N is larger than 110 in all bands, and it reaches 200 in the V and R bands.
Figure 16 represents the number of spectra per star, and shows that 50% of the stars have more than one spectrum.The binaries, overplotted in red in the figure, were selected from the main Simbad object types.They represent about one-fourth of the database.The stars with more than eight spectra are individually identified in the figure.
We rejected HD 205767 (ξ Aqr) from the catalogue.Though it was seemingly acquired at the correct celestial coordinates, our spectrum did not match the spectral type of that object.Also, we did not investigate the stellar binary content of the MELCHIORS database in detail but relied on the main Simbad type.Consequently, we could have missed some binaries, or we may provide a simple view on debated objects.As an example, HD 188001 (9 Sge), a runaway O-type star, is the star with the highest number of spectra (23) in the MELCHIORS database.Its main object type in Simbad is blue supergiant, while it is also known as a spectroscopic binary in the SB9 database (Pourbaix et al. 2004), with orbital parameters from Aslanov & Barannikov (1992).Nevertheless, this star could also be a single star, according to    2007), while Aldoretta et al. (2015), suggesting constant RV, mentioned the star as having an unresolved companion.We also mention that there are 56 non-single stars identified from the Gaia-DR3 cross-match: 24 astrometric binaries, 24 spectroscopic binaries, 7 astro+spectro binaries, and one eclipsing binary (the blue supergiant HD 167971).They can be retrieved using the meta-data described in Appendix A.4.3.We note that an individual analysis of every object is nevertheless beyond the scope of the present paper.Finally, we illustrate the variety of spectra in our database by presenting a sample of spectra over a sequence of spectral types (OBAFGKM) and luminosity classes (V, III, I) in Fig. 17  spectra (see Sect. 3).The spectrum is set in the barycentric restframe of the Solar System and corrected from the radial velocity of Ganymede.The S/N is about 560 at 5000 Å. Figure 18 presents the solar spectrum corrected from instrumental response and from tellurics in the top panel.As already mentioned for the other stars, we noticed an imperfect normalisation at both ends of the spectrum.In the blue, this is due to the presence of many metallic lines, including strong ones (the Ca II H and K lines at 3968.47 and 3933.66Å, the Fe I L line at 3820.44 Å, and others, including strong lines of Mg I).In the red, this is due to the presence of telluric lines.In the bottom panel of Fig. 18, we show a focus around Hα at 6562.81 Å.
We compared it with two recent observed solar spectra: (i) the IAG solar flux atlas from a Fourier transform spectrograph A107, page 12 of 17  with a resolution of R = λ/∆λ ∼ 10 6 (Reiners et al. 2016) and (ii) the PEPSI solar spectrum at the LBT with a resolution of R = 270 000 (Strassmeier et al. 2018).The two comparison spectra were degraded at the resolution of HERMES by convolving them with a Gaussian profile of width σ = 3.5 km s −1 , which corresponds to a resolution of R = 85 000.The comparison shows that the radial velocity correction was well performed.We note that the MELCHIORS reference spectrum is well corrected for the tellurics, which are clearly visible in the two other spectra at different intensity levels.Our solar reference spectrum also shows excellent agreement with the solar atlas from Beck et al. (2016), also produced with HERMES, as well as with the highresolution spectrum from Wallace et al. (2011).Interestingly, and with the exception of the ELODIE (Prugniel et al. 2007) and Gaia-FGK libraries (Blanco-Cuaresma et al. 2014), no solar spectrum is provided in the optical spectral libraries reported in Table 1.

Summary
The spectral library presented in this work gathers 3256 spectra of 2043 stars of all spectral types and luminosity classes, including the Sun as a star (with a spectrum of Ganymede).The spectra cover the full visible spectral range [3800, 9000] Å with high resolution (R = 85 000) and with a median S/N reaching 200 in the V band.In addition, the spectra were acquired in a consistent way and with a single instrument.This is, to our knowledge, a unique combination in comparison to existing optical empirical libraries.Special care was taken in the data reduction, allowing us to provide the spectra in four different flavours: raw, corrected from the instrumental response, with and without correction from the atmospheric molecular absorption, and normalised (including the telluric correction).As with any automatic processing, we recommend using the final products with caution, especially for the analysis of wide spectral features such as Hα.
The sample is ∼80% complete up to V = 4 for declinations δ > −30 • and has a median magnitude of V = 5.9.The spectral library contains two or more spectra for about 50% of the targets.All spectra are available in CDS as well as via an online repository 4 .

Fig. 1 .
Fig. 1.Effect of the telluric correction on a spectrum from HD 19356 (B8V).In red: the spectrum before the correction.In black: the spectrum after correction with molecfit.The insert shows the region around Hα. Whereas weak lines are usually very well corrected, large correction residuals do appear at the level of saturated telluric lines.

Fig. 2 .
Fig.2.Best-fitting normalised spectroscopic model (in black) of the highest-S/N observed spectrum of HD 149212 (in blue), focussing on the wavelength region between the H γ and H β .

Fig. 5 .
Fig. 5. Variability of the instrumental response.Red: standard deviation of the ratio between subsequent responses derived for our programme indicative of the additional uncertainty on the low-frequency components of the continuum for the stars with STDNIGHT=0.Grey: standard deviation computed over all responses, regardless of their acquisition time.(See text for details.)

Fig. 6 .
Fig. 6.Illustration of the iteration process in a given Chebyshev polynomial order for an early-type star (top) and a late-type star (bottom), focussing on the wavelength range [3750, 5000] Å. Top: order 26 for HD 3901 with spectral type B2V.Bottom: order 16 for HD 41116 with spectral type G5III.The successive polynomial fits start with the thick black line, representing the first iteration, and progress towards the green line, representing the iteration with the best d score.For the sake of completeness, the iterations corresponding to the best p and n scores are represented as well, in red and blue respectively.The final selection is based on d, combining p and n.

Fig. 7 .
Fig.7.Evolution of the d scores with the number of iterations for a given polynomial order applied to the same spectra as in Fig.6.Left: order 26 for HD 3901 with spectral type B2V.Right: order 16 for HD 41116 with spectral type G5III.The numbers given below each point represent the number of the selected wavelength points (over the full wavelength range) in the polynomial fitting.

Fig. 9 .
Fig. 9. Best d score as a function of B − V. We provide normalised spectra when the best d score is lower than 0.24.The spectra excluded from the normalisation process represent about 6% of the sample and are made of M-, S-, and C-type stars.See text for details.

Fig. 10 .
Fig. 10.Sky distribution of the objects from the MELCHIORS catalogue.The size of the symbols is related to their apparent V magnitude.

Fig. 11 .Fig. 12 .
Fig. 11.V-band magnitude distribution of the MELCHIORS stars compared to the stars listed in Simbad with declinations larger than −30 • .The median V-band magnitude of MELCHIORS stars is 5.9.

Fig. 14 .
Fig. 14.Colour-absolute magnitude diagram of the MELCHIORS stars using astrometric and photometric Gaia DR3 data.Apparent visual magnitudes and S/N of the best spectrum per star are also encoded.The intersection of the dotted lines shows the position of the Sun.

Fig. 15 .
Fig. 15.Distribution of the spectra as a function of S/N in the U, B, V, R, and I wavelength ranges.McSwain et al. (2007), whileAldoretta et al. (2015), suggesting constant RV, mentioned the star as having an unresolved companion.We also mention that there are 56 non-single stars identified from the Gaia-DR3 cross-match: 24 astrometric binaries, 24 spectroscopic binaries, 7 astro+spectro binaries, and one eclipsing binary (the blue supergiant HD 167971).They can be retrieved using the meta-data described in Appendix A.4.3.We note that an individual analysis of every object is nevertheless beyond the scope of the present paper.Finally, we illustrate the variety of spectra in our database by presenting a sample of spectra over a sequence of spectral types (OBAFGKM) and luminosity classes (V, III, I) in Fig.17. .

4. 4 .Fig. 16 .
Fig. 16.Number of spectra per star on a logarithmic scale.The distribution of known Simbad binaries is overplotted in red.The name of the stars with more than eight spectra are indicated.The MELCHIORS star with the highest number of spectra, HD188001 (9 Sge),is an O-type runaway blue supergiant, that could also be a spectroscopic binary (see text for details).

Fig. 17 .
Fig. 17.Examples of normalised spectra.Top: Spectral type sequence -OBAFGKM.Bottom: Luminosity class sequence -V, III, I. We use a black background for a better visualisation of the colours of the corresponding stars, following M. Charity's work (http://www.vendian.org/mncharity/dir3/starcolor/UnstableURLs/starcolors.html), who derived chromaticity and rgb-pixel colour from spectra for various stellar types and/or classes, providing physically motivated colours.

Fig. 18 .
Fig. 18.MELCHIORS solar reference.Top: MELCHIORS solar spectrum.The response and telluric corrected spectrum is shown in black and the normalised spectrum is shown in red.Bottom: excerpt around Hα compared to the IAG (Reiners et al. 2016) and PEPSI (Strassmeier et al. 2018) solar spectra degraded to the resolution of HERMES.Note the correction for the telluric lines performed in the MELCHIORS solar spectrum, in contrast with the other spectra.A107, page 13 of 17

Table 2 .
Wavelength ranges and the respective molecules included in the fitting process with molecfit.

Table 3 .
Calibration stars used for the instrumental response correction, including their observation frequency and the astrophysical parameters used as input to generate our SED models.

Table 4 .
Number of stars per spectral type and luminosity class (excluding the Sun).
Simbad types of stars in the MELCHIORS database.