Euclid preparation. XXX. Performance assessment of the NISP red grism through spectroscopic simulations for the wide and deep surveys

This work focusses on the pilot run of a simulation campaign aimed at investigating the spectroscopic capabilities of the Euclid Near-Infrared Spectrometer and Photometer (NISP), in terms of continuum and emission line detection in the context of galaxy evolutionary studies. To this purpose, we constructed, emulated, and analysed the spectra of 4992 star-forming galaxies at 0 . 3 ≤ z ≤ 2 . 5 using the NISP pixel-level simulator. We built the spectral library starting from public multi-wavelength galaxy catalogues, with value-added information on spectral energy distribution (SED) ﬁtting results, and stellar population templates from Bruzual and Charlot (2003). Rest-frame optical and near-IR nebular emission lines were included using empirical and theoretical relations. Dust attenuation was treated using the Calzetti extinction law accounting for the di ﬀ er-ential attenuation in line-emitting regions with respect to the stellar continuum. The NISP simulator was conﬁgured including instrumental and astrophysical sources of noise such as the dark current, read-out noise, zodiacal background, and out-of-ﬁeld stray light. In this preliminary study, we avoided contamination due to the overlap of the slitless spectra. For this purpose, we located the galaxies on a grid and simulated only the ﬁrst order spectra. We inferred the 3.5 σ NISP red grism spectroscopic detection limit of the continuum measured in the H band for star-forming galaxies with a median disk half-light radius of 0 . (cid:48)(cid:48) 4 at magnitude H = 19 . 5 ± 0 . 2ABmag for the Euclid Wide Survey and at H = 20 . 8 ± 0 . 6ABmag for the Euclid Deep Survey. We found a very good agreement with the red grism emission line detection limit requirement for the Wide and Deep surveys. We characterised the e ﬀ ect of the galaxy shape on the detection capability of the red grism and highlighted the degradation of the quality of the extracted spectra as the disk size increased. In particular, we found that the extracted emission line signal-to-noise ratio (S / N) drops by ∼ 45% when the disk size ranges from 0 . (cid:48)(cid:48) 25 to 1 (cid:48)(cid:48) . These trends lead to a correlation between the emission line S / N and the stellar mass of the galaxy and we demonstrate the e ﬀ ect in a stacking analysis unveiling emission lines otherwise too faint to detect.


Introduction
The Euclid mission (Laureijs et al. 2011;Racca et al. 2016) aims to study the dark Universe with two primary cosmological probes, weak lensing (WL) and galaxy clustering (GC). To meet its primary science goals, the 6-yr Euclid observation scheme includes ∼14 500 deg 2 of the extra-galactic sky using both multi-band imaging and low-resolution slitless spectroscopy. The resulting survey is the Euclid Wide Survey (EWS; Scaramella et al. 2022) and will be complemented with the Euclid Deep Survey (EDS; Scaramella et al., in prep), which will cover ∼ 40 deg 2 and reach two magnitudes fainter.
Euclid has been designed to probe the Universe since redshift ∼2, which corresponds to the cosmic time when dark energy started to drive the accelerating expansion of the Universe (Amendola & Tsujikawa 2010). The survey will be particularly sensitive to the redshift range 0.9 ≤ z ≤ 1.8, where the Hα line falls in the EWS spectroscopic channel passband with several thousands of sources per square degree (see Pozzetti et al. 2016, Fig. 4) within the Euclid spectroscopic sensitivity (Scaramella et al. 2022). This period includes 'cosmic noon' (Madau et al. 1998;Madau & Dickinson 2014) when galaxies were particularly prolific in terms of the star-formation rate (SFR), which has been declining ever since. It also covers the redshift range 1.4 ≤ z ≤ 1.8 known as the 'redshift desert'. This redshift range has poor coverage in current spectroscopic surveys due to the strong atmospheric absorption in the near-IR where the strongest galactic optical emission and absorption spectral features are redshifted, while the strong UV features are still too blue to be observed with optical spectrographs (see Le Fèvre et al. 2015, Fig. 13).
To fulfil its objectives, two instruments sharing a field of view of ∼0.5 deg 2 will be mounted on Euclid. First, the visual imager (VIS; Cropper et al. 2016) with a spatial resolution of 0 . 18 and outfitted with one single filter covering the I E band (0.55-0.90 µm) will serve to measure cosmic shear for the WL probe. Second, the Near-Infrared Spectrometer and Photometer (NISP; Maciaszek et al. 2016) will carry out photometry (NISP-P) and spectrometry (NISP-S). The NISP-P channel includes three broadband filters in the filter wheel assembly, Y E (0.95-1.21 µm), J E (1.17-1.57 µm), and H E (1.52-2.02 µm), with a spatial resolution of 0 . 3 in all three bands (Schirmer et al. 2022). The NISP-S includes two grisms in a grism wheel assembly, the red grism (RGS) covering the RG E band (1.25-1.86 µm) and the blue grism (BGS), which will only be used in the EDS covering the BG E band (0.92-1.30 µm). The NISP-S channel is designed to provide an accurate redshift determination for emission line galaxies with σ z /(1 + z) ≤ 0.001.
Beyond the excellent performance expected from the cosmological probes, the unprecedented volume of spectrophotometric data including accurate morphological parameters for billions of galaxies and tens of millions of spectroscopic redshifts will be of great interest for legacy science purposes. In particular, the Euclid dataset will enable the community to study scaling relations, mass assembly, environmental effects, and galaxy-active galactic nucleus (AGN) co-evolution on samples including a large number of massive star-forming and passive galaxies at intermediate and high redshift.
In this paper, we focus our study on star-forming galaxies (SFGs) using the pixel simulator of the RGS channel that has been parameterised with the NISP optical performance evaluated during the ground-test campaigns (Waczynski et al. 2016; Barbier et al. 2018;Costille et al. 2019;Maciaszek et al. 2022). The simulator includes instrumental noise, for example a dark current and read-out noise, as well as astrophysical noise, for example zodiacal background and out-of-field stray light. This effort, which is part of the Euclid legacy science programme, is referred as the pilot run and is the first step of a simulation campaign. The pilot run includes simulations of thousands of SFG first order spectra, which were positioned on a grid to avoid contamination between spectra. It will be followed in the near future by the full run, which will simulate tens of thousands of spectra of a wide variety of galaxy types, for example AGNs, passive galaxies, and SFGs, and including the assessment of the contamination due to the overlapping spectra. The main objectives of our efforts have been the following: i) to develop a solid methodology to build a realistic and representative synthetic spectral energy distribution (SED) library of SFGs at 0.3 ≤ z ≤ 2.5 1 (hereafter referred as the incident spectra), including reliable emission line fluxes and widths 2 ; ii) to test the effect of the galaxy shape on slitless spectroscopy; and iii) to provide a preliminary assessment on the continuum and emission line detection capabilities of the RGS channel.
We present in Sect. 2 the data and sample selection for which SED-fitting parameters are available in publicly released catalogues. In Sect. 3, we provide a detailed procedure for constructing the incident spectra. This process begins with a template continuum, to which we incorporate the flux predictions of the nebular emission lines. The frame of the pilot run and setup of the Euclid NISP-S pixel-level simulator, that is TIPS (Zoubian et al. 2014), is presented in Sect. 4. The analysis of the 1D extracted spectra is presented in Sect. 5. A summary of the caveats of the simulations is presented in Sect. 6. The conclusion and main results are presented in Sect. 7. We adopted a ΛCDM 3 cosmology with Ω m = 0.3, Ω Λ = 0.7, and H 0 = 70 km s −1 Mpc −1 . Except if stated otherwise, we adopted in this work the extinction curve from Calzetti et al. (2000) and the parameterisation of the initial mass function (IMF) proposed by Chabrier (2003). All magnitudes are expressed in the AB system (Oke & Gunn 1983).

Preparation of the Euclid Wide Survey simulation with the COSMOS2015 catalogue
For the EWS simulation, we relied on the public multiwavelength spectro-photometric catalogue COSMOS2015 (Laigle et al. 2016, hereafter L16) that covers the COSMOS field (Scoville et al. 2007) and that we complemented with estimated morphological parameters as described in Sect. 2.5. This catalogue contains an updated version of the photometric redshifts, together with estimates of parameters including the stellar mass, dust extinction, and SFR obtained from SED-fitting for more than half a million sources. The COSMOS survey includes several spectroscopic surveys including 3D-HST (Brammer et al. 2012;Momcheva et al. 2016), FMOS (Kashino et al. 2019), and Large Early Galaxy Astrophysics Census (LEGA-C; Van Der Wel et al. 2016), which provide measurements of some of the emission lines of interest in this study (see Sect. 3.4.2). The area of 1.7 deg 2 covered by the L16 catalogue includes those rare, very massive, and bright galaxies at intermediate and high redshift that will represent the majority of spectroscopic EWS targets. The L16 catalogue was therefore chosen for the EWS simulation.
We selected sources with magnitude 17 ≤ H ≤ 24 and at 0.3 ≤ z ≤ 2.5. These limits were chosen to reach the EWS NISP-P magnitude limit of H E = 24 mag 4 (Scaramella et al. 2022), and to cover a redshift range that enabled us to probe multiple strong emission lines. Furthermore, since the target of this study are line emitters, we selected the sub-samples to be simulated among SFGs based on colour-colour diagrams available in the literature. The NUV, r, J absolute magnitudes are available in the L16 catalogue, we therefore referred to the identification criteria for SFGs proposed by Laigle et al. (2016) using the colour-colour NUVrJ diagram. These selection criteria provided us with 156 323 sources.

Preparation of the Euclid Deep Survey simulation with the BARRO2019 catalogue
For the EDS simulation, we relied on the public multiwavelength spectro-photometric catalogue BARRO2019 (Barro et al. 2019, hereafter B19) released by the Cosmic Assembly Near-infrared Deep Extragalactic Legacy Survey (CANDELS; Grogin et al. 2011;Koekemoer et al. 2011) that covers the Great Observatories Origins Deep Survey-North field (GOODS-N; Giavalisco et al. 2004). We used the SED-fitting parameters available in the B19 catalogue, that we complemented with results of Sérsic profile fits from CANDELS imaging mosaics (Van Der Wel et al. 2012), and the bulge-disk decomposition from Dimauro et al. (2018). The B19 catalogue includes spectroscopic measurements for some of the sources using the HST/WFC3 grisms G102/G141. The area of ∼160 arcmin 2 covered by the B19 catalogue consists of imaging data of galaxies at intermediate stellar mass including, on average, fainter galaxies compared to the L16 catalogue. The B19 catalogue was therefore chosen for the EDS simulation.
We selected sources with 17 ≤ H ≤ 26 and at 0.3 ≤ z ≤ 2.5 as similarly done for the L16 catalogue but going two magnitudes deeper to reach the EDS NISP-P magnitude limit at H E = 26 mag (Racca et al. 2016).
To select SFGs, we proceeded using colour-colour diagrams in a similar way as for the EWS simulation but using the U, V, J absolute magnitudes available in the B19 catalogue. We referred to the identification criteria proposed by Williams et al. (2009) using the colour-colour UV J diagram. These selection criteria provided us with 15 460 sources.

Selection of galaxies to be simulated
To avoid the spectra being overlapped, we set an upper limit of 2496 galaxies per pointing that we located on the 16 detectors of the NISP focal plane (see Sect. 4 for further details on the pixel-level simulator configuration). The emission lines flux predictions used to select a representative sample of galaxies targetted by NISP are presented in Sect. 3.2.

Sample selection to be simulated for the EWS and EDS simulations
To create a sample representative of the diversity of objects available in the catalogues, we made use of a three dimensional grid of redshift, total stellar mass, and flux of the brightest emission line falling in the RG E band.
Referring to the EWS requirement in terms of emission line detection with a signal-to-noise ratio (S/N) equal to 3.5 for the Hα line of a 0 . 25 radius source located at z = 1.4, that is λ = 16 000 Å , set at 2 × 10 −16 erg s −1 cm −2 (Scaramella et al. 2022), and at 6 × 10 −17 erg s -1 cm -2 for the EDS, we set the lower limit for the sample to be simulated at 1 × 10 −16 erg s −1 cm −2 for the EWS simulation and at 4.5 × 10 −17 erg s −1 cm −2 for the EDS simulation to be able to probe the detection sensitivity at its limits. We set the limit at two times below the requirement for the EWS simulation to offer candidate sources to study the potential of stacking analyses. We used as references the three strongest lines expected to be observed at different redshifts: [S III]λ9531 at 0.3 ≤ z ≤ 0.9, Hα at 0.9 ≤ z ≤ 1.82 and [O III]λ5008 at 1.5 ≤ z ≤ 2.5 (see Fig. 1).
As presented in Sect. 2, we used sources from the L16 catalogue for the EWS simulation (red triangles in Fig. 1). For the EDS simulation, we used sources from the B19 catalogue (blue triangles) that we complemented with sources from the L16 (orange triangles) to be able to reach the capacity of 2496 sources covering a wider range of physical parameters while including more massive and stronger emitter galaxies. We can see in the middle panel of Fig. 1 1. Distribution of emission line fluxes as a function of the mass. This figure presents the selected sources to be simulated considering the limits set for the EWS and EDS in terms of the emission line detection limits. The sources represented by stars are the sources with boosted emission line flux (explained in the text). The limits are set below the respective Euclid requirements in order to characterise emission line detection capability around these requirements. The limits have been set at 1 × 10 −16 erg s −1 cm −2 (top dashed black line) for the EWS simulation and at 4.5 × 10 −17 erg s −1 cm −2 (bottom dashed black line) for the EDS simulation. The red and blue shaded regions correspond to iso-proportions of the distribution density of the L16 and B19 catalogues, respectively, starting at 20% with a 10% step. The red triangles are sources from L16 selected for the EWS simulation. The blue triangles are sources from B19 selected for the EDS simulation, which has been completed with sources from L16 (orange triangles) to reach the maximum number of sources possible in a simulated pointing. Left: distribution of the [S III]λ9533 fluxes in the redshift range allowing detection with the RGS. Middle: distribution of the Hα fluxes. Right: distribution of the [O III]λ5008 fluxes. flux below the sample limit are kept. A similar effect for massive galaxies is visible on the right panel where we kept some sources that have an [O III]λ5008 flux below the sample limit. This is due to the fact that at redshift 1.5 ≤ z ≤1.82, both Hα and [O III]λ5008 fall in the RG E band. Therefore, for a source located in this redshift range, if one of the two emission lines has a flux above the sample limit then the source has been kept even if the flux of the other emission line is below the sample limit.
For calibration purposes, we boosted the continuum by −3.7 mag and the emission line fluxes to reach a value normally distributed between 10 −15 and 3 × 10 −15 erg s −1 cm −2 for about 5% of the sources of the sample. These sources are indicated with star markers on Fig. 1. 2.3.2. Sample to be simulated for the study of the morphological effects on the slitless spectroscopy performance While the spectral resolution of long-slit spectroscopy depends in part on the slit width, the resolution of slitless spectroscopy depends on the object shape and more specifically on the object size along the dispersion axis (Pasquali et al. 2006;Kümmel et al. 2009). It is therefore crucial to understand the effect of the object shape on the quality of the NISP spectra. However, the disk R50 distribution of the samples selected to simulate the EWS and EDS peak at disk R50 = 0 . 3, and the different variables that can affect the spectra makes it difficult to isolate the effect from a single morphological parameter. For this purpose, we have explored the effects related to different morphological parameters given as input to TIPS (see Sect. 2.5) by constructing a dedicated sample. To probe the extent to which the galaxy morphology affects the extracted spectra, TIPS was configured in the following manner. We chose a bright source located at z = were changed one at a time, while the others were kept at their default value. The default values of the morphological parameters to be tested are: disk R50 = 0 . 5, bulge fraction = 0.2, inclination angle = 45 • , position angle = 45 • . We then obtained four sub-samples of 1248 sources in which only one parameter varies, enabling us to disentangle the effect of these parameters on the quality of the extracted spectra. The range of variation are 0.1-2 for the disk R50, 0-1 for the bulge fraction, and 0-90 • for the inclination and position angles.

The M -SFR plane and the main sequence
It is interesting to characterise our sample in terms of starformation rate (SFR). It is well known that SFGs lie on a tight sequence in the total stellar mass (M ) and SFR plane, referred as the 'main sequence' (MS; Noeske et al. 2007;Daddi et al. 2007;Wuyts et al. 2011;Rodighiero et al. 2011Rodighiero et al. , 2014Popesso et al. 2022, and many others). It has been shown that the normalisation of the MS is shifted towards higher SFR with increasing redshift reaching a peak at 1.5 ≤ z ≤ 3 (Madau et al. 1998;Madau & Dickinson 2014). We show in Fig. 2 the normalisation of the MS derived by Rodighiero et al. (2011) for SFGs at z ∼ 2, and formulated as follows: We then made use of the redshift dependence of the specific star-formation rate (sSFR), defined as the ratio SFR[M yr −1 ]/M [M ], scaling as, where sSFR(0) is the sSFR at z = 0 (Sargent et al. 2014). We obtained a redshift-dependent relation that we used up to z = 2.5 as follows: A34, page 4 of 24  Rodighiero et al. (2011) derived at z ∼ 2 that we extrapolated to different redshift using the redshift dependence proposed by Sargent et al. (2014). Readers can refer to the caption of Fig. 1 for a colour assignment description.
We indicate in Fig. 2 the sources from the L16 (red shaded region) and from the B19 catalogue (blue shaded region). We also present the final selection of sources to be simulated with triangles. For a description of the final selection process, we refer the reader to Sect. 2.3. The SFR and stellar mass indicated in Fig. 2 are the SED-fitting parameters available in the catalogues.It has been shown by Laigle et al. (2019) that using SED-fitting parameters is robust for the stellar mass but has to be considered with caution for the SFR. It is worth noting that the photometry available in the B19 and L16 differs in terms of covered wavelength range. In particular far infrared data from Herschel is available only in the B19 catalogue. However, we decided to use the SFR derived from SED-fitting for consistency with the other parameters. This choice was justified by the good agreement found with the SFR derived from dust-corrected UV photometric measurements for the sources of the B19 catalogue. We can see in Fig. 2 that the SFR of the selected sources for the EDS simulation (blue triangles) are typically below the SFR of the selected sources for the EWS simulation. This comes from our selection procedure, which considers the detection capability of the Euclid spectroscopic channel. The EDS will be able to probe galaxies on both side of the main sequence, while the EWS will essentially probe galaxies above the main sequence.

Morphological parameters
Morphological parameters are required by TIPS to produce a simulated image with a realistic surface brightness distribution (see Sect. 4 for a description of the simulator). In particular, we are interested in the following morphological parameters: i) the bulge-to-total mass fraction, ii) the bulge half-light radius (bulge R50), iii) the disk half-light radius (disk R50) 5 , iv) the minor to major axis ratio of the bulge (b/a), v) the inclination angle of the galaxy (0 • = face-on, 90 • = edge-on), and vi) the position angle of the galaxy on the sky with respect to the north. As anticipated above, these parameters have been made available for the B19 catalogue by Van Der Wel et al. (2012) using Sérsic profile fits from the CANDELS imaging mosaics and by Dimauro et al. (2018) who performed the bulge-disk decomposition.
To estimate the bulge fraction for the L16 catalogue sources, we referred to the calibration from the stellar mass of the Empirical Galaxy Generator (EGG; Schreiber et al. 2017, Eq. (3)). We derived the bulge R50 from an empirical fit on the parameters from Dimauro et al. (2018) using our estimated bulge fraction. For the disk R50, we used the M -size calibration for SFGs proposed by Van Der Wel et al. (2014, see Fig. 3). We define the ratio b/a from the relation b/a = [cos 2 (θ GAL ) + C 2 sin 2 (θ GAL )] 0.5 with C = 0.6 as derived by Rodríguez & Padilla (2013) for local elliptical galaxies. We used this estimation by approximating the bulge of the SFGs with an elliptical galaxy, as done for the construction of the Euclid true Universe catalogue. The position and inclination (θ GAL ) angles have been set randomly with values ranging from 0 • to 90 • .

Construction of the spectral continuum
We made use of available observed data to generate a synthetic continuum using the synthesis code GALAXEV by Bruzual & Charlot (2003). This code allows us to compute the spectral evolution of stellar populations over wide ranges of age and metallicities and to derive synthetic spectra with both low and high resolution (denoted by lr and hr) over the wavelength range from 91 Å to 160 µm. Among those available, we used the high-resolution templates, that is 3 Å, from the STELIB spectroscopic stellar library (LeBorgne et al. 2003), consisting of a homogeneous library of 249 stellar spectra at optical wavelengths (0.32-0.95 µm), and are complemented with lower resolution models at longer wavelengths. We made use of the following physical parameters: the magnitude in the H band, M , V band dust attenuation (A V ), age, and star-formation history (SFH). These parameters are available for the galaxies in the two catalogues mentioned previously, that is L16 and B19. From both catalogues, we took the SED-fitting parameters inferred using the LePhare software (Arnouts et al. 2002;Arnouts & Ilbert 2011). We assumed Solar metallicity (m62), and we followed the parameterisation by Chabrier (2003) for the IMF. The IMF was chosen for consistency with the IMF that was used to derive the SED fitting results in the adopted catalogues, which is expressed as where m c = 0.08 M and σ = 0.69. These templates are provided in rest-frame air wavelengths with a spectral resolution (FWHM) of 3 Å. We converted the wavelength from air to vacuum using the relation provided by Morton (2000). We then transformed the wavelength from rest-frame to the observed frame using the relation λ obs = λ rest (z + 1).
The GALAXEV software provides templates in units of total wavelength-dependent luminosity, L(λ), per unit of total stellar mass (in Solar masses M ). To obtain the flux in erg s −1 cm −2 Å −1 , we multiplied the luminosity by the total stellar mass, and converted the luminosity into flux using the luminosity distance function, d L (z), such that, The total stellar mass (M ) and the redshift (z) are those provided in the L16 and B19 catalogues. The (1 + z) term in the denominator accounts for the fact that the flux and luminosity are not bolometric but are densities per unit wavelength (Hogg et al. 2002). We finally applied the Calzetti et al. (2000) extinction law to convert the intrinsic flux (F int ) derived in Eq. (5) into the observed, extinction-corrected flux (F obs ), as where the dust extinction is taken into account with the following: Here E star (B − V) is the colour excess taken from the L16 and B19 catalogues and k λ is the wavelength-dependent extinction curve used by Calzetti et al. (2000), with a normalisation factor of R V = 4.05.

Prediction of the emission lines fluxes
We present in this section the prediction of fluxes of the To determine the emission line fluxes, we referred to the broad-band SEDfitting parameters M , SFR, z and A V available in the L16 and B19 catalogues and used empirical and theoretical relations available in the literature together with their corresponding observed scatters described below.
We anticipate here that we focussed the analysis of the extracted spectra on the Hα, [O III]λ5008, and [S III]λ9531 emission lines. The procedure for predicting the fluxes of the other emission lines is however presented in this section to provide a full description of the construction of the spectral library that is available upon request.

Prediction of the Hα line fluxes
The study of the SFR is of particular interest to trace the SFH and gives vital clues of the physical nature of the Hubble sequence and evolutionary histories of galaxies (Roberts 1969;Larson & Tinsley 1977;Kennicutt 1998;Daddi et al. 2004Daddi et al. , 2007Rodighiero et al. 2011Rodighiero et al. , 2014. The SFR can be inferred from measurements of the integrated light in the UV (see Donas & Deharveng 1984) and far-infrared (see Rieke & Lobofsky 1979), using SED-fitting methods or by tracking and measuring nebular recombination line fluxes (Madau & Dickinson 2014). SFR estimates in the literature obtained from different calibrations and in different redshift bins show consistent results. For example, using multi-wavelength data from the GOODS-N field, Daddi et al. (2007) have found good agreement between SFRs calculated from radio, far-IR, mid-IR, and even UV (corrected for the extinction by dust). More recently, this consistency has been confirmed by Sanders et al. (2020) comparing the SFRs obtained from [O II] observed flux (SFR([O II])) to SFR(Hα), and by Kashino et al. (2013) comparing the SFR(UV) with SFR(Hα).
In this study we used the SFR derived from SED-fitting available in the L16 and B19 catalogues. Kennicutt (1998) presented a calibration between the intrinsic Hα luminosity -L(Hα) -and SFR from which we based our flux calculations. Kennicutt (1998) used a Salpeter (1955 IMF while we have adopted the Chabrier (2003) IMF. To account for this difference, we applied a correction dividing by a factor 1.7 to transform the calibration for the use of Chabrier (2003) IMF as presented by Kashino et al. (2019). We then obtained the relation, where SFR[M yr −1 ] takes the value retrieved from the SEDfitting available in the L16 and B19 catalogues. We converted the luminosity obtained from the Eq. (8) into the intrinsic predicted flux for Hα as follows:

Prediction of the [O II]λλ3727,3729 line fluxes
The strongest emission feature in the wavelength range 0.35-0.45 µm is the [O II]λλ3727,3729 forbidden-line doublet which is extremely useful for studies of distant galaxies because it can be observed in the visible out to redshift z ∼ 1.6. The luminosities of forbidden lines are not directly coupled to the ionising luminosity, and their excitation is sensitive to the abundance and ionisation state of the gas. However, the excitation of [O II] is sufficiently well behaved that it can be calibrated empirically as a quantitative SFR tracer (Kennicutt 1998;Kewley et al. 2004). Even if this calibration suffers from a dependence on secondary parameters, such as the metal abundance, it remains to first approximation a reliable tracer of the current SFR (Kewley et al. 2004). We used the calibration presented by Kewley et al. (2004), equation 4, that has been derived from two samples of galaxies located at high redshift, one at 0.8 ≤ z ≤ 1.6, from the NICMOS Hα survey, and the other at 0.5 ≤ z ≤ 1.1, from the Canada-France Redshift Survey. The calibration is presented as, where SFR([O II]) is in agreement with the SFR obtained from Hα (Kewley et al. 2004, Eq. (5)). We therefore used the same SFR that we have used to calculate L(Hα), which is the SFR obtained from the SED-fitting.

Prediction of the Balmer and Paschen line fluxes
We predicted Hβ and the other Balmer (H12) and Paschen (P10) line fluxes assuming ratios between their respective intrinsic fluxes starting from the Hα fluxes predicted above. We made use of the ratios presented by Hummer & Storey (1987) and Osterbrock (1989). These lines theoretically also directly trace the SFR, but being relatively faint, they are rather difficult to detect compared to the Hα line, and other forbidden lines, for example [O II] and [O III]. However, if they are detected, they can be used to improve the redshift measurement precision. The hydrogen Balmer decrement, Hα/Hβ, is frequently used to determine the amount of dust extinction for the low-density gas component by comparing the observed Hα/Hβ ratio with the expected intrinsic ratio. An intrinsic value of 2.86 is generally adopted assuming typical H II region gas conditions where the electron density is n e = 10 2 cm −3 with an electron temperature T e = 10 4 K and assuming case B recombination (see Osterbrock 1989). We considered this ratio to estimate the intrinsic Hbeta flux of our galaxies.

Prediction of the [N II]λλ6584,6549 doublet fluxes
The strongest line of the [N II] doublet, [N II]λ6584, can be very useful in increasing the confidence in redshift determination , in estimating the gas-phase metallicity, and even in yielding insight on the kinematics from the FWHM of the line. It has therefore been extensively studied, usually by measuring observed ratio [N II]λ6584/Hα, often mentioned in the literature as N 2 . The N 2 ratio is sensitive to the metallicity which is measured by the oxygen abundance (O/H; Denicolo et al. 2002;Henry et al. 2001). So far, it has been possible to study Hα and [N II] in thousands of galaxies up to z ∼ 2.5 (reaching the K band wavelength limit) such that the N 2 index offers a unique way to study the evolution of the metallicity with redshift (Steidel et al. 2014;Pettini & Pagel 2004 9071.10 -Notes. We predicted the fluxes for these emission lines using the relations presented in Sect. 3.2. The rightmost column lists the ratios presented by Hummer & Storey (1987) and Osterbrock (1989) between the fluxes of the Balmer and Paschen lines and flux of the Hβ line assuming typical H II region gas conditions with electron density n e = 10 2 cm −3 , electron temperature T e = 10 4 K, and case B recombination.
Given the dependence of the [NII] doublet lines on metallicity, we needed an estimate of this physical quantity to derive the expected [N II] doublet flux. In particular, we made use of the M -metallicity relation (MZR) derived empirically by Wuyts et al. (2014), based on the observations of a sample of 222 galaxies at 0.8 ≤ z ≤ 2.6 and 9.0 ≤ log 10 (M [M ]) ≤ 11.5 (see Wuyts et al. 2014, for further details). Based on the parameterisation originally proposed by Zahid et al. (2014), we referred to Wuyts et al. (2014), Eq. (1), for the redshift-dependent MZR. Wuyts et al. (2014) also showed that their MZR parameterisation is in good agreement with that obtained by Zahid et al. (2014) at 0 ≤ z ≤ 1.6, as well as with results for other high-z samples at 2.2 ≤ z ≤ 2.3 (Erb et al. 2006;Steidel et al. 2014).
The oxygen abundance 12 + log 10 (O/H) obtained from Eq. (1) in Wuyts et al. (2014) should then be converted into a value for the ratio N 2 . For this purpose, we made use of the linear metallicity calibration proposed by Pettini & Pagel (2004) based on 137 extragalactic H II regions with well determined values of (O/H) and N 2 . The linear calibration is then presented as follows: The scatter of this relation for local galaxies is equal to 0.18 dex.
However, to reproduce a plausible distribution of higher redshift galaxies in the N 2 -M plane, we used the intrinsic scatter on N 2 inferred by Kashino et al. (2019) on the FMOS-COSMOS survey sample at 1.43 ≤ z ≤ 1.74, which has been shown to be very consistent with that derived for a sample of SDSS local galaxies. The intrinsic scatter σ int (N 2 ) is derived as a function of N 2 (M ), that is the best-fit M -N 2 relation and is presented in Eq. (20) of their paper. The results from this approach are presented in Fig. 4 Acker et al. (1989). We anticipate here that the [N II] doublet will be blended with the Hα line in the Euclid extracted spectra (see Sect. 5).

Prediction of the [O III]λλ4959,5008 fluxes
The Baldwin-Phillips-Terlevich (BPT) diagram, introduced by Baldwin et al. (1981), is a powerful tool to infer physical properties of emission-line galaxies.
The BPT diagram of N 2 versus log 10 ([O III]λ5008/Hβ) (hereafter O 3 ), known as the N 2 -BPT diagram, happens to be a particularly efficient tool in discriminating the dominant excitation mechanism of nebular emission in galaxies, providing a clear separation of galaxies whose spectra are dominated by ionisation induced by the UV radiation field of young stars from those essentially ionised by the extreme ultra-violet (EUV) radiation of AGNs. This interesting feature led astronomers to extensively refer to the BPT diagram for AGN classification schemes based on observations and photoionisation models, stellar population synthesis and shock modelling (Osterbrock & Podge 1985;Veilleux & Osterbrock 1987;Kewley et al. 2001Kewley et al. , 2013a. Of interest for this work is the fact that SFGs form a tight sequence in the N 2 -O 3 plane. The study of the emission line [O III]λ5008 is not only useful to identify the presence of an AGN (Kewley et al. 2013a,b;Kartaltepe et al. 2015), but it is also crucial to determine the oxygen enrichment of the interstellar medium (ISM; Zahid et al. 2014).
As described in Sects. 2.1 and 2.2, we restricted our sample to be exclusively composed of normal SFGs without AGNs. Making this assumption enabled us to make use of the calibration established for the SFG abundance sequence on the BPT diagram (Kewley et al. 2013a).
Thus, using the N 2 ratio calculated in Sect. 3.2.4, we could predict the O 3 ratio. The calibration provided by Kewley et al. (2013a) for galaxies located at 0 ≤ z ≤ 3, started from a previous study of local SDSS galaxies (Kewley et al. 2006) and extended towards higher redshift using the chemical evolution predictions from cosmological hydrodynamic simulations with theoretical stellar population synthesis, photoionisation and shock models (see Kewley et al. 2013a, Fig. 3).
The calibration of the SFGs abundance sequence in the N 2 -BPT diagram proposed by Kewley et al. (2013a) is presented as follows: This calibration is scattered along both the x and y axes by 0.1 dex. For our purpose, we fixed the value of N 2 , since a realistic scatter on N 2 was already introduced in Sect. 3.2.4, and therefore we only kept the vertical 0.1 dex scatter that we distributed normally. We present in Fig. 5 the predicted N 2 -BPT diagrams  1) and (2). The predicted metallicity is indicated on the right vertical axis of each plot. The left vertical axis indicates the corresponding [N II]λ6584/Hα flux ratio predicted using the linear calibrations presented in Asplund et al. (2004). Readers can refer to the caption of Fig. 1 for a colour assignment description.  Kewley et al. (2013a). The dashed lines represent the scatter that has been applied 'vertically' by fixing the ratio N 2 and applying a scatter of 0.1 dex on our predicted ratio O 3 . Readers can refer to the caption of Fig. 1 for a colour (Veilleux & Osterbrock 1987;Dopita et al. 2016;Kashino et al. 2017) even though the separation is not as clear as for the N 2 -BPT diagram presented above.
We made use of the calibration between these ratios derived for SFGs, which has been introduced for local sources by Dopita et al. (2016) and confirmed at high-redshift by Kashino et al. (2017, see Fig. 7 of their paper), on a sample of 701 SFGs with stellar masses 9.6 ≤ log 10 (M [M ]) ≤ 11.6, located at 1.4 ≤ z ≤ 1.7. The calibration is presented as, 12 + log 10 (O/H) = 8.77 where N 2 S 2 = log 10 ([N II]λ6584/[S II]λλ6717, 6731) and log 10 (O/H) is the oxygen abundance. For the transformation of N 2 into the oxygen abundance, we used the linear calibration proposed by Pettini & Pagel (2004) while Kashino et al. (2017) made use of the calibration by Tremonti et al. (2004). We then referred to Kewley & Ellison (2008, Eq. (1) and Table 3) to convert metallicity relations into any other calibration scheme. It is formulated for our purpose as, where y is the metallicity in 12 + log 10 (O/H) units as calibrated by Tremonti et al. (2004), and x is the original metallicity (Pettini & Pagel 2004) to be converted, also in 12 + log 10 (O/H) units. We added a scatter with a normal distribution with sigma 0.1 dex on the N 2 S 2 value calculated from Eq. (13), from which we eventually obtained the sum of the fluxes of the [S II] doublet. The 0.1 dex has been added to implement a scatter corresponding to the median scatter of the N 2 S 2 distribution on the BPT diagrams presented by Dopita et al. (2016) and Kashino et al. (2017). For the determination of the ratio between the lines of the doublet [S II]λλ6717, 6731, we relied on the relation between the electron density (n e ) and the ratio of the fluxes of the two forbidden lines of interest. Indeed, for a pair of lines with nearly the same excitation state, as can be an ion excited in two different states in a medium with typical low density such as in an H II region and if both excitation states are metastable, a relation can be established between the electron density and the ratio of the lines [S II]λ6716/[S II]λ6731. A relation has been derived by Proxauf et al. (2014) following previous research made by Osterbrock & Ferland (2006) and is presented in Iani et al. (2019), Eq. (2).
To obtain n e , we referred to a relation between n e and the sSFR proposed by Kashino & Inoue (2018), Eq. (10). They obtained this relation from a sample of galaxies located at 0.027 ≤ z ≤ 0.25. They estimated n e from the ratio [ Fig. 9.

Prediction of the [S III]λλ9069,9531 fluxes
The doublet [S III]λλ9069,9531 has been challenging to study due to its relatively long wavelength, lying at the edge of classical optical spectrometers even for nearby galaxies. The doublet will fall in the RGS passband up to a redshift z ∼ 0.9. [S III]λλ9069,9531 is generally studied through the strongline ionisation parameter diagnostic S 32 which corresponds to the ratio ([S III]λ9069 + [S III]λ9531)/[S II]λλ6717,6731. This ratio was introduced by Kewley & Dopita (2002) and has been referred to in more recent studies (Morisset et al. 2016;Sanders et al. 2020;Kewley et al. 2019).
In this study, we referred to a relation presented by Kewley et al. (2019). They have shown that the S 32 ratio is sensitive to the ionisation parameter (U), with a relatively small variation lower than 0.3 dex in our range of metallicity 8.1 ≤ 12 + log 10 (O/H) ≤ 8.7 (see Fig. 4). This calibration still suffers from a complex temperature dependence that can make the photoionisation models underestimate the [S II] line strength (Levesque et al. 2010;Kewley et al. 2019) and should therefore be considered with caution. We calculated the log 10 (U) using the relations presented by Kashino & Inoue (2018), Eqs. (11) and (12), for consistency with the previously calculated electron density (n e ).
We inferred a best linear fit to the results presented by Kewley et al. (2019) as, with, Finally, we inferred the flux of the individual lines of the doublet using the value for the theoretical ratio [S III]λ9531/[S III]λ9069 = 2.5 as proposed by Sanders et al. (2020).

From intrinsic to observed emission line fluxes
For the reddening, we proceeded in a similar way as we did for the continuum in Sect. 3.1, although accounting for the difference between the E star (B − V) of the stellar component and the E neb (B − V) of the line-emitting nebular region with a propor- . The physical meaning of the f -factor is still a subject of debate. Puglisi et al. (2016) have suggested that the f -factor is a function of the mass and SFR of the galaxy while Rodríguez-Muñoz et al. (2022) highlighted a stronger correlation with the UV attenuation. Different values have been inferred ranging from 0.44 for local galaxies (Calzetti et al. 2000) up to ∼1 in other studies at higher redshifts (Kashino et al. 2013;Puglisi et al. 2016;Rodríguez-Muñoz et al. 2022). Some of the differences among these studies are to be ascribed to the different galaxy samples analysed, for example normal SFGs versus heavily obscured starburst galaxies. In our study we used the value of 0.58 6 for the 6 We note that the value 0.58 is obtained when applying the Calzetti reddening curve for both the nebular and continuum extinction, while 0.44 is obtained when using the Fitzpatrick reddening curve for the continuum (cf., Puglisi et al. 2016). In our case we apply the Calzetti reddening curve for both the continuum and nebular continuum. We thus chose 0.58 for the f -factor.
A34, page 10 of 24 Euclid Collaboration: A&A proofs, manuscript no. aa46177-23 f -factor derived by Calzetti et al. (2000) for local galaxies and proved to be a fair estimate also for high-redshift galaxies (e.g. Fõrster Schreiber et al. 2009). The observed flux is derived from the intrinsic flux using the Eq. (6) with A λ defined as, As for the continuum, we obtained the factor k λ using the wavelength-dependent extinction law provided by Calzetti et al. (2000) and taking R V = 4.05. E star (B − V) is available in the L16 and B19 catalogues.

Integration of the emission lines to the continuum
The predicted fluxes are transformed into lines with a Gaussian profile applying a dispersion in the rest-frame of 3 Å as provided by the models generated through GALAXEV (see Sect. 3.1). We therefore redshifted the dispersion by applying the usual (1 + z) factor such that ∆λ obs = ∆λ rest (1 + z). The resulting emission line SED profiles were then added to the continuum SED of each galaxy. We broadened the resulting galaxy SED using the recipe correlating the velocity dispersion of the ionised gas (σ gas ) to the total stellar mass (M gas ) presented in Eq.
(3) of Bezanson et al. (2018), which was obtained from the observation of about 1000 massive galaxies with the VLT/VIMOS in the LEGA-C survey. This relation has a scatter of 0.17 dex and has been derived for galaxies at 0.6 ≤ z ≤ 1.0. It has also been confirmed for higher redshift z ∼ 2 using data from the SINS/zC-SINF survey by Fõrster Schreiber et al. (2018). See Fig. 6 for the results.
Once the σ gas is determined, we broadened the galaxy SED by convolving the spectra with a Gaussian kernel. To cope with the σ gas dependence on the wavelength, we made use of the penalised pixel-fitting method proposed by Cappellari (2017).

Reconstruction of the continuum
We compared the reconstructed continuum of the incident spectra with photometric data found in the literature and in particular data from the Survey for High-z Absorption Red and Dead Sources (SHARDS; Pérez-González et al. 2013) for sources from the B19 catalogue. The SHARDS, part of the CANDELS survey (Grogin et al. 2011;Koekemoer et al. 2011), observed the entire GOODS-N field in 25 medium-band filters with GTC/OSIRIS in the wavelength range 0.5-0.95 µm with contiguous passbands. We also referred for comparison to HST data taken with its Wide Field Camera 3 (WFC3) and Advanced Camera for Surveys (ACS) for the incident spectra built from both L16 and B19 catalogues.
We present in Fig. 7 an example of the very good agreement coming from the photometric check using SHARDS data for B19 sources and HST data for L16 sources data. We also indicate on the figure the predictions in flux measurement using the Euclid I E , Y E , J E , and H E filters. In Fig. 8, we present examples of incident spectra with different redshift and stellar mass.

Evaluation and calibration of the emission line fluxes using spectroscopic data
Using sources that have available emission line fluxes observed in public spectroscopic surveys, we provide a comparison between our predicted fluxes with observations. The results are presented in Fig. 9. We used data obtained from the LEGA-C, FMOS and 3D-HST surveys. 3D-HST and FMOS do not have sufficient resolution to deblend Hα and [N II]λλ6584,6549 (hereafter the triplet Hα-[N II]λλ6584,6549 is referred as Hα-complex), or the [O III] doublet. For comparison with data from these surveys, we therefore summed our predicted fluxes of the blended lines accordingly. To make our calculated fluxes be as close as possible to observations, we had to apply a factor of 1.8 and 2 to the predicted [O II]λλ3726,3729 and [S II]λ6731 fluxes respectively. The reason for these offsets is still unclear due to a relatively poor coverage by current spectroscopic surveys in the redshift range of interest. We present in Fig. 9 the comparison including these correction factors.

Pilot run simulations: Frame and setup
The pilot run, which is part of the Euclid legacy science efforts, aims to provide the Euclid community with the following: i) simulations of the spectroscopic channel using the NISP simulator (SIM/TIPS 7 ; Zoubian et al. 2014), which are processed through the spectroscopic image reduction (SIR) pipeline 8 ; and ii) preliminary results on the spectroscopic capabilities of the RGS for the EWS and EDS. Both the SIM and SIR processing functions  are undergoing continuous improvements to add features to the simulations and to optimise the spectral extraction. Hence, the results presented here provide a baseline, but we expect to see improvements in the processing as development continues. The spectral libraries constructed above have been formatted to be processed through TIPS that simulates the actual RGS observation configurations for the EWS and EDS. The EWS and EDS simulations refer to the corresponding Euclid integration time using the RGS. The integration time with the RGS in the EWS simulation is 2212 s which is split into four dithered exposures (each of which is 553.0 s), as defined by the Euclid reference observation sequence to cope with pixel defects and cosmic rays. Each dithered exposure was simulated reproducing the up-the-ramp MULTIACCUM acquisition mode for the  Fig. 9. Comparison of the predicted fluxes to the observed fluxes coming from publicly released data of the near-infrared spectroscopic surveys 3D-HST (purple), FMOS (green) and LEGA-C (cyan). The contours correspond to iso-proportions of the distribution density starting at 20% with a 10% step. The scatter plots are indicated for the smallest samples. For our comparison we selected emission line measurements observed with S /N ≥ 3.5.
NISP-S exposures, consisting of 15 groups with 16 readouts per group, and 11 dropped frames (drops) between each group (see Robberto 2014;Kubik et al. 2016, for further details on the acquisition mode). The sensitivity curve to convert the extracted quantity into physical units is presented in Fig. 10. Furthermore, the four dithered exposures are made with four RGS orientations required during the mission for decontamination purpose due to the overlapping of the slitless spectra (Scaramella et al. 2022). The orientation angles are +0 • , −4 • , +180 • , and +184 • . The integration time in the EDS, that includes both RGS and BGS, will be 40 times longer than that in the EWS. Studies to asses the best configuration in terms of the relative integration time for the two grisms are still ongoing. In this work we assumed the configuration including 30 visits (one visit is made of four dithered frames) with the BGS and 10 visits with the RGS. The EDS integration time with the RGS then is 22 120 s which is split into 40 dithered exposures and will be complemented with 120 dithered exposures using the BGS; however, the latter is not considered in the pilot run since the related pipeline was still undergoing fundamental validation tests when the simulations were performed. The 40 dithered frames of the EDS simulations have been obtained repeating ten times the EWS simulations, with a further 'circular' dither pattern obtained shifting the pointing by 0 . 9, that is three pixels, at each step in order to remove artefacts, for example bad pixels, in post-processing.
In practice, the simulator places each simulated galaxy in a certain position of a simulated sky and then recreates the output of the observations through the instrument. In the simulations performed in this work, we pointed the telescope towards the RA = 228. • 394 and Dec = 6. • 590 coordinates which determines the background level in the images. The simulations were constructed considering two astrophysical background sources uniformly distributed across the field of view, which come to 1e15 Fig. 10. Wavelength-dependent sensitivity curve of the RGS inferred by TIPS using the NISP and payload module transmission curves characterised at nine positions of the NISP focal plane during the ground-test campaigns (Waczynski et al. 2016;Barbier et al. 2018;Costille et al. 2019;Maciaszek et al. 2022) and spatially averaged in the simulations computing the arithmetic mean of the transmissions measured at the nine positions. Units on the vertical axis are in e s -1 px -1 / (erg s -1 cm -2 Å -1 ). This quantity connects the spectra extracted from the slitless data to the physical units presented in this paper.
dominate the noise level on the detector: the zodiacal light 9 was predicted for the Euclid Survey (Scaramella et al. 2022) using the (Aldering 2001) model with an angular dependence by Leinert et al. (1998), and the out-of-field stray light 10 modelled by Venancio et al. (2016Venancio et al. ( , 2020 and presented in Scaramella et al. (2022). In addition to these astrophysical backgrounds, the detector noise has contributions from the readout noise, dark current, and quantum efficiency that were characterised during the NISP ground test campaigns (Waczynski et al. 2016;Barbier et al. 2018;Costille et al. 2019;Maciaszek et al. 2022). The simulator transforms the galaxy morphological parameters to pixelised galaxy light profiles (Serrano et al, in prep.) based on the GALSIM software (Rowe et al. 2015). The bulge and disk components are computed using two different Sérsic profiles, considering a thick exponential disk model with Sérsic index equal to one (van der Kruit & Searle 1981;Bizyaev 2007). The PSF measurements of the NISP-S, made on the four RGS, in different positions of the focal plane, and at different wavelengths during the ground test campaign, have been parameterised into TIPS. The simulations therefore reproduce the response at the pixel level of the 16 detectors of the NISP focal plane. In a similar way, the spectral dispersion has been measured in laboratory on average at 13.51 ± 0.06 Å px −1 (W. Gillard et al., in prep) and has been fixed at 13.4 Å px −1 for the simulations. The simulation does not include the spectral and astrometric distortions such that the spectra have their nominal inclination and position. The actual inclination and dispersion of the spectra may be affected by mechanical considerations, for example launch vibrations, zero gravity conditions, and thermal stabilisation, that will be verified in orbit during the performance verification test. In particular the spectral dispersion on different positions of the focal plane will be assessed using compact planetary nebulae with known emission lines (Paterson et al. 2023).
As anticipated in Sect. 2.3, the simulated pointings have been populated with a fixed number of 2496 galaxies. This was a choice well motivated by the purpose of first assessment of the RGS capabilities independently from the contamination due to the overlap of the spectra. We avoided the overlap of the 2D spectra on the detector by locating the 2496 galaxies on the field of view following an ordered pattern ensuring that the spectra fell on one single detector avoiding the edges.

Analysis of the spectra produced by TIPS
We processed the 2D spectra produced by TIPS through the SIR pipeline. SIR is the official pipeline developed for Euclid that performs the image reduction, the wavelength and flux calibration, and the extraction of the 1D spectra. The 1D spectra are extracted by SIR using the 'virtual slit' formed by the object itself (see Kümmel et al. 2009). In this work, the SIR pipeline extracted the first order spectra for all the sources of the input catalogue. The spectral extraction uses a fixed aperture in pixels that depends on the shape of the galaxy as described below. SIR processes individual frames and then combines the extracted spectra using inverse-variance weighting. The error of the single frames is propagated assuming a Gaussian behaviour, and so the error on the combined spectra is inversely proportional to the square root of the number of dithered frames. SIR provides the 1D combined spectra and variance that are defined on the wavelength range 1. 19-1.90 µm with a pixel scale of 13.4 Å . We proceeded to run the same pipeline routines to extract the 1D 10 The stray light during the EWS is expected to vary between 0.1 and 3.0 photon s −1 px −1 , with a median value at 0.4 photon s −1 px −1 and is estimated at 0.3 photon s −1 px −1 at our simulated pointing coordinates. spectra from the 40 dithered frames for the EDS simulation and produce the 1D combined spectra products.
To measure the emission line fluxes, we fitted a set of Gaussian profiles to the 1D spectrum at the known positions of the lines using the true redshift and left the FWHM and amplitude as free parameters. The continuum is modelled by a linear fit around each line. The S/N for each emission line measurement was defined as the integrated line flux (S ) over the noise (N). The noise was evaluated from the sum in quadrature of the root mean square (RMS) within a ± 3σ region surrounding the central wavelength. To measure the integrated continuum flux, we multiply the extracted spectra with the transmission curve of the H E filter over the mutual passband covered by the RGS and H E filter, that is cutting the response of the H E filter for wavelength above 1.86 µm. The S/N of the continuum measurements was inferred from the ratio of the mean values of the extracted flux and RMS over the wavelength range used to calculate the magnitude. The magnitude derived in this manner is referred in the following by H only since it does not correspond to the full H E band.

The morphological effects on the quality of the extracted spectra
We present in this section the analysis of the morphological effect on the quality of the slitless spectra referring to the dataset described in Sect. 2.3.2. We only report the results related to the galaxy size, that is the half-light radius of the disk component (disk R50), which has the strongest impact on the quality of the NISP spectra (see Fig. 11). We therefore present our analysis of the extracted spectra obtained from the same source simulated 1248 times with only one variable morphological parameter, the disk R50 that ranges from 0 . 1 up to 2 , all the other parameters being fixed at their default value. We present in Fig. 12 an overview of the size effect on the extracted spectra by showing the results around the Hα-complex line obtained emulating twice the same galaxy, that is with same incident spectra but with two different disk R50 set at 0 . 5 and 1 . 5. In the following sub-sub-sections, we subsequently comment on three effects observable in this figure, namely the increase with the disk R50 of the FWHM in Sect. 5.1.1, the increase in the RMS subsequently decreasing the S/N in Sect. 5.1.2, and the increase in the flux loss related to the extraction procedure and aperture in pixels in Sect. 5.1.3.

The spectral resolution of the extracted spectra as a function of the disk R50
To quantify the effect of the size on the spectral resolution, we present in Fig. 13 the measured FWHM of the Hα-complex 11 as a function of the disk R50. The red line and circles indicate the median FWHM calculated in disk R50 bins including a fixed number of 50 sources. The error bars show the MAD. As expected, the FWHM scales as the disk R50. We can also see that our measurements are in agreement with the expectation from the model computed with GALSIM (Rowe et al. 2015). The model was constructed based on a disk profile matching the properties of the galaxy simulated by TIPS with inclination 45 • and oriented at 45 • with respect to the dispersion direction. We modelled the Hα-complex in the two-dimensional spectrum by rendering the galaxy image of each emission line at their respective wavelengths. The line profiles were computed with GALSIM considering the velocity dispersion, the shape of the galaxy, that is disk size, inclination and position angles, and convolving with the PSF of the instrument. We then projected the image to make the one-dimensional spectrum and measured the FWHM of the complex. The agreement between the measurement and the model demonstrates that the pipeline successfully recovers the line profile.

The signal to noise ratio as a function of the disk R50
To evaluate the effect of the size on the quality of the measurement, we characterised the decline of the S/N as the disk R50 increases. Results are shown in Fig. 14 for the Hα-complex emission line flux measurement (in red) and for the continuum flux measurement in the H band (in green) that we normalised by the median S/N of a 0 . 25 disk R50 sources. The red line shows the median normalised S/N calculated in disk R50 bins including a fixed number of 50 sources. The error bars show the MAD. For both measurements, the curves follow an almost linear drop of the S/N as the size increases, with a smoothing of the S/N drop for disk R50 > 1 due to the increase in the extraction aperture in pixels that mitigates the S/N drop. The aperture in pixels is discussed in Sect. 5.1.3. The degradation of S/N reaches ∼20% for emission line measurements and ∼ 12% for continuum measurements at the median disk R50 of our EWS and EDS simulation sub-samples, that is disk R50 = 0 . 4 and reaches 45% on emission line measurements for 1 disk R50 sources. object as well as of the PSF of the instrument. The SIR pipeline fixes the extraction aperture according to the disk R50 (as shown in the Fig. 15). It is worth noting that the determination of the aperture also takes into account the inclination and position angles, which become increasingly significant as the disk R50 value increases. The estimation of the loss due to the aperture is estimated from the differences between incident and extracted flux obtained convolving the spectra with the H E filter transmission curve on the mutual wavelength range between the RGS passband and H E . The line indicated in Fig. 15 is the median flux loss calculated in disk R50 bins including a fixed number of 50 sources. The error bars show the MAD. We can see in Fig. 15 that for sources with disk R50 < 0 . 25 there is a systematic loss of ∼ 10% for the continuum that can be attributed to the loss due to the extraction aperture. To verify this last statement, we performed a simulation increasing the minimal aperture from the default value of five pixels 12 to nine pixels, which brought the loss to less than 1% for the sources with disk R50 < 0 . 25. We can also see that the loss due to the aperture increases linearly with the size to reach a loss of ∼ 40% for disk R50 ∼ 1 . In this range of disk R50, the aperture set by the pipeline remains at five pixels. For the sources with disk R50 > 1 , the aperture in pixels increases as indicated in Fig. 15 and a plateau is reached at a loss of ∼40% attesting to the fact that for such extended sources an even larger aperture is required to mitigate the flux loss.
The data reduction pipeline for the spectra extraction is still undergoing continuous optimisations to improve the S/N and flux determination. An optimal extraction method will soon be Fig. 15. Estimation of the aperture loss as a function of the disk R50 in arcseconds. The line and error bars are obtained calculated the median aperture loss obtained on disk R50 bins including a fixed number of 50 sources. The method to estimated the loss due to the aperture is described in the text. The results are presented for a sub-sample of 1248 sources with all morphological parameters set at their default value (see Sect. 2.3.2) except the disk R50, which varies from 0 . 1 up to 2 . We indicated with black thick lines the range of sizes corresponding to the different apertures in pixels, recalling that the spatial resolution of the NISP instrument is 0 . 3. introduced in the SIR pipeline to improve the S/N by assigning weights to pixels based on the fraction of object flux they contain. The optimal extraction will also address and compensate for the aperture effects discussed in this section by applying a 'normalisation factor' that accounts for the flux falling outside the aperture through a cross-dispersion profile inferred for each galaxy.
We used these results to correct the incident versus extracted fluxes of the EWS and EDS simulations for the continuum (see contours Fig. 16) and for the emission lines (see contours Figs. 18 and 19).

Continuum extraction from the EWS and EDS simulations
We present a comparison of the incident versus extracted magnitudes in the H band in Fig. 16 for the EWS and EDS simulations after applying the correction due to the aperture estimated in Sect. 5.1.3. The colour-coded circles are measurements obtained at S /N ≥ 3.5 while the grey circles are measurements below that threshold. The contours are the iso-proportions of the distribution density of our measurements before applying any correction for the loss due to the extraction aperture. We can see from the scattered circles in Fig. 16 that we found an almost perfect match between the incident and extracted measured magnitudes once the fluxes are corrected for the estimated size-dependent flux loss due to the aperture extraction.

Emission lines extraction from the EWS and EDS simulations
We present in Fig. 17 the distribution of the sources with an emission line measurement at S /N ≥ 3.5 in the stellar mass versus redshift plane. We indicate the distribution corresponding to measurements of the [S III]λ9531, Hα, and [O III]λ5008 emission lines. In the redshift range where both Hα and [O III]λ5008 emission lines fall in the RGS passband, that is at 1.5 ≤ z ≤ 1.8, we can see that the median stellar mass of Hα emitters is higher than the median stellar mass of [O III]λ5008 emitters. This effect is related to the anti-correlation between the mass and [OIII]λ5008 emission line flux due to a relatively lower ionising power for galaxies with higher metallicities (see Colbert et al. 2013;Domínguez et al. 2013, for further explanation on this observed spectral feature). On the contrary, the Hα emission line is expected to correlate with the mass due to the SFR-Hα A34, page 17 of 24 A&A 676, A34 (2023) Fig. 18. Results of the EWS simulation comparing the extracted versus incident fluxes of the Hα-complex (left), [O III]λ5008 (middle) and [S III]λ9531 (right) emission lines. The scattered circles are corrected for the estimated loss due to the aperture (see Sect. 5.1.3). The sources are colour-coded with the S/N of the emission line measurement, as shown by the right-side colour bar. The grey circles are objects with S /N < 3.5. The black diagonal line shows the 1:1 ratio. The grey dotted lines are the requirements for the Euclid spectroscopic detection limit for the EDS (leftmost) and EWS (rightmost) surveys. The contours correspond to iso-proportions of the distribution density of our measurements, starting at 20% with a 10% step, before applying the correction due to the aperture loss. Fig. 19. Same plots as in Fig. 18, but for the EDS simulation.
relation (see Kennicutt 1998, and Sect. 2.4 for the distribution of SFGs on the M -SFR plane). This aspect is particularly relevant to make forecast on number counts of galaxies with two detected emission lines. On the other hand and of interest for galaxy evolutionary studies, a related effect on the power of the stacking analysis is presented in Sect. 5.4.
We present in Fig. 18 for the EWS simulation and in Fig. 19 for the EDS simulation, a comparison between the incident and extracted fluxes for the Hα-complex (left panel), [O III]λ5008 (middle panel) and [S III]λ9531 (right panel) emission lines.The scattered circles are corrected for the loss due to the extraction aperture estimated in Sect. 5.1.3. The colour-coded circles are the measurements at S /N ≥ 3.5 while the grey circles indicate objects with S/N below that threshold. The Euclid requirements for emission line detection limits at S /N = 3.5 for 0 . 25 radius extended sources, set as 2 × 10 −16 erg s −1 cm −2 for the EWS (Scaramella et al. 2022), and at 6 × 10 −17 erg s −1 cm −2 for EDS, are indicated with the dashed grey lines on the figures. The contours are the iso-proportions of the distribution density of our measurements before applying the correction due to the aperture loss. As for the continuum measurements, we found a promising agreement between the incident and extracted fluxes.
In the EWS, we found that 35 out of the 600 Hα emission lines measured with S /N ≥ 3.5 have also the continuum detected with S /N ≥ 3.5. Similarly, in the EDS, 299 out of the 1161 Hα emission lines measured with S /N ≥ 3.5 have the continuum detected.

Estimation of the NISP-S detection limit
We present in Fig. 20 Table 2. the EWS simulation at H = 19.5 ± 0.2 mag and for the EDS simulation at H = 20.8 ± 0.6 mag. These limits are found for our sub-samples that contain galaxies with a median disk R50 of 0 . 4. The difference between the EWS and EDS inferred detection limit agrees with the expected 1.25 mag increasing depth expected for the EDS, which corresponds to an exposure time ten times longer.
We present in Fig. 20 (right panel) the S/N of the measurement on the Hα-complex line as a function of the incident Hα flux. The results for the EWS simulation are indicated in red and the results for the EDS simulation are indicated in blue. The corresponding lines are the median S/N calculated in bins of incident Hα flux including a fixed number of 50 sources. The error bars show the MAD. We indicated with the dashed black line the S/N of 3.5 and with star markers the Euclid RGS requirement for a 0 . 25 radius source. We found an emission line detection limit at S /N = 3.5 at (2.5 ± 0.6) × 10 −16 erg s −1 cm −2 for the EWS and at (6.9 ± 2.8) × 10 −17 erg s −1 cm −2 for the EDS. The difference in flux sensitivity between our EWS and EDS detection limits is in agreement with the expected increase that scales as the square root of the amount of dithered frames, that is √ 10.
We recall that these limits are found for our sub-samples that contain galaxies with a median disk R50 of 0 . 4. For comparison with the Euclid RGS Hα detection limit requirement made for a 0 . 25 radius source (indicated with star markers), we corrected the results for the disk R50 effect on the S/N to provide predictions for a source with a disk R50 of 0 . 25 (see Sect. 5.1.2) and found a very good agreement with the Euclid requirement. The corrected results are indicated with the dashed red and blue lines on the figure. We present in Table 2 a summary of the continuum and emission lines detection limits obtained for the EWS and EDS simulations. Notes. The results of the continuum detection limit are indicated in AB magnitudes in the H band. The results of the Hα detection limit are in erg s −1 cm −2 . The Euclid requirement for a 0 . 25 disk R50 source is indicated in italic.

Stacking analysis on the extracted spectra
We present in this section a stacking analysis that has been performed co-adding extracted spectra of different sources taken from our EWS simulation dataset. We assumed that redshifts are well determined from the Hα-complex emission line, by only considering objects with S/N(Hα-complex) ≥ 3.5. We also assumed that the stellar mass will be well constrained from the SED fitting analysis on photometric data from Euclid and external ground-based instruments (e.g. Rubin/LSST, DECAM, Subaru; see Scaramella et al. 2022).
In this analysis we highlight the effect of the stellar mass on the stacking analysis performance. To do so, we performed a stacking analysis on two M bins. The first bin contains sources with 9.5 ≤ log 10 (M [M ]) ≤ 10.0 (hereafter referred Stacked spectrum (21 co-added spectra) Incident stacked spectrum as sample 1). The second bin contains galaxies with 10.5 ≤ log 10 (M [M ]) ≤ 11.0 (hereafter referred as sample 2). We selected galaxies located at 1.5 ≤ z ≤ 1.8, that is the redshift range where Hα and [O III]λ5008 lines fall in the RGS passband, with S/N(Hα-complex) ≥ 3.5 and having [O III]λ5008 measurements with S /N < 3.5. Following the stacking method for sources located at different redshift described by Spilker et al. (2014), each co-added spectrum has been shifted in redshift to a common redshift that we chose to be the lowest redshift (z min ) of the samples 1 and 2, at z min = 1.51 and z min = 1.52 respectively. Each spectrum is resampled on a common wavelength array with the linear dispersion of the source located at z min , corresponding to the worst spectral sampling among the co-added stacked objects. The flux and wavelengths of the extracted spectra are scaled accordingly, with a similar procedure as described in Sect. 3.1. We then performed the stacking analysis calculating the weighted mean of the fluxes assuming a Gaussian behaviour for the noise. The RMS spectrum obtained co-adding the spectra scales as the inverse of the square root of the number of co-added spectra.
We present in Fig. 21 the results of the stacking analysis performed on the sample 1 and sample 2. We found that sample 2 requires about three times more co-added spectra than the sample 1 to obtain a similar S/N([O III]λ5008). The factor three comes from a combination of two effects. First, by construction, the [O III]λ5008/Hα of our simulated galaxies decreases with increasing stellar mass (and Hα luminosity), in agreement with what observed for SFGs at similar redshifts (Domínguez et al. 2013;Colbert et al. 2013). Figure 17 illustrates the median stellar mass difference between the Hα and [O III]λ5008 bright emitters, that is with the emission line measured at S /N ≥ 3.5. This makes it more difficult to detect the [O III]λ5008 emission from galaxies in the most massive sample 2. Second, as a consequence of the M -size relation, the average half-light radius of sample 2 (disk R50 ∼ 0 . 6) is about two times larger than that of sample 1 (disk R50 ∼ 0 . 3). This also contributes to an increase in the number of co-added spectra needed to detect the [O III]λ5008 emission line in the stacking analysis due to the drop in S/N with increasing galaxy size, as shown in Sect. 5.1.2. To quantify the effect of the size, we also performed the stacking on sources with similar Hα and [O III]λ5008 fluxes, split in two sub-samples with different average sizes (disk R50 ≤ 0 . 3 versus disk R50 ≥ 0 . 5). In this case, we found that two times the number of galaxies in the large-size bin are needed compared to galaxies in the smaller size bin in order to obtain similar S/N for the [O III]λ5008 emission line. This exercise reminds us that size effects should be fully taken into account, for example in the sample selection, in order to optimise the results and to avoid possible biases when stacking slitless spectra. Beyond these caveats, this analysis also shows the potential of the stacking approach to characterise the average interstellar medium (ISM) properties of galaxies through emission lines diagnostics even when only one line, for example Hα, is above the detection limit of the RGS.

Caveats
This work is a preliminary study of the NISP-S capabilities and some caveats related to the simulation setup are to be kept in mind when interpreting the results presented in this paper. We summarise these caveats as follows.
We avoided the contamination due to the overlap of the spectra and simulated only the first order spectra. Previous analysis have shown that the decontamination of slitless spectra can be well addressed when a direct image provides information on the positions, sizes and spectral shapes, and particularly when dispersed images with different grism orientations are available (Walsh et al. 2010;Momcheva et al. 2016;Ryan et al. 2018), as will be the case for Euclid.
We assumed a constant spectral dispersion on the field of view even if during the ground-test campaigns, using a Fabry-Perot etalon (see Gabarra 2023;Gillard et al., in prep.), the spectral dispersion varied according to the position on the detector. Our choice is justified by the additional phenomena that will alter the in-orbit spectral dispersion, for example launch vibrations, zero gravity conditions, and thermal stabilisation. The in-flight spectral dispersion calibration will be performed using compact planetary nebulae with known emission lines (Paterson et al., in prep.).
We considered the same size and shape in both the continuum and emission lines. This choice is motivated by the strong correlation shown by Bagley et al. (2020) between the size of galaxies in the continuum and Hα emission line in the redshift range targeted by Euclid.

Conclusions
In this work, we have presented the construction and simulation of spectroscopic data emulating those that will be produced by the RGS of the Euclid NISP spectrograph. We started by presenting the publicly released catalogues from the COSMOS and CANDELS/GOODS-N fields. We then built spectral energy distributions based on stellar population models using the software GALAXEV, referring to the physical properties available for each observed galaxy. Separately, we calculated the nebular emission line fluxes using observed scaling relations and photoionisation models as described in Sect. 3. Other efforts to predict emission lines using an alternative method based on cosmological simulations and photoionization models is currently ongoing (Hirschmann et al, in prep). A cross-check between these two approaches will be of great use in the context of the Euclid efforts for galaxy evolution studies.
We created two datasets aimed at providing realistic subsamples of the sources that will be detected by the RGS spectrograph in the EWS and EDS. The median disk R50 in the EWS and EDS sub-samples is 0 . 4. To probe the effects of galaxy morphology expected to be important in the slitless spectroscopy, we also built a dedicated set of simulations to characterise the impact of the angular size on the extracted spectra.
This work represents the first step in a campaign test to assess the performance of the NISP spectrograph in the context of galaxy evolution studies and the main results from the analysis can be summarised as follows: 1. The morphological parameter that most affects the quality of the extracted spectrum from the NISP instrument is the half-light radius. The increase in the half-light radius has the effect to degrade the spectral resolution, to decrease the S/N, and to increase the flux loss due to the extraction aperture.
In particular, we found that the emission line S/N drops by ∼45% when the disk R50 ranges from 0 . 25 to 1 . 2. With the simulated background levels described in Sect. 4, we inferred the 3.5σ NISP spectroscopic detection limit for the continuum at H = 19.5 ± 0.2 mag for the EWS simulation and at H = 20.8 ± 0.6 mag for the EDS simulation. 3. We have presented the median stellar mass of the sources expected to be detected as a function of redshift and of the targeted emission lines. For example, at z = 1.6 in the EWS configuration, we show that Euclid will detect the Hα emission line emitted for sources with a median log 10 (M ) ∼ 10.5 while the [O III]λ5008 emission line will be detected for sources with a median log 10 (M ) ∼ 10.0. This effect, which is related to the MZR, is of crucial importance for future Euclid science, for example to make a forecast as to the number counts of galaxies with two detected emission lines.
4. We found the 3.5σ detection limit for emission lines to be (2.5 ± 0.6) × 10 −16 erg s −1 cm −2 for the EWS and (6.9 ± 2.8) × 10 −17 erg s −1 cm −2 for the EDS. We corrected these results for the size effect and found a very good agreement with the Euclid RGS emission line detection limit requirement, which are expressed for a 0 . 25 radius source. 5. We characterised the effect of the stellar mass on the potential for the stacking analysis to unveil the [O III]λ5008 emission line otherwise too faint to detect and we show that about three times more co-added EWS extracted spectra are required for galaxies with 10.5 ≤ log 10 (M [M ]) ≤ 11.0 compared to galaxies with 9.5 ≤ log 10 (M [M ]) ≤ 10.0. This factor of three is the result of the fact that [O III]λ5008/Hα is lower and that the disk R50 is larger for the more massive galaxies. This analysis also shows that stacking Euclid spectra will be very promising to characterise the average ISM properties of galaxies when only one line, for example Hα, is above the detection limit. This pilot run represents an effort to assess the Euclid spectroscopic capabilities to detect SFGs and a coming paper (Lusso et al., in prep.) will present a similar study for AGNs. More so, upcoming simulations are being planned with a larger sample of galaxies, sampling different regions of the sky, and including the blue grism observations for the EDS.