# 5.3.4 Internal Calibration

The internal calibration of the spectra follows a similar flow as the photometric calibration. Also in this case, no external data is used in the calibration process and therefore the reference catalogue of mean source spectra needs to be established in an iterative way.

## Flux and LSF Calibration

A set of calibrators (see Section 5.3.4) is selected trying to maximise the number of sources in less-populated instrument configurations and the mixing between different calibration units. A full description of the flux and LSF model can be found in Carrasco et al. (2021) and it includes sensitivity and LSF variations, deviation from the nominal dispersion function and AC flux loss (this effect was not activated in Gaia DR3). Here just a summary will be given.

Before entering the internal calibration spectra are calibrated for the differential dispersion function to bring all sample AL locations in the same internal system, called pseudo-wavelength. Using the pseudo-wavelength $u$ it is possible to represent the spectrum $h_{s,k}$ of a source $s$ observed in the calibration unit $k$ as a discrete convolution of the mean spectrum defined as a linear combination of some bases $\sum_{n=0}^{N}b_{s,n}\phi_{n}$ with the following equation (corresponding to Eq. 9 in Carrasco et al. (2021))

 $h_{s,k}(u_{i})=\sum_{n=0}^{N}b_{s,n}\sum_{j=-J}^{J}A_{k}(u_{i},u_{i+j})\ % \varphi_{n}(u_{i+j})$ (5.1)

where the convolution kernel $A_{k}$, representing the actual calibration, is a linear combination of polynomial bases and can be described as

 $A_{k}(u_{i},u_{i+j})=\sum_{l=0}^{L}c_{jl}(u_{i}-u_{ref})^{l}$ (5.2)

and $u_{ref}$ is a reference pseudo-wavelength chosen in a convenient way. To take into account the variation of the calibration with the AC coordinate, the coefficients $c_{jl}$ are defined as a polynomial in AC coordinate. For Gaia DR3, polynomials of degree 2 and 3 were adopted respectively for the pseudo-wavelength dependency and the AC coordinate dependency.

The initialisation of the reference spectra is an iterative process starting with an identity calibration and performing at each step an update of the mean source spectra (Source Update) using the latest calibration and a new calibration computation based on the latest reference catalogue (Instrument Calibration). The initialisation process only uses data from the INIT period, chosen to cover ranges of time when the contamination level was at its minimum. The INIT period For Gaia DR3 is the same used for the photometric processing and corresponds to $[2574.7,2811.7]$ and $[4121.4,5230.1]$ in OBMT Rev.

Once the reference catalogue is established, calibrations covering all times and configurations can be computed using all observations for the calibrators. These can then be applied to all sources to generate a complete BP/RP mean spectra catalogue. For more details on how this is carried on, see De Angeli et al. (2022).

## Calibrators selection

The main criteria used to select the calibrators are the following: first of all the selected sources should not show signs of variability during the time range when they have been observed and they are isolated, i.e. they are not contaminated by the flux of other stars, be this a faint star inside the window or the tail of a bright star. Furthermore their observations should not be affected by detector issues, for instance no problems in the read out nor dead pixels or charge injections (see also Section 3.3.3 for more details on these kind of issues). Since we need to calibrate all kind of sources, also the calibrators will have to include the widest ranges of magnitude and colours: for Gaia DR3 sources in the colour range -2.0$<$$G_{\rm BP}$$G_{\rm RP}$ $<$5.0 and in the magnitude range 5.0$<$$G$ $<$17.0 were selected. Brighter stars can also be included, with the caveat to have a number of transits in $G_{\rm BP}$ and $G_{\rm RP}$ bigger than 10, to guarantee a good coverage for observations affected by gates. Finally in order to avoid to skew the calibration toward the most common objects, the distribution in colour should be uniform, hence adopting a weighting scheme especially for sources with extreme colours, when the flux in one of the photometer (BP for extreme red objects, RP for extreme blue objects) will be very low. With the application of these criteria, 7.6M of internal calibrators were obtained in Gaia DR3. See also De Angeli et al. (2022) for more details.

## Mean Spectra generation

The mean spectra are defined as a superposition of basis functions (see Equation (5.1)). Hermite functions were chosen in the latest processing, but an ad hoc transformation was applied to them to ensure that the first bases were the ones describing most of the spectral features.

The integral of the function describing an internally calibrated source mean spectrum over the ranges defined for the SSCs (see Section 5.1.1) provides the colour information used in the photometric processing Section 5.4.1).

The mean spectra can be in two different formats: