Euclid Preparation. XXXVII. Galaxy colour selections with Euclid and ground photometry for cluster weak-lensing analyses

We derived galaxy colour selections from Euclid and ground-based photometry, aiming to accurately define background galaxy samples in cluster weak-lensing analyses. Given any set of photometric bands, we developed a method for the calibration of optimal galaxy colour selections that maximises the selection completeness, given a threshold on purity. We calibrated galaxy selections using simulated ground-based $griz$ and Euclid $Y_{\rm E}J_{\rm E}H_{\rm E}$ photometry. Both selections produce a purity higher than 97%. The $griz$ selection completeness ranges from 30% to 84% in the lens redshift range $z_{\rm l}\in[0.2,0.8]$. With the full $grizY_{\rm E}J_{\rm E}H_{\rm E}$ selection, the completeness improves by up to $25$ percentage points, and the $z_{\rm l}$ range extends up to $z_{\rm l}=1.5$. The calibrated colour selections are stable to changes in the sample limiting magnitudes and redshift, and the selection based on $griz$ bands provides excellent results on real external datasets. The $griz$ selection is also purer at high redshift and more complete at low redshift compared to colour selections found in the literature. We find excellent agreement in terms of purity and completeness between the analysis of an independent, simulated Euclid galaxy catalogue and our calibration sample, except for galaxies at high redshifts, for which we obtain up to 50 percent points higher completeness. The combination of colour and photo-$z$ selections applied to simulated Euclid data yields up to 95% completeness, while the purity decreases down to 92% at high $z_{\rm l}$. We show that the calibrated colour selections provide robust results even when observations from a single band are missing from the ground-based data. Finally, we show that colour selections do not disrupt the shear calibration for stage III surveys.


Introduction
In the last decade, galaxy clusters have proven to be excellent probes for cosmological analyses (see, e.g.Mantz et al. 2015;Sereno et al. 2015;Planck Collaboration XXIV 2016;Costanzi et al. 2019;Marulli et al. 2021;Lesci et al. 2022), also allowing for the investigation of dark matter interaction models (Peter et al. 2013;Robertson et al. 2017;Eckert et al. 2022) and gas astrophysics (Vazza et al. 2017;CHEX-MATE Collaboration 2021;Zhu et al. 2021;Sereno et al. 2021).As galaxy clusters are dominated by dark matter, the functional form of their matter density profiles can be derived from N-body dark-matteronly simulations (Navarro et al. 1997;Baltz et al. 2009;Diemer & Kravtsov 2014).This allows one to estimate the mass of observed clusters, which is essential for both astrophysical and cosmological studies (Teyssier et al. 2011;Pratt et al. 2019).Currently, weak gravitational lensing is one of the most reliable methods to accurately and precisely measure cluster masses (Okabe et al. 2010;Hoekstra et al. 2012;Melchior et al. 2015;Sereno et al. 2017;Stern et al. 2019;Schrabback et al. 2021;Zohren et al. 2022).Consequently, weak-lensing cluster mass estimates are widely used in current photometric galaxy surveys, such as the Kilo Degree Survey (KiDS; Kuijken et al. 2019;Bellagamba et al. 2019), the Dark Energy Survey (DES; Abbott et al. 2020;Sevilla-Noarbe et al. 2021), and the Hyper Suprime-Cam survey (HSC; Medezinski et al. 2018;Li et al. 2022).
An accurate selection of lensed background galaxies is crucial to derive a reliable cluster weak-lensing signal.Including the contribution from foreground and cluster member galaxies may significantly dilute the weak-lensing signal (Broadhurst et al. 2005;Medezinski et al. 2007;Sifón et al. 2015;McClintock et al. 2019).For example, background selections with 90% purity dilute the cluster reduced shear measurements by 10% (see, e.g.Dietrich et al. 2019), in the absence of intrinsic alignments (Heymans & Heavens 2003).Highly pure background selections are required to properly account for this effect in weak-lensing measurements, in order to minimise the variance in the selection purity.Selection incompleteness, instead, impacts the weaklensing noise and, in turn, the signal-to-noise ratio (S/N), which depends on the density of background sources along with the intrinsic ellipticity dispersion and measurement noise (see, e.g.Schrabback et al. 2018;Umetsu 2020).The effect of low background densities can be partially mitigated by increasing the size of the cluster-centric radial bins used in the analysis, or through the stacking of the weak-lensing signal of cluster ensembles.
⋆ e-mail: giorgio.lesci2@unibo.it Background selections based on the galaxy photometric redshift (photo-z) posteriors are commonly used in the literature (Gruen et al. 2014;Applegate et al. 2014;Melchior et al. 2017;Sereno et al. 2017;Bellagamba et al. 2019), as well as galaxy colour selections (Medezinski et al. 2010;Oguri et al. 2012;Medezinski et al. 2018;Klein et al. 2019).These selections can also be combined to significantly improve the background sample completeness and, in turn, the weak-lensing S/N.In fact, colour selections have been demonstrated to help identify galaxies with poorly defined photometric redshifts that would not have been classified as background sources through photo-z selection alone (Covone et al. 2014;Sereno et al. 2017;Bellagamba et al. 2019).
The aim of this paper is to develop a method to obtain optimal colour selections, namely with a maximal completeness given a threshold on purity, given any set of photometric filters.We provide, for the first time, colour selections expressed as a continuous function of the lens limiting redshift.This allows for a finer background definition compared to colour selections found in the literature (Medezinski et al. 2010;Oguri et al. 2012;Medezinski et al. 2018), implying a significant improvement in the weak-lensing source statistics.In view of Euclid and stage IV surveys, we derived colour selections on simulated data.We exploited the galaxy catalogue developed by Bisigello et al. (2020), hereafter referred to as B20, and extended by Euclid Collaboration: Bisigello et al. (2023), which includes simulated Sloan Digital Sky Survey (SDSS; Gunn et al. 1998) griz magnitudes and simulated Euclid observations in the Y E J E H E bands.In addition, we tested the efficiency of these colour selections on real public external data and on simulations, combining them with photo-z selections.
This paper is part of a series presenting and discussing mass measurements of galaxy clusters using the Euclid combined clusters and weak-lensing pipeline COMB-CL.COMB-CL forms part of the global Euclid data processing pipeline and is responsible for measuring weak-lensing shear profiles and masses for photometrically detected clusters.A comprehensive description of the code structure and methods employed by COMB-CL will be presented in a forthcoming paper, but a brief overview of the pipeline can be found in the appendix of Euclid Collaboration: Sereno et al. (2023).The galaxy colour selections presented in this paper are already implemented in COMB-CL.
The paper is organised as follows.In Sect.2, we describe the dataset used for the calibration of galaxy colour selections, and in Sect. 3 we detail a general method to derive optimal colour selections.In Sect.4, we show the selections obtained for griz Galaxies within the octagonal hatched region are excluded by applying Eq. ( 1).Specifically, (r − z) and (g − i) correspond to x and y in Eq.
and grizY E J E H E filter sets, validating them on external datasets.In Sect. 5 we compare the griz selection calibrated in this work with selections from the literature.Finally, in Sect.6, we draw our conclusions.

Calibration sample
We based our analysis on the photometric catalogue developed by B20 and extended by Euclid Collaboration: Bisigello et al. (2023).This catalogue contains simulated Euclid I E Y E J E H E aperture magnitudes1 , covering the spectral range 5500-20 000 Å, along with the Canada-France Imaging Survey (CFIS; Ibata et al. 2017) u band, for the galaxies contained in the COSMOS catalogue by Laigle et al. (2016, COSMOS15).Specifically, such photometry is based on 3 ′′ fixed-aperture magnitudes.Despite the u band already being present in COSMOS15, B20 derived it using the same approach adopted for the other filters in order to avoid colour biases.B20 verified that this provides results that are consistent with the observed fluxes.Simulated SDSS griz magnitudes, spanning the wavelength range 4000-11 000 Å, are also provided in the catalogue, since observations in similar filters, such as those in Vera C. Rubin Observatory (Rubin/LSST; Ivezic et al. 2008) and DES, will be available to complement Euclid observations (Euclid Collaboration: Pocino et al. 2021;Euclid Collaboration: Scaramella et al. 2022).Corrections for photometric offsets due to flux outside the fixed-aperture, systematic offsets, and Galactic extinction, as suggested in Laigle et al. (2016), have been applied.B20 derive simulated magnitudes through two alternative approaches.The first is a linear interpolation of the 30 medium-band and broad-band filters available in the COSMOS15 catalogue, based on the effective wavelength of the filters.The second approach is based on the best theoretical template that describes the spectral energy distribution (SED) of each galaxy, assuming the COSMOS15 redshifts as the ground truth.The SED fitting is performed based on COS-MOS15 bands and the template resulting in the minimum χ2 is used to predict the expected fluxes.We refer to B20 for the details of the SED templates used, based on the model by Bruzual & Charlot (2003).The expected fluxes are then randomised 10 times considering a Gaussian distribution centred on the true flux and with standard deviation equal to the expected photometric uncertainities, scaled considering the depths listed in Table 1 of Euclid Collaboration: Bisigello et al. (2023).In this process, the I E Y E J E H E magnitude errors expected for the Euclid Wide Survey are considered.Despite the fact that the griz photometry is based on SDSS filter transmissions, the corresponding uncertainties are based on depths that are consistent with those of DES and the Ultraviolet Near-Infrared Optical Northern Survey (UNIONS). 2 The ugriz photometry provided by LSST is expected to go from 1 to 2.5 magnitudes deeper at the end of the Euclid mission, depending on the photometric filter.Throughout this paper, we focus on the magnitudes derived from the best theoretical SED templates, as these estimates better reproduce absorption and emission lines that are not covered by COSMOS15 bands.We neglect u magnitudes since, due to the low u-band throughput, a 5σ depth of 25.6 mag will only be reached after 10 years of LSST observations 3 .In addition, the u band is not available in DES wide fields.We emphasise that the B20 catalogue contains all the galaxies present in the COSMOS15 sample, which is deeper than the shear samples derived from current surveys (see, e.g.Giblin et al. 2021;Gatti et al. 2021) and expected from the Euclid Wide Survey (Euclid Collaboration: Scaramella et al. 2022).As we discuss in the following, the colour selections calibrated in this study yield robust results against alternative magnitude cuts, including those that reproduce the selections adopted in current and Euclid cosmic shear analyses.

Method
In order to find a set of optimal galaxy colour-redshift relations that maximises the selection completeness given a threshold on the foreground contamination, we considered the colours given by any combination of photometric bands.This includes bands that are not adjacent in wavelength.Thus, for each colour-colour space, given a redshift lower limit, z l , corresponding to the lens redshift, we considered the following set of conditions, where ∨ is the logical 'or' operator, x and y are two different colours, and c i and s i are colour selection parameters.Specifically, c 1 , . . ., c 8 ∈ (−∞, +∞), s 1 and s 3 ∈ (0, +∞), while s 2 and s 4 ∈ (−∞, 0).The edges of the aforementioned parameter ranges are excluded, and Eq. ( 1) defines an irregular octagon that contains the foreground galaxies, as we show in Fig. 1.As we shall Combine the optimal conditions, deriving Exclude the z l points for which Subset of optimal conditions minimising S n f in Eq. ( 7) Fit p as a function of z l Calibrated optimal colour selection Fig. 2. Flowchart summarising the calibration process described in Sect.
3. Round red rectangles represent the start and end points of the calibration process.Grey rectangles represent processing steps, while blue trapezoids correspond to the inputs.
see, since we only select the colour conditions that satisfy given requirements, not all the sides of the irregular octagon may be considered.In addition, since we considered the conditions in Eq. (1) as independent, the c 1 , . . ., c 8 and s 1 , . . ., s 4 parameters are not related to each other.In particular, for each condition in Eq. (1), we derived the completeness, and the purity, where i is the ith colour condition index, z g is the galaxy redshift, p is the set of colour condition parameters, N sel,i is the number of galaxies selected with the ith colour condition, N tot is the total number of galaxies in the calibration sample, while the n f superscript represents quantities derived from colour conditions not fitted as a function of z l .As we shall see, we do not adopt any superscripts for the quantities derived from fitted colour conditions.In Eqs. ( 2) and ( 3), we have i = 1... N cond , where N cond is the number of all possible colour conditions, given Eq. ( 1), expressed as where N col is the number of colours, given by where N band is the number of photometric bands.We set requirements on completeness and purity to be satisfied by each colour condition in Eq. (1).Specifically, for a given z l , we selected the colour conditions having at least one p set providing C n f i (z l | p) and P n f i (z l | p) larger than their corresponding thresholds.We remark that p does not explicitly depend on z l at this stage, and that z l values are arbitrarily sampled.Setting a threshold on C n f i (z l | p) is important for excluding colour conditions that do not significantly contribute to the total completeness, and that may appear as optimal only due to statistical fluctuations.Thus, the threshold on C n f i (z l | p) is meant to be low compared to that on P n f i (z l | p).Indeed, as we shall detail in Sect.4.6, impurities in the background selection imply systematic uncertainties in galaxy cluster reduced shear measurements.Highly pure selections are required to properly account for this effect, in order to minimise the scatter in purity.We discuss the choice of the thresholds on C n f i (z l | p) and P n f i (z l | p) in greater detail in Sect.4.1.For each colour condition in Eq. (1), with parameter values for which the conditions on C n f i (z l | p) and P n f i (z l | p) are satisfied, we selected the p set providing the highest completeness at a given z l .In this way, we derived the set of optimal colour conditions maximising the selection completeness, given the chosen threshold on purity.
We note that the maximum z l of the calibrated colour selections depends on the C n f i (z l | p) and P n f i (z l | p) limits, while the minimum z l is derived by excluding the z l points for which Here, C n f tot and F n f tot are the completeness and the foreground failure rate given by the full set of optimal colour conditions, respectively.For simplicity, we drop the dependence on p in the text.The foreground failure rate is defined as follows: where N sel is the number of galaxies selected with all the optimal colour conditions, given a condition on z g , and P n f tot (z l ) is the purity given by the full set of optimal conditions.On the righthand side of Eq. ( 6), derived from Eqs. ( 2) and ( 3  (1), as a function of z l for the colour condition quoted in the left panel legend.The black dots represent the optimal values of s and c, while the blue curves represent the polynomial fits.
purity are chosen.We stress that F n f tot (z l ) ≤ 1 by definition.In the selection process described above, some colour conditions may be redundant.Thus, we iteratively searched for an optimal subset of colour conditions to find the minimum number of conditions sufficient to approximately reproduce the required completeness.Specifically, at each step of this iterative process, we computed the following quantity: C n f tot Completeness derived through the combination of all the optimal colour conditions.

C n f
Completeness given by the combination of a subset of optimal colour conditions.

C
Completeness obtained from a subset of optimal colour conditions fitted as a function of z l .
Notes.The n f superscript represents quantities derived from colour conditions not fitted as a function of z l .Optimal colour conditions satisfy the thresholds on purity and completeness, and provide maximal completeness.
where N is the number of z l points, C n f tot (z l, j ) is the completeness given by all optimal conditions, while C n f (z l, j ) is the completeness given by a subset of optimal conditions, computed at the jth z l value.As the first step of this iterative process, we found the optimal colour condition minimising S n f .Then, at each iteration, we added the colour condition that, combined with the conditions selected in the previous steps, minimises S n f .We repeated this process until S n f was lower than a given tolerance.We remark that the logical operator between colour conditions is ∨.
Lastly, we applied a nonlinear least squares analysis to find the best fit to the p parameters as a function of z l for the subset of optimal colour conditions.We chose the fitting formulae which best reproduce the z l dependence, namely polynomials, while aiming at minimising the number of free parameters in the fit.
In Fig. 2 we show a flowchart summarising the calibration process described in this section.In Fig. 3 we show an example of the iterative process detailed above, while Fig. 4 displays an example of parameter dependence on z l .Hereafter, we refer to the completeness, purity, and foreground failure rate, derived from sets of fitted colour conditions, as C(z l ), P(z l ), and F (z l ), respectively.For better clarity, in Table 1 we summarise the symbols referring to the completeness functions introduced in this section.

Calibration of colour selections
By applying the methods detailed in Sect. 3 and adopting the B20 calibration sample described in Sect.2, we calibrated galaxy colour selections using ground-based and Euclid photometry, namely SDSS griz and Euclid Y E J E H E filters, respectively.These selections are implemented in COMB-CL, and will be available for weak-lensing analyses of galaxy clusters.We considered the following cases: ground-only, Euclid-only, and the combination of ground-based and Euclid photometry.For the cases including Euclid photometry, we adopted an S/N threshold for Euclid near-infrared observations of (S/N) E > 3, which corresponds to Y E < 24.85, J E < 25.05, and H E < 24.95 (Euclid Collaboration: Scaramella et al. 2022).In addition, we considered z l points in the range z l ∈ [0.1, 2.5], assuming a precision of δz l = 0.1 for the sampling.To derive the full set of optimal colour con-  ditions, we imposed C n f i (z l | p) > 10% for the ith colour condition.For the ground-only and Euclid-only cases, we imposed that the purity of each colour condition is P n f i (z l | p) > 99%.We adopted a more restrictive threshold on purity for the combination of ground-based and Euclid photometry, corresponding to P n f i (z l | p) > 99.7%.This threshold is chosen as the larger number of colour combinations leads to a higher summation of impurities.We obtained P n f (z l ) > 97% for any z l , when combining all the optimal colour conditions, as shown in Fig. 5.As we shall discuss in Sect.4.3, the purity derived from different real datasets is stable, showing sub-percent changes, on average.
The F n f (z l ) decrease with increasing z l , shown in Fig. 5, is expected, as discussed in Sect.3. In addition, for any combination of photometric bands, we found C n f tot (z l ) = F n f tot (z l ) = 100% for z l = 0.1.Consequently, we set z l = 0.2 as the minimum lens redshift for the calibrated colour selections.As shown in Fig. 5, from griz photometry we derived a selection within z l ∈ [0.2, 0.8], with 84% completeness at z l = 0.2, decreasing to 29% at z l = 0.8.In the Euclid-only case, namely Y E J E H E and I E bands, results are not competitive with those derived from griz photometry.On the other hand, by combining ground-based and Euclid photometry, the completeness significantly increases in the z l range covered by the griz selection, by up to 25 percent points.Also the z l range of the selection is significantly extended compared to the griz case, corresponding to z l ∈ [0.2, 1.5].Specifically, in this case we exclude the Euclid I E band, as it covers a large wavelength interval, namely ∼ 5000-10 000 Å, corresponding to the wavelength range already covered by griz photometry.Furthermore, the use of very broad photometric bands is not the most optimal choice for calibrating galaxy colour selections, which share similarities with photo-z estimates.
We excluded any possible redundant colour condition, as detailed in Sect.3. In Table A.1 we show the subset of optimal colour conditions for the ground-only case, namely griz photometry, along with the corresponding parameter fits.The first condition quoted in Table A.1 corresponds to the one derived in the first step of the iterative process described in Sect.3.This is analogous for the subsequent conditions.We remark that the quoted conditions have different ranges of validity in z l .Analogous information is listed in Table A.2 for the combination of groundbased and Euclid photometry, corresponding to grizY E J E H E filters.We neglected the optimisation and parameter fitting for the Euclid-only case, as we have already shown that it does not provide competitive completeness values.
In Fig. 5 we show the results for the selections obtained from the subsets of optimal conditions, with parameters fitted as a function of z l .For both griz and grizY E J E H E photometry, such fitted selections well reproduce those given by the full sets of  A.1, applied to the B20 catalogue with (S/N) E > 3 and i ≤ i max (blue solid lines), to its subsample including galaxies with i < 24.4 (red dotted lines), to the case with i < 23.4 (green dash-dotted lines), and to the sample with z g < 1.5 (orange dashed lines).Bottom panels: efficiency of the grizY E J E H E selection, detailed in Table A.2, applied to the B20 catalogue with (S/N) E > 3 and i ≤ i max (black solid lines), to its subsample with i < 23.4 (green dash-dotted lines), and to the subsample with (S/N) E > 10 (magenta dashed lines).
optimal conditions.To quantify the goodness of the colour condition parameter fits, we defined a parameter analogous to S n f in Eq. ( 7), namely S.This parameter quantifies the difference between C n f tot , that is the completeness given by the full set of optimal conditions not fitted as a function of z l , and C, which is the completeness given by the subset of optimal colour conditions fitted as a function of z l .As shown in Fig. 5, S does not perfectly match S n f , for both griz and grizY E J E H E selections.This is due to the fact that the c 1 , . . ., c 8 , s 1 , . . ., s 4 parameters in Eq. (1) do not always show a simple dependence on z l .Despite the fact that better parameter fits could be achieved by adopting an arbitrarily high order polynomial as the model, we set a 4th order polynomial as the highest-degree functional form for describing these parameters (see Tables A.1 and A.2).As shown in Fig. 5, C is underestimated by at most 4 percent points.We verified that adding further conditions to these selections, that is, lowering the S threshold down to 0, provides sub-percent level improvements in the selection completeness, on average.We remark that, in order to derive colour selections not defined in z l bins, the final selection completeness is slightly degraded compared to C n f tot for some z l values.In realistic cluster weak-lensing analyses, however, we expect this to statistically increase the galaxy background completeness.When colour selections are defined on finite sets of z l points, the background galaxies are excluded based on the z l precision adopted in the colour selection calibration.

Dependence on magnitude and redshift selections
To verify the robustness of the griz selection with respect to alternative magnitude cuts, we applied the selection i < 24.4,corresponding to the peak value of the i magnitude distribution in the B20 catalogue.We also investigate the selection for the subsample with i < 23.4, which is a threshold similar to the DES i band limit (Sevilla-Noarbe et al. 2021).In both cases, we derived higher P(z l ) and lower F (z l ), compared to what we found from the calibration sample used in Sect.4.1, namely the one with (S/N) E > 3 and i ≤ i max , where i max = 24.9 is the maximum i magnitude in the sample (see Fig. 6).In the case with i < 24.4,C(z l ) is close to that from the calibration sample, while for i < 23.4 we derived higher completeness, on average.In addition, as the bulk of the redshift distribution in the calibration sample, described in Sect.2, extends up to z g ∼ 4, we applied the griz selection to the galaxy sample with redshift z g < 1.5, (S/N) E > 3, and i ≤ i max .In Fig. 6, we can see that this redshift limit provides F (z l ) values that are identical to those derived from the calibration sample, which is expected since F (z l ) does not depend on the maximum redshift of the sample, while the completeness increases by up to 10 percent points and the purity is at most 1 percent point lower.We note that the computation of C(z l ) and F (z l ) is made relative to the sample under consideration.In other words, they refer to galaxy populations defined by given magnitude and redshift limits.We measured the aforementioned colour selections by assuming a z l precision of δz l = 10 −3 .This δz l value is one order of magnitude lower (i.).Consequently, the δz l = 10 −3 precision ensures the reliability of the colour condition fits for galaxy cluster background selections.We remark that we assumed δz l = 0.1 for the z l sampling in the calibration process.
In Fig. 6 we show the efficiency of the grizY E J E H E selection, computed by adopting δz l = 10 −3 , applied to the B20 calibration sample, with (S/N) E > 3 and i ≤ i max .We found analogous selections from the subsample with i < 23.4 and from the one with (S/N) E > 10.Specifically, in both cases, we derived higher P(z l ) and lower F (z l ), in agreement with what we found from the griz selection.In addition, the increase in the minimum Euclid S/N does not significantly change the completeness, while the i < 23.4 limit decreases C(z l ) by at most 18 percent points.As we obtained excellent P(z l ) and F (z l ) estimates from these tests, we conclude that both griz and grizY E J E H E selections are stable and reliable with respect to changes in the sample limiting magnitude and redshift.In addition, we note that brighter galaxy samples provide lower foreground contamination.This is expected, as faint galaxies have more scattered colour-redshift relations.
In Fig. 6 we show the density of background galaxies, n b (z l ), defined as the number of selected galaxies with z g > z l per square arcmin.For both griz and grizY E J E H E selections, n b (z l ) = 16 arcmin −2 at z l = 0.2 for i ≤ i max and (S/N) E > 3, decreasing with increasing z l .In both colour selections, the i < 23.4 limit implies the largest decrease in n b (z l ), providing n b (z l ) < 7 arcmin −2 .In addition, for the griz selection, the i < 24.4 and z g < 1.5 limits provide consistent results on n b (z l ), showing a difference of at most 3 arcmin −2 compared to that derived from the calibration sample.With regard to the grizY E J E H E selection, the (S/N) E > 10 limit implies a decrease in n b (z l ) of up to 5 arcmin −2 at low z l , while n b (z l ) becomes compatible with that derived from the calibration sample for z l > 1.

griz selection validation on real data
To further assess the reliability of the griz colour selection detailed in Sect.4.1, we applied it to external datasets obtained from real observations.In particular, we considered the VIMOS Public Extragalactic Redshift Survey (VIPERS; Guzzo et al. 2014) Multi-Lambda Survey (VMLS) photometric catalogue by Moutard et al. (2016), including Canada-France-Hawaii Telescope Legacy Survey (CFHTLS; Hudelot et al. 2012) griz Kron aperture magnitudes (Kron 1980).This catalogue covers 22 deg 2 and provides reliable photometric redshifts for more than one million galaxies with a typical accuracy of σ z ≤ 0.04, and a fraction of catastrophic failures lower than 2% down to i ∼ 23.These statistics are based on VIPERS data, complemented with the most secure redshifts selected from other spectroscopic surveys.We remind that in VIPERS a colour-colour pre-selection was employed to enhance the effective sampling of the VIMOS spectrograph.Nevertheless, the VIPERS selection does not introduce any significant colour bias above z ∼ 0.6 (Guzzo et al. 2014).In addition, as we shall see in the following, the selection completeness and purity obtained from the VMLS dataset do not exhibit remarkable deviations from those obtained from other galaxy samples.In Fig. 7 we can see that, by applying the griz selection to the VMLS sample, we derived higher P(z l ) and lower F (z l ) compared to what we found from the B20 catalogue, on average.This agrees with what we found in Sect.4.2, as the Moutard et al. (2016) catalogue is shallower than the B20 sample.For the same reason, n b (z l ) is 3 arcmin −2 lower, on average.In addition, the completeness is up to 8 percent points higher for z l < 0.6, becoming lower for higher z l values.
We also applied the griz selection to the COSMOS CLASSIC catalogue by Weaver et al. (2022, COSMOS20), which reaches the same photometric redshift precision as COSMOS15, namely σ z /(1 + z) = 0.007, at almost one magnitude deeper.We considered griz Kron, 2 ′′ and 3 ′′ aperture magnitudes from HSC.In addition, we selected galaxies with a photometric redshift derived from at least 30 bands, and with i < 25, in order to consider a sample with highly reliable redshift estimates.By adopting more complex selection criteria, which may involve galaxies with photometric redshifts derived from a shared set of photometric bands, we do not expect remarkable differences in the results.Similar results for the cases with Kron, 2 ′′ and 3 ′′ aperture magnitudes are shown in Fig. 7. Compared to what we derived from the B20 sample, the completeness is similar, with the largest differences at z l > 0.6.In addition, F (z l ) is lower and P(z l ) is higher for any z l .For Kron and 3 ′′ aperture magnitudes, n b (z l ) is slightly higher compared to that obtained from the B20 sample, on average.Lower n b (z l ) values show up for the 2 ′′ aperture magnitudes, which is expected as we applied the same magnitude limit for each photometric aperture definition.Indeed, for these tests we did not include aperture correction terms.Lastly,  comparing the purity derived from the COSMOS20 and VMLS samples, we note that for z l > 0.3 the differences are below 1 percent point, on average.Thus, we conclude that the griz selection provides robust and reliable results on real data.

Validation on Flagship v2.1
We tested the colour selections calibrated in Sect., 15 • ], considering the galaxies in the whole redshift range covered by the simulation, namely z g ∈ [0, 3].Specifically, z g is the galaxy true redshift, and we verified that the contribution of peculiar velocities does not significantly change the results.We focused on 2 ′′ aperture LSST ugrizy and Euclid I E Y E J E H E photometry, as the simulated fluxes estimated for other ground-based surveys do not account for observational noise.Specifically, the photometric noise takes into account the depth expected in the southern hemisphere at the time of the third data release (DR3) for the Euclid Wide Survey.The LSST and Euclid 10σ magnitude limits, which are proxies for extended sources, correspond to u < 24.4,g < 25.6, r < 25.7, i < 25.0, z < 24.3, y < 23.1,I E < 25, Y E < 23.5, J E < 23.5, and H E < 23.5.The fluxes we considered are not reddened due to Milky Way extinction, consistent with the analyses performed in the previous sections.
In Fig. 8, we show the application of griz and grizY E J E H E selections to Flagship.For this test, we assumed 5σ magnitude cuts for LSST ugrizy and Euclid I E Y E J E H E bands.In addition, we show results from the B20 sample in Fig. 8, for which we assumed 5σ magnitude cuts rescaled from the 10σ limits listed in Euclid Collaboration: Bisigello et al. (2023, Table 1).We found that n b (z l ) derived from Flagship agrees with that obtained from the B20 sample.The largest differences, of about 1 arcmin −2 , arise when the grizY E J E H E selection is applied.We note that n b (z l ) ∼ 0 for z l ∼ 1.5, implying that lenses at these values of z l may not exhibit significant weak-lensing signals.Nevertheless, we verified that n b (z l ) is enhanced at any z l when the selection defined for Euclid weak-lensing analyses (Laureijs et al. 2011;Euclid Collaboration: Scaramella et al. 2022) is assumed.This selection consists in a 10σ cut in the I E band, corresponding to I E < 25 for a 2 ′′ aperture, yielding a galaxy density of around 39 arcmin −2 when applied to the Flagship dataset.In fact, in this case n b (z l ) ranges from 30 arcmin −2 at low z l to 3 arcmin −2 at z l = 1.5.
As shown in Fig. 8, on average we obtained higher P(z l ) and lower F (z l ) for z l < 1 from Flagship, compared to what we derived from the B20 sample.For the griz selection case, C(z l ) agrees with that derived from the B20 sample, with the largest differences, of up to 16 percent points, at z l ∼ 0.5.Larger differences in C(z l ) are obtained from the grizY E J E H E selection.From Flagship we obtained C(z l ) up to 10 percent points larger for z l < 0.6, and up to 50 percent points larger for higher z l .We verified that this discrepancy in the completeness, in the case of the grizY E J E H E selection, is not significantly attenuated through the assumption of 3σ and 10σ magnitude limits on both B20 and Flagship catalogues.Analogous results were obtained by assuming limits corresponding to the magnitude distribution peaks derived from the B20 catalogue, namely g < 24.9, r < 24.6, i < 24.3, z < 24.1, Y E < 23.8, J E < 23.6, and H E < 23.5.Moreover, we verified that the grizY E J E H E selection completeness does not remarkably vary by assuming the Euclid weaklensing selection defined above, namely I E < 25.Similar results are obtained by considering the photometric errors expected for the DR2 of the Euclid Wide Survey, assuming the corresponding 3σ, 5σ, and 10σ magnitude cuts.For each of the alternative magnitude cuts discussed in this section, we found that the grizY E J E H E selection yields a purity up to 3 percent points higher at z l > 1.2 when it is applied to the B20 catalogue, compared to what is derived from Flagship.At z l < 1.2, instead, the purity obtained from B20 is 1 percent point lower, on average.Furthermore, the alternative magnitude cuts do not remarkably impact the selection purity at any z l .
We additionally adopted SDSS fluxes, which do not include photometric noise, in place of LSST fluxes in Flagship.In this case, the completeness is up to 35 percent points larger than that derived from the B20 sample, and the purity approaches 100% for z l > 1, which is similar to what we derived from the B20 sample (see Fig. 8).Thus, the selection based on SDSS photometry is less complete and purer compared to that obtained from LSST magnitudes.
Differences in the completeness derived from the Flagship and B20 samples may originate from distinct assumptions on the physical properties of the galaxies, such as dust extinction, stellar age, nebular emission lines, or on the assumed intrinsic spectral energy distributions.This could be indicated by a different fraction of star forming galaxies in the two samples.Following B20, galaxies are classified as star forming if the following condition is satisfied, log 10 (sSFR/yr −1 ) > −10.5, (8) where sSFR is the specific star formation rate, derived from the best SED template in the catalogue by B20.We verified that, for z g > 1, the fraction of star forming galaxies in Flagship is consistent within 1 percent point with that derived from the catalogue by B20.Thus, we conclude that the completeness differences between the Flagship and B20 samples are not due to different star forming galaxy populations.We also verified that the log 10 (sSFR/yr −1 ) distributions derived from the two datasets are compatible, having peaks at ∼ −8.13 and ∼ −8.35 in B20 and Flagship, respectively.The agreement of these peak values is well within 1σ of the log 10 (sSFR/yr −1 ) distributions.We will be able to further investigate such completeness differences through the analysis of the first data release of the Euclid Deep Survey.

Comparison with photo-z selections
To compare the colour selections derived in this work to selections based on the galaxy p(z g ), commonly referred to as photo-z selections, we analysed the Flagship sample described in Sect.4.4.We considered only the galaxies with a p(z g ) estimate obtained with the NNPZ pipeline (Euclid Collaboration: Desprez et al. 2020).The NNPZ photo-zs are designed to work well for galaxies that are expected to be used in core Euclid weak-lensing science, namely with 5σ limits on the I E band.Thus we imposed I E < 25.75, along with 5σ limits on the Y E J E H E bands, namely Y E < 24.25, J E < 24.25, H E < 24.25.Specifically, we adopted the following photo-z selection, where z min g is the minimum of the interval containing 95% of the probability around the first mode of p(z g ), namely z g .We chose z min g in order to derive P(z l ) values which are compatible with those obtained from colour selections.We verified that adding a condition on the width of p(z g ) in Eq. ( 9) does not impact the results.Specifically, for the latter test, we considered the additional condition A > A min , where A is the integrated probability around z g , computed within the redshift points, which are the closest to z g , having an associated probability of 0.2p(z g ).We verified that imposing A min = 0 or A min = 0.8 leads to compatible purity values with sub-percent differences on average.However, A min = 0.8 lowers the photo-z selection completeness by around 20 percent points at all z l .Consequently, we assumed A min = 0.
To perform a fair comparison of colour and photo-z selections, we considered only the grizY E J E H E colour selection in this section.This is because photo-zs in Flagship were derived from the combination of ground-based and Euclid photometry.In Fig. 9, we show that the grizY E J E H E selection provides, on average, a completeness 15 percent points lower than that of the photo-z selection, with similar contamination.By combining grizY E J E H E and photo-z selections, through the logical operator ∨, the completeness increases by up to 10 percent points with respect to the case of photo-z selection alone, amounting to C(z l ) ∼ 95% for z l < 1.4.These preliminary tests confirm the importance of the combination of colour and photo-z selections, as it leads to significantly more complete background galaxy samples.We also remark that increasing the selection completeness is key to reduce biases in the shear calibration parameters due to background selections, as we shall detail in Sect.4.6.The analysis of Euclid data will allow for a detailed investigation of the optimal photo-z selections for galaxy cluster weak-lensing analyses, outlining the synergies with colour selections.For example, colour selections applied to Euclid data could provide more robust background samples for massive or nearby galaxy clusters, as derived by Medezinski et al. (2018).Leveraging colour selections also serves as a valuable cross-validation method for addressing the effect of unknown systematic uncertainties in photoz estimates.Lastly, Fig. 9 shows the selection based only on the first mode of p(z g ).Specifically, in this case we selected the galaxies with z g > z l .Despite C(z l ) > 90% at all z l , the purity is up to 10 percent points lower than that obtained from the grizY E J E H E selection.

Impact on shear measurements
In cluster weak-lensing analyses, the inclusion of foreground sources in the shear measurements may significantly dilute the signal (Broadhurst et al. 2005;Medezinski et al. 2007;Sifón et al. 2015;McClintock et al. 2019).As discussed in the previous sections, the calibrated colour selections provide P(z l ) < 1.To assess the impact of impurities on shear measurements, we can express the cluster reduced tangential shear unaffected by contamination as follows (Dietrich et al. 2019): where g t (z l ) is the measured cluster reduced tangential shear at redshift z l .As the calibrated colour selections yield P(z l ) > 0.97, we expect at most a 3% bias on the reduced tangential shear.
In addition, as discussed in Sect.4.3, P(z l ) derived from different observed datasets with only ground-based photometry shows a scatter below 1 percent point.This scatter in P(z l ) is lower than the systematic uncertainty on galaxy shape measurements for stage III surveys, as we shall discuss in the following.We remark that P(z l ) is derived from reference fields, while galaxy clusters are overdense compared to the cosmic mean.Thus, contamination from cluster galaxies must be properly accounted for in Eq. ( 10) (see, e.g.Gruen et al. 2014;Dietrich et al. 2019).Nevertheless, such contamination is consistent with zero in the typical cluster-centric radial range adopted for mass calibration, namely at radii larger than 300 h −1 kpc (see, e.g.Medezinski et al. 2018;Bellagamba et al. 2019).Furthermore, galaxy shear calibration is usually statistically derived, based on observed and simulated galaxy samples.Nevertheless, through galaxy cluster background selections, some galaxy populations may be systematically excluded.This may invalidate the statistical estimate of the shape multiplicative bias, namely m, depending on the shear measurement technique and on the actual properties of the data (Heymans et al. 2012;Miller et al. 2013;Hildebrandt et al. 2016).
The typical uncertainty on m found for stage III surveys ranges in the interval δm ∈ [1 × 10 −2 , 3 × 10 −2 ] (see, e.g.Jarvis et al. 2016;Melchior et al. 2017;Giblin et al. 2021).To assess the impact of colour selections on m, we considered the shape catalogues of Heymans et al. (2012), based on CFHTLS, and of Mandelbaum et al. (2018), based on the HSC Subaru Strategic Program (HSC-SSP; Miyazaki et al. 2018;Aihara et al. 2018).Throughout this section, we adopted a lens redshift of z l = 0.5.By applying the griz selection calibrated in this work, we derived a shift in the mean shear multiplicative bias of ∆m = 7 × 10 −3 in CFHTLS and of ∆m = −2 × 10 −3 in HSC-SSP.In addition, the Oguri et al. (2012) and Medezinski et al. (2018) colour selections provide ∆m = −3 × 10 −3 and ∆m = −1 × 10 −2 from CFHTLS, respectively, while from HSC-SSP we obtained ∆m = −5 × 10 −3 and ∆m = −7 × 10 −3 , respectively.Thus, galaxy population differences due to colour cuts provide systematic effects that are within the typical m uncertainty in stage III surveys.By combining colour and photo-z selections, we expect ∆m to become closer to zero.In Euclid-like surveys, shear has to be calibrated within an accuracy of 2 × 10 −3 (Cropper et al. 2013).As we discussed in Sect.4.5, the combination of grizY E J E H E and photo-z selections leads to 90% background completeness in the Euclid Wide Survey, on average; thus, we may expect the bias on m to be subdominant with respect to the required shear accuracy.Indeed, let us assume that 90% of galaxies, selected through the combination of grizY E J E H E and photo-z selections, have an average m similar to that derived from stage III surveys, namely ⟨m⟩ = 0.01.We assume that the remaining 10% of galaxies have a very biased m, namely ⟨m⟩ = 0.02, compared to the selected population.This would imply a systematic error of ∆m = 10 −3 in the average m of the selected population.We will delve deeper into these variations in m by examining the first data releases of the Euclid surveys.

Selection efficiency with missing bands
In this work, we derived colour selections based on griz and grizY E J E H E photometry.In some cases, however, the full groundbased griz photometry may be not available.For example, the DES Year 3 galaxy shape catalogue was not based on g band (Gatti et al. 2021), due to issues in the point spread function estimation (Jarvis et al. 2021).Thus, we investigated the efficiency of griz and grizY E J E H E selections in the case of a missing band, based on the B20 calibration sample described in Sect. 2. In performing this test, we excluded the colour conditions in Tables A.1 and A.2 containing the chosen missing bands.In Fig. 10 we show that, in the case of ground-only observations, the absence of the r band implies the largest completeness decrease, providing C(z l ) < 60%.In addition, the z l range is substantially reduced, corresponding to z l ∈ [0.2, 0.6].Also the absence of i and z bands implies a reduction of the maximum z l for the groundbased selection, corresponding to z l = 0.7 and z l = 0.6, respectively, and a completeness decrease of up to 10 and 20 percent points, respectively.On average, a 20 percent point drop in completeness is found in absence of g band photometry.Nevertheless, in the latter case the z l range is not reduced.We remark that the considered samples differ from case to case, as they contain only galaxies with photometry available in the required bands.
In Fig. 10 we show the effect of missing photometric bands on the combination of ground-based and Euclid observations.In this case, the lack of r band does not imply changes in C(z l ) for z l > 1.In the absence of i band, C(z l ) significantly decreases for z l ≳ 0.7, being below 30%, while the z l range is not reduced.A z l range reduction is obtained in the case of missing z or g bands, as we derived z l ∈ [0.2, 1.1] and z l ∈ [0.2, 1.3], respectively.On average, in the case of the combination of ground-based and Euclid observations, the largest completeness decrease is caused by the lack of the g band.
In this section, we defined colour selections with missing g, r, i, or z band, as subsets of the colour conditions defining the griz and grizY E J E H E selections.In order to assess the difference between the selections defined by such subsets and those that would be derived from the colour selection calibration described in Sect.3, we compute C n f tot for each case.In Fig. 10, we show the difference between C n f tot and C, the latter being derived by subsets of the colour conditions defining griz and grizY E J E H E selections.In the ground-only case, the lack of r band provides the largest C underestimation, as C n f tot − C ∼ 15 percent points for z l ∈ [0.3, 0.5].Nevertheless, in case of other missing bands, the average C n f tot −C is close to 0. The same holds for the combination of ground-based and Euclid photometry.We conclude that griz and grizY E J E H E selections provide robust results in the case of a missing band, except for ground-only observations without the r band, for which a dedicated calibration might be needed.

Comparison with literature ground-based selections
Based on the B20 sample considered in Sect.4.1, we compared our griz colour selection to those derived by Medezinski et al. (2010), Oguri et al. (2012), andMedezinski et al. (2018), which are also implemented in COMB-CL.As detailed below, for each of these selections, we considered two versions.One includes all the colour conditions provided by the corresponding authors, while the other comprises only a subsample of such conditions, providing lower foreground contamination.COMB-CL includes both versions of each colour selection.Medezinski et al. (2010) derived colour selections for three massive clusters, identified through deep Subaru imaging, by maximising their weak-lensing signal.COMB-CL provides the selection calibrated for the A1703 cluster at redshift z l ∼ 0.26, as this is the one based on gri photometry.This selection is expressed as follows, where ∧ is the logical 'and' operator.Notably, Eq. ( 11) defines the red background sample, namely the galaxies redder than cluster galaxies, while Eq. ( 12) defines the blue background sample.In Fig. 11, we can see that this selection provides C(z l ) = 60%, which is 20 percent points lower than that provided by the griz selection calibrated in this work.In addition, from the Medezinski et al. ( 2010) selection we derived P(z l ) > 96%, which is slightly lower than that obtained from the griz selection discussed in Sect.4.1.Foreground contamination can be attenuated by considering the red sample selection only, namely Eq. ( 11), as shown in Fig. 11.In this case, however, the completeness is lowered by 20 percent points.In Fig. 12 (upper panel), we show a comparison between the selection by Medezinski et al. (2010), namely Eqs. ( 11) and ( 12), and our griz selection in the (r − i) -(g − r) colour-colour space, by assuming z l = 0.26.Within this colour-colour space, we obtained C(z l ) = 55% and P(z l ) = 98% from the griz selection, while through the Medezinski et al. (2010) 11) -( 12), while the dashed lines are given by Eq. ( 11).The green curves represent the results from the Oguri et al. (2012) selection, where the solid lines are given by Eqs. ( 13) -( 16), while the dashed lines are given by Eqs. ( 13) -( 15).The grey curves refer to the Medezinski et al. (2018) selection, where the solid lines are given by Eqs. ( 17) -( 18), while the dashed lines are given by Eq. ( 17).
C(z l ) = 62% and P(z l ) = 95%.We remark that the full set of colour conditions defining the griz selection yields 80% completeness for z l = 0.26, and that a calibration based on gri bands only would yield larger completeness values in the (r −i) -(g−r) space (see Sect. 4.7).In addition, Fig. 12 shows that the griz selection extends the selected region defined by Eq. ( 11), thus enhancing the red background sample compared to Medezinski et al. (2010).On the other hand, the griz selection shows a more conservative definition of the blue background sample, compared to Eq. ( 12).Oguri et al. ( 2012) calibrated a selection based on gri photometry from the COSMOS catalogue by Ilbert et al. (2009), providing reliable results for lenses at redshift z l ≲ 0.7.This selection is expressed as The inclusion of Eq. ( 16) does not provide significant improvement in the completeness, causing a lower selection purity (Covone et al. 2014).In fact, Fig. 11 shows that the selection including Eqs. ( 13) -( 16) provides sub-percent improvements in C(z l ), compared to the selection including Eqs. ( 13) -( 15) only, while P(z l ) and F (z l ) are up to 1 percent point lower and higher, respectively.With respect to the griz selection calibrated in this work, the Oguri et al. ( 2012) selection provides a purity which is up to 5 percent points lower.This explains the higher completeness values for z l > 0. at z l = 0.26, the decrease in completeness due to a purity enhancement is much larger at z l = 0.6.This depends on the overlap of the foreground and background galaxy distributions in the (r − i) -(g − r) space.In addition, we remark that the calibration process presented in Sect. 3 excludes redundant colour conditions.This may partially explain the 27% completeness found in the case of the griz selection.Medezinski et al. (2018) calibrated a colour selection based on HSC observations, including griz bands, following an approach similar to Medezinski et al. (2010).This colour selection is expressed as where Similarly to Medezinski et al. (2010), Eqs. ( 17) and ( 18) define the red and blue background samples, respectively.This selection provides a much larger amount of contamination compared to that derived in this work, reaching P(z l ) < 90% for z l > 0.7, as shown in Fig. 11.However, by considering the red sample selection only, the purity improves by up to 6 percent points.In the latter case, compared to the griz selection detailed in Table A.1, C(z l ) is up to 50 percent points lower for z l < 0.7.For higher z l , the lower purity from the Medezinski et al. (2018) selection allows for higher completeness values.In Fig. 13 we show the redshift distributions of the galaxies selected through the griz, Medezinski et al. (2010), Oguri et al. (2012), andMedezinski et al. (2018) selections, assuming different z l values.At z l = 0.26, the griz selection shows a larger number of galaxies, of the order of 10 3 , which are correctly identified as background objects with z g < 0.6, compared to Medezinski et al. (2010).This results in the larger completeness of the griz selection shown in Fig. 11.At z l = 0.6, where the griz and Oguri et al. (2012) selections have the same completeness (see Fig. 11), the griz selection is less complete at z g > 1.5 and more complete at lower redshifts, compared to Oguri et al. (2012).At z l = 0.8, where the griz selection is remarkably purer than that by Medezinski et al. (2018), a notable incompleteness of the griz selection is evident at any z g , compared to Medezinski et al. (2018).In fact, for the case of the griz selection, Fig. 13 shows that the number of rejected galaxies at high redshift increases with the number of excluded foreground galaxies.This reflects the overlapping of foreground and background galaxy distributions in the considered colour-colour spaces.

Discussion and conclusions
We developed a method to derive optimal galaxy colour selections for cluster weak-lensing analyses, given any set of photometric bands.To this aim, we considered all the available colourcolour combinations.Based on the galaxy catalogue by B20, we calibrated selections based on ground-based griz and Euclid Y E J E H E bands, with purity higher than 97%.Specifically, we showed that the griz selection provides a completeness between 30% and 84%, in the lens limiting redshift range z l ∈ [0.2, 0.8].
The inclusion of Euclid Y E J E H E bands, leading to a grizY E J E H E selection, improves the completeness by up to 25 percent points in this z l range, allowing for a galaxy selection up to z l = 1.5.In addition, for the first time in the literature, we expressed such selections as a continuous function of z l .In the following, we summarise the main results obtained from the tests presented in Sects.4 and 5.
-The calibrated colour selections, described in Sect.4.1, are stable with respect to changes in the sample limiting magnitudes and redshift.-By applying the griz selection to the VMLS catalogue by Moutard et al. (2016) and to the COSMOS20 catalogue by Weaver et al. (2022), we derived completeness and purity estimates that are consistent with those obtained from the calibration sample by B20.Consequently, the calibrated selections provide stable results by assuming alternative photometric aperture definitions, obtained from different groundbased telescopes.-The application of griz and grizY E J E H E selections to the simulated Euclid Flagship galaxy catalogue v2.1.10(Euclid Collaboration in prep.)provided a purity of around 99%, on average, which is higher than that obtained from the B20 catalogue.The completeness from the Flagship and B20 samples is compatible in the griz selection case, while the grizY E J E H E selection provides up to 50 percent points higher completeness from Flagship.We verified that this discrepancy does not depend on magnitude limits.In addition, we found no significant differences in the star forming galaxy fraction from the Flagship and B20 samples.A calibration of the grizY E J E H E selection based on the Euclid Deep Survey will allow for a more thorough investigation of these completeness differences.-Based on the Flagship sample, we combined the calibrated colour selections with photo-z selections based on the p(z g ) shape.We showed that in this case the completeness is up to 95%.-We found no significant systematic effects on the multiplicative shear bias due to colour selections for stage III surveys.The first Euclid data releases will provide further insights into the influence of background selections on this bias.-The calibrated colour selections provide robust results in the case of a missing band from ground-based observations, except for those without the r band, for which a dedicated calibration might be needed.-Compared to the ground-based colour selections provided by Medezinski et al. (2010), Oguri et al. (2012), andMedezinski et al. (2018), the griz selection derived in this work is purer at high redshift and more complete at low redshift.
One potential enhancement to the calibration presented in this work could entail the inclusion of a magnitude dependence in the colour cuts.This might mitigate the impact of large photometric scatter at faint magnitudes (see, e.g.Schrabback et al. 2021).In addition, enhancing the set of photometric bands in the calibration sample, for example by including the LSST y band, could remarkably improve the effectiveness of the colour selections.The performance of colour selections could further improve through dedicated calibration samples.Ongoing spectroscopic programmes are specifically designed to calibrate the relationship between galaxy colours and redshifts to match the depth of the Euclid survey (Euclid Collaboration: Saglia et al. 2022).Furthermore, the colour selections presented in this work could improve the shear calibration in cluster weak-lensing analyses.The lensing signal from galaxy clusters differs from that of large scale structure in ways that affect both shear and photometric measurements.The dense cluster environment causes increased blending among light sources, due to both galaxy blends (Simet & Mandelbaum 2015;Everett et al. 2022) and the presence of diffuse intra-cluster light (Gruen et al. 2019;Kluge et al. 2020;Sampaio-Santos et al. 2021).In addition, cluster lines of sight exhibit characteristically stronger shear, especially at small scales (McClintock et al. 2019;Ingoglia et al. 2022).These effects can lead to distinct biases in shear measurements compared to those obtained from calibrations primarily designed for cosmic shear analyses.Through the combination of colour and photo-z selections, cluster shear calibration and mass bias can be assessed based on dedicated, multi-band cluster image simulations (see, e.g.Hernández-Martín et al. 2020).

Fig. 1 .
Fig. 1.Example of an uncalibrated selection in the (r −z) -(g−i) colourcolour space.The grey dots represent the selected galaxy colours.Galaxies within the octagonal hatched region are excluded by applying Eq. (1).Specifically, (r − z) and (g − i) correspond to x and y in Eq.(1), respectively.

Fig. 4 .
Fig. 4. Values of s (left panel) and c (right panel) parameters, from Eq.(1), as a function of z l for the colour condition quoted in the left panel legend.The black dots represent the optimal values of s and c, while the blue curves represent the polynomial fits.

Fig. 5 .
Fig.5.Summary of the results on the colour selection optimisation, based on the B20 galaxy sample.Top panels: Selection completeness (left panel), purity (central panel), and foreground failure rate (right panel), as a function of z l .The dashed lines represent the selections derived from the full sets of optimal conditions not fitted as a function of z l , in the case of ground-only (red), Euclid-only (green), and the combination of ground-based and Euclid bands (grey).The solid lines represent the selections obtained from the subsets of optimal conditions, with parameters fitted as a function of z l , in the case of ground-only (blue) and for the combination of ground-based and Euclid bands (black).Bottom panels: In the left panel, S and S n f are shown as a function of the iteration number.For the ground-based selection, using griz filters, S and S n f are represented by solid blue and dashed red lines, respectively.For the selection derived from the combination of ground-based and Euclid filters, namely grizY E J E H E , S and S n f are represented by solid black and dashed grey lines, respectively.In the right panel, the difference between C n f tot

Fig. 6 .
Fig.6.Results from the fitted colour selections derived in Sect.4.1, assuming the alternative magnitude and redshift selections described in Sect.4.2.From left to right: completeness, purity, foreground failure rate, and background density as a function of z l .The assumed z l precision is δz l = 10 −3 .Top panels: efficiency of the griz selection, detailed in TableA.1,applied to the B20 catalogue with (S/N) E > 3 and i ≤ i max (blue solid lines), to its subsample including galaxies with i < 24.4 (red dotted lines), to the case with i < 23.4 (green dash-dotted lines), and to the sample with z g < 1.5 (orange dashed lines).Bottom panels: efficiency of the grizY E J E H E selection, detailed in TableA.2,applied to the B20 catalogue with (S/N) E > 3 and i ≤ i max (black solid lines), to its subsample with i < 23.4 (green dash-dotted lines), and to the subsample with (S/N) E > 10 (magenta dashed lines).

Fig. 8 .
Fig.8.Application of the calibrated colour selections to the Flagship simulated sample described in Sect.4.4.From left to right: completeness, purity, foreground failure rate, and background density as a function of z l , from the fitted colour selections based on griz and grizY E J E H E bands, adopting 5σ magnitude limits.The assumed z l precision is δz l = 10 −3 .The solid blue and solid black lines represent the griz and grizY E J E H E selections, respectively, applied to the B20 catalogue.The dashed red and dashed green curves represent the griz and grizY E J E H E selections, respectively, applied to the Flagship v2.1 catalogue (Euclid Collaboration in prep.).

Fig. 9 .
Fig.9.Comparison of colour and photo-z selections.From left to right: completeness, purity, foreground failure rate, and background density as a function of z l , obtained from Flagship v2.1.The solid black lines represent the grizY E J E H E selection.The dashed green lines show the combination, through the ∨ logical operator, of grizY E J E H E and photo-z selection (Eq.9).The dashed red lines represent the photo-z selection, while the dotted black lines represent the selection based on the p(z g ) mode.

Fig. 10 .
Fig.10.Colour selection results, obtained from the B20 catalogue, in case of missing z (solid red), i (solid green), r (dashed orange), and g (dashed grey) bands.The blue curves represent the results from the griz and grizY E J E H E selections reported in Tables A.1 and A.2. Top panels, from left to right: completeness, purity, foreground failure rate, and background density are shown, in the case of ground-only photometry.Middle panels: colour selections from the combination of ground-based and Euclid photometry.The plot structure is analogous to that of top panels.Bottom panels: difference between C n f tot and C, for ground-only observations (left panel) and for the combination of ground-based and Euclid photometry (right panel).

Fig. 11 .
Fig. 11.Comparison of the griz selection described in Sect.4.1 with literature colour selections.From left to right: completeness, purity, foreground failure rate, and background density, derived from the B20 catalogue.The blue solid lines represent the griz selection derived in this work.The red curves refer to the Medezinski et al. (2010) selection, where the solid lines are given by Eqs.(11) -(12), while the dashed lines are given by Eq. (11).The green curves represent the results from theOguri et al. (2012) selection, where the solid lines are given by Eqs.(13) -(16), while the dashed lines are given by Eqs.(13) -(15).The grey curves refer to theMedezinski et al. (2018) selection, where the solid lines are given by Eqs.(17) -(18), while the dashed lines are given by Eq. (17).

6 .
For lower z l , theOguri et al. (2012) selection provides a completeness up to 35 percent points lower, which is expected as the selection byOguri et al. (2012) was calibrated for clusters at z l ∼ 0.7.Similarly to the comparison with the Medezinski et al. (2010) selection discussed above, in Fig. 12 (lower panel) we compare the griz and Oguri et al. (2012) selections in the (r − i) -(g − r) colour-colour space, assuming z l = 0.6.We obtained C(z l ) = 27% and P(z l ) = 98% from the griz selection, while with the Oguri et al. (2012) selection we found C(z l ) = 60% and P(z l ) = 94%.With respect to what we found by comparing griz and Medezinski et al. (2010) selections

Fig. 12 .
Fig. 12.Comparison of colour selections in the (r − i) -(g − r) colourcolour space.The solid grey contours indicate the 68%, 95%, and 99% galaxy number density in the calibration sample, described in Sect. 2. The blue shaded areas represent the regions excluded by applying the griz selection calibrated in Sect.4.1.Completeness and purity of the selections are reported in the legends.For the griz selection, C and P are computed by considering the colour conditions in Tab.A.1 which are defined in the (r − i) -(g − r) space.Top panel: the red hatched area shows the region excluded through the Medezinski et al. (2010) selection, and z l = 0.26 is assumed.Bottom panel: the green hatched area shows the region excluded through the Oguri et al. (2012) selection, and z l = 0.6 is assumed. c

Fig. 13 .
Fig. 13.From left to right: number of selected galaxies as a function of z g assuming z l = 0.26, z l = 0.6, and z l = 0.8.The z l values are represented by vertical black dashed lines.The blue histograms represent the griz selection calibrated in this work.The galaxy redshift distributions derived with the Medezinski et al. (2010), Oguri et al. (2012), and Medezinski et al. (2018) selections are represented by red, green, and grey hatched histograms, respectively.

Table 1 .
Description of the completeness functions introduced in Sect.3. Analogous descriptions hold for purity and foreground failure rate.
Adam et al. 201916;Maturi et al. 2019)tion of the fitted colour selection based on griz photometry, reported in TableA.1, to the datasets introduced in Sect.4.3.From left to right: completeness, purity, foreground failure rate, and background density as a function of z l .The assumed z l precision is δz l = 10 −3 .The griz selection is applied to the B20 catalogue with magnitude limits corresponding to those used in the calibration process (blue solid lines), to the full depthMoutard et al. (2016)catalogue (green solid lines), and to the Weaver et al. (2022) catalogue with HSC Kron, 2 ′′ and 3 ′′ aperture magnitudes (solid red, dashed orange and dotted black lines, respectively), for which we imposed i < 25. magnitude higher precision) than the typical galaxy cluster photometric redshift uncertainty in current surveys (see, e.g.Rykoff et al. 2016;Maturi et al. 2019)and Euclid (Euclid Collaboration:Adam et al. 2019 . The solid blue and solid black lines represent the griz and grizY E J E H E selections, respectively, applied to the B20 catalogue.The dashed red and dashed green curves represent the griz and grizY E J E H E selections, respectively, applied to the Flagship v2.1 catalogue (Euclid Collaboration in prep.).