\section{Introduction}

In a broad sense, galaxy observations are divided in two different methodologies: spectroscopy and photometry. Spectroscopic surveys (e.g., DEEP2 \citep{Davis2003}, GAMA \citep{Baldry2010} eBOSS \citep{Dawson2016a}, VIPERS \citep{Scodeggio2018}, VANDELS \citep{Pentericci2018}) provide enough spectral resolution to clearly distinguish emission lines, breaks, etc. from the spectral continuum, as well as to determine with high precision the redshifts of the observed galaxies, to the point of redshift errors being considered negligible for most applications. Nevertheless, spectroscopic observations require large integration times for each object, as well as previous target selection.

On the other hand, most photometric surveys observe with broad-band filters (e.g. KiDS \citep{DeJong2013}, DES \citep{Abbott2018}, DESI Legacy Imaging Surveys \citep{Dey2019}) which can observe entire sky fields with far less telescope time, thanks to the large full width at half maximum (FWHM) of the filters used (roughly of the order of $\sim 1000$ \AA). This filter width allows to obtain high signal-to-noise ratio (SNR) with relatively low integration times, but also prevents the observation of any spectral features other than the continuum, given the low spectral resolution.

A middle ground between spectroscopic and broad-band photometric surveys are narrow-band photometric surveys, with photometric filters of the order of $\rm FWHM \sim 100$ \AA. These offer much larger spectral resolution and higher redshift precision than their broad-band counterparts, without increasing observation time as much as spectroscopy. They also keep other advantages of photometric surveys: no specific target selection is required, and the reduction of their images is still significantly less complex than that of spectra. Most existing narrow-band surveys so far observed small areas of the order of few deg$^2$, covering the visible spectrum with medium-width filters of $\rm FWHM > 200$ \AA, such as COMBO-17 \citep{Wolf2003} or ALHAMBRA \citep{Moles2008}. Also, surveys specifically designed for the observation of certain emission lines with very few filters have also been carried out, like SILVERRUSH \citep{Ouchi2018} for the Ly$\alpha$ line.

Narrow-band surveys covering significant angular areas, sampling the whole visible spectrum with filters of $\rm FWHM \sim100$ \AA, have been proposed during the past decade, and are currently starting to reveal its potential. One example of these surveys is the ongoing Physics of the Accelerating Universe Survey \citep[PAUS,][]{Benitez2009}, whose data is employed in this work. PAUS has been primarily designed to determine high-precision photometric redshifts \citep{Marti2014, Eriksen2019}, mostly allowing for precise cross-correlation of lensing and redshift distortion probes \citep{Gaztanaga2012}. Other examples of narrow-band surveys with larger angular coverage are J-PAS \citep{Benitez2014}, J-PLUS \citep{Cenarro2019} and S-PLUS \citep{DeOliveira2019}. These more general-purpose narrow-band surveys show potential to resolve specific spectral features, with closer approximation to spectroscopy \citep[e.g.,][]{Stothert2018, Martinez-Solaeche2020}.

The observation of specific spectral features besides the spectral continuum allows us to determine key galaxy properties such as star formation rate (SFR), stellar age ans metallicity \citep[e.g.,][]{Worthey1994, Kauffmann2003a}; these spectral features are the results of different physical processes, and thus are a proxy to study the formation and evolution of galaxies. Generally, emission lines provide information about the ionised interstellar medium \citep[ISM;][]{Kewley2019}, while absorption lines inform of the properties of the stellar population \citep{Maraston2009}. For example, emission lines are commonly used to select active galactic nuclei (AGN) based on the Baldwin-Phillips-Terlevich (BPT) diagram \citep{Baldwin1981, Kauffmann2003, Kewley2013}, since they allow to discern between ionisation in the intergalactic medium (IGM) due to a soft UV source (e.g. star formation) or hard UV (e.g. AGN emission). On the other hand, absorption Lick indices are proxies for inferring stellar ages and metallicities \citep{Worthey1994, Thomas2003}.

The direct measurement of spectral features is generally reserved to spectroscopic surveys. However, galaxy properties can also be estimated with other methods, where the entirety of the spectrum is fit to stellar population models (full spectrum fitting). These fits are often convolved with the line-of-sight velocity distribution, which makes it especially useful to study galaxy kinematics. Some examples of full spectrum fitting codes are \textsc{STECKMAP} \citep{Ocvirk2006}, \textsc{ULySS} \citep{Koleva2009} and \textsc{pPFX} \citep{Cappellari2017}. Perhaps the most prominent one is spectral energy distribution (SED) fitting, in which a linear combination of spectral templates associated with different physical systems (stellar population models, dust emission/attenuation, AGNs, etc.) are fit to the observed spectral energy distribution, and the galaxy properties are inferred from the fit. This is a method widely applied to broad-band photometry, and several codes exist in the literature for this purpose, such as \textsc{LePHARE} \citep{Ilbert2006}, \textsc{CIGALE} \citep{Noll2009, Boquien2019} or \textsc{ProSpect} \citep{Robotham2020}; moreover, the application of SED-fitting codes for narrow-band photometric surveys has already been evaluated in \citet{Delgado2021} for the miniJPAS data release.

One spectral feature of special interest for this work is \textit{spectral breaks}: combinations of absorption lines in broader features that damp the continuum emission at given wavelength ranges. The most important of these features in the optical part of galaxy spectra is the 4000 \AA\ break, generated around that wavelength range by the absorption of several ionised metallic elements, as well as the latest lines in the Balmer series. The strength of this spectral break is quantified by the ratio between the continuum fluxes before and after the break itself; this quantity is known as the D4000 spectral index, or just \textit{D4000}. Two definitions for the D4000 with slightly different wavelength ranges exist in the literature: the original D4000 wide definition \citep{Bruzual1983, Hamilton1985}, and another defined in a narrower wavelength span \citep{Balogh1999}, which is the current standard. Henceforth, we will refer to these definitions as D4000$_{\rm w}$ and D4000$_{\rm n}$ respectively.

While D4000$_{\rm n}$ is generally preferred, mostly because it is far less sensitive to reddening effects due to the smaller continuum regions, both D4000 definitions have been extensively applied to study galaxy properties (e.g., stellar age, metallicity). The D4000 strength is correlated to the age of stellar populations: as galaxies grow old, they become redder and the strength of D4000 increases. However, it is also correlated with metallicity \citep{Worthey1994}, and when D4000 is used to determine galaxy ages, it is generally combined with metallicity indicators to break the age-metallicity degeneracy.

Given these characteristics, the D4000 has been widely used in galaxy evolution works as a measurement of stellar age, based mostly on D4000$_{\rm n}$ \citep[e.g.][]{Balogh1999, Brinchmann2004, Marcillac2006, Siudek2017}, but also D4000$_{\rm w}$ \citep[e.g.][]{Bruzual1983, Mignoli2005, Kriek2011, Kim2018}, or even alternative definitions \citep{Tresse1999}. In addition to these studies of galaxy properties, the D4000 has also been used in cosmology to independently determine the Hubble expansion rate, $H(z)$, with the method of cosmic chronometers \citep{Moresco2012}. In that work, the measurement of D4000$_{\rm n}$ is used to infer stellar ages of passive red galaxies; the age difference between redshift bins allows us to directly estimate the evolution of the Hubble parameter.

While the D4000 has been traditionally measured with spectroscopic observations, narrow-band photometric surveys may also yield enough spectral resolution for its measurement \citep{Stothert2018, Angthopo2020}. In this work, we will assess the possibility of measuring the D4000 with PAUS narrow-band photometry. In fact, due to its high spectral resolution for an imaging survey, several works have already partially explored the possibilities of its photometry to detect spectral features and/or derive galaxy properties with PAUS. For example, in \citet{Johnston2021} and \citet{Tortorelli2021} \textsc{CIGALE} is applied to PAUS photometry to derive rest-frame colours and luminosities, as well as stellar masses and SFRs, while the photometric redshift code developed in \citet{Alarcon2021} also estimates emission line fluxes. Detection of spectral features has also been evaluated, like the Ly$\alpha$ line for intensity mapping studies in \citet{Renard2021}, or even the possibility of D4000 measurements briefly evaluated with mock catalogues and synthetic datasets in \citet{Stothert2018}, which is a precursor to the work presented here.

In order to evaluate PAUS capability to determine the D4000 value, we develop an estimator for directly measuring this spectral feature over its narrow-band photometry, and compare this methodology against the spectroscopic measurements provided by the VIMOS Public Extragalactic Redshift Survey (VIPERS), as well as the ones obtained from the SED-fitting code CIGALE. In order to do so, the D4000 distribution and its average trends versus different observables (redshift, stellar mass, SFR) will be evaluated, as well as the validity of these D4000 measurements to discriminate between red and blue galaxies when compared to a fiducial classification. It is worth noting that this is the first work were the D4000 is determined by CIGALE using narrow-band photometry and compared to spectroscopy, although other works using CIGALE-derived D4000 with only broad-band photometry already exist. For example, in \citet{Buat2011} it is studied along other spectral features, in \citet{Boquien2012} it is used to examine the dependency of physical parameters on attenuation, and in \citet{Johnston2015} it is employed for galaxy classification. Moreover, the estimation of D4000 (as well as other spectral indices) with SED-fitting techniques has also been evaluated in \citet{Mejia-Narvaez2017} with synthetic J-PAS data.

The paper is structured as follows. In \Cref{sec:Data samples}, we will explain the observational datasets that have been used. The D4000 estimator specifically developed for narrow-band photometry will be discussed in \Cref{sec:Methodology: D4000 estimators}, as well as the estimation of D4000 and other galaxy properties with \textsc{CIGALE}. In \Cref{sec:Accuracy and distribution of D4000 estimations with PAUS and CFHTLS data}, the performance of the D4000 estimator will be evaluated against spectroscopic and SED-fitting results by evaluating its SNR, distribution and bias. In \Cref{sec:D4000 and galaxy properties}, the evolution of the D4000 as determined by each estimation method will be examined, as well as its performance for galaxy classification. We will conclude with \Cref{sec:Conclusions}.

\section{Data samples}\label{sec:Data samples}

\subsection{PAUS}\label{sec:PAUS}

PAUS is a narrow-band photometric survey carried out at the William Herschel Telescope. Observations are performed with a special-purpose instrument, the PAU Camera \citep{Padilla2019}, with a configuration of 40 narrow-band filters (NBs) uniformly spaced between 4550 \AA\ and 8450 \AA\ in steps of 100 \AA\ (see \cref{fig:PAUS_filters}). This filter configuration yields an average spectral resolution of $\rm R \sim 65$. It has targeted five different fields: the COSMOS field \citep{Laigle2016} and the wide fields (W1, W2, W3, W4) of the Canada-France-Hawaii Telescope Legacy Survey \citep[CFHTLenS,][]{Cuillandre2012, Hudelot2012}. In all fields, a broad-band reference catalogue is used as a detection mask (COSMOS and CFHTLS respectively), and the photometry is estimated on the areas given by this reference catalogue (a process known as \textit{forced photometry}, see \citealt{Eriksen2019}, \citealt{Cabayol2021}).

The current angular footprint of the survey is $\sim 50$ deg$^2$, and its catalogue is complete up to $i_{\rm AB}\leq23$, with slightly over 3 million galaxies if all fields are considered. The redshift range of the catalogue is $0<z<1.2$, and early results show that the photometric redshift is determined with an error of $\sigma_{68}/(1+z) = 0.0037$ to $i_{\rm AB}<22.5$ for a 50\% redshift quality cut \citep{Eriksen2019} in the COSMOS field. These benchmark results have been improved with enhancements over the original photo-z code \citep{Alarcon2021}, or machine learning approaches \citep{Eriksen2020, Soo2021}.

\begin{figure}
 	\includegraphics[width=\columnwidth]{PAUS_filters.pdf}
     \caption{Response functions for the PAUS narrow-band filters (coloured), together with VIPERS total wavelength range (light-grey shaded area), and the wavelength span considered for this study (dark-grey shaded area). The diagonal black lines represent the redshift of the wavelength limits of the D4000 (right y-axis) versus its observed wavelength, while the horizontal black lines highlight the redshift range for the D4000 measurement, given the wavelength coverage of our D4000 study. Solid line for D4000$_{\rm w}$, dash-dotted line for D4000$_{\rm n}$.}
     \label{fig:PAUS_filters}
\end{figure}


\subsection{VIPERS}\label{sec:VIPERS}

The VIMOS public extragalactic redshift survey \citep[VIPERS,][]{Guzzo2013, Scodeggio2018} is a spectroscopic survey carried out at the Very Large Telescope in Cerro Paranal, Chile, with the VIMOS instrument \citep{LeFevre2003}. The grism used for this survey (low-resolution red) yields a spectral resolution $R \simeq 220$. The wavelength coverage by VIPERS with this grism is shown in \cref{fig:PAUS_filters} as a light-grey shaded area. For this work, we utilise its second public data release, PDR-2 \citep{Scodeggio2018}.

The target selection of PDR-2 comprises objects in the redshift interval $0.5<z<1.2$, with a magnitude limit of $i_{\rm AB}\leq 22.5$, which makes it one of the deepest spectroscopic catalogues publicly available. The complete catalogue covers a total of $\sim 23.5$ deg$^2$, split between the CFHTLS W1 and W4 fields, which results in a catalogue of 86,775 galaxies in total.

\subsection{Sample selection}\label{sec:Sample selection}

Thanks to its unprecedented volume and the wealth of auxiliary data, VIPERS is an ideal spectroscopic dataset to validate PAUS capabilities. In order to do so, we have cross-matched the W1 VIPERS catalogue with PAUS observations, using a radius of 1 arcsec to match objects between catalogues. In \cref{fig:W1_angular_footprint}, the footprints of both catalogues in the W1 field are displayed; the cross-match between both yields a sample of 33,363 objects covering the whole PAUS redshift range ($0<z<1.2$). Moreover, we applied a cut based on the VIPERS redshift quality flags: only objects with $2\leq \texttt{zflg} <10$ or $22\leq \texttt{zflg} <30$ were included in the sample \citep{Scodeggio2018}. This cut keeps all the primary (i.e., in the original target catalogue) and secondary (i.e., observed in the slit but not in the target catalogue) objects with a redshift measurement good enough for science (>90\% confidence level), while removing AGNs from the sample. This redshift quality cut leaves the selected sample with 28,788 galaxies. 

\begin{figure*}
 	\includegraphics[width=\textwidth]{W1_angular_footprint.png}
     \caption{Survey footprint in the W1 field for PAUS (orange), VIPERS (purple) and the cross-match between both (brown). Each point represents an object in the catalogue.}
     \label{fig:W1_angular_footprint}
\end{figure*}

Given that VIPERS spectra are observed in a redder wavelength span than PAUS, the wavelength range selected for D4000 measurements goes from 5850 \AA\ to 8350 \AA\ (\cref{fig:PAUS_filters}, dark-grey area). With this choice of wavelength coverage, the low SNR regions at the limits of the spectrograph range are avoided, and an extra PAUS NB is left outside of range in the red end to avoid undesired boundary effects in the D4000 estimation. This restriction in wavelength coverage also implies a constraint in the redshift interval where the D4000 can be measured, as shown in \cref{fig:PAUS_filters} by the horizontal black lines. For D4000$_{\rm w}$ and D4000$_{\rm n}$, this redshift range is $0.562<z<0.967$ and $0.521<z<1.039$ respectively. Nevertheless, we have applied just the most stringent cut of $0.562<z<0.967$, in order to use the same sample to evaluate both D4000$_{\rm w}$ and D4000$_{\rm n}$. After applying this redshift cut to both PAUS photo-z and VIPERS spec-z, the selected sample has 17,375 objects, with a mean redshift $\langle z \rangle=0.731$.

In addition to the redshift cut, once the D4000 has been computed all objects with an invalid D4000 measurement have been removed. This includes objects with missing NBs or masked spectral regions needed for D4000 calculation, as well as objects whose CIGALE fits were deemed not good enough. This leaves a final sample of 17,241 galaxies that is used throughout this work.

\subsection{Redshift comparison}\label{sec:Redshift comparison}

A comparison of the distribution of PAUS photo-z and VIPERS spec-z for the W1 cross-match is shown in \cref{fig:z_comparison}. The orange box in the middle of the plot represents the $0.562<z<0.967$ cut in both redshift estimations; hence all objects inside the box are the selected sample for D4000 measurements. Most of the PAUS photo-z follows closely along the red diagonal line representing the 1:1 equivalence. It is worth noting that the determination of PAUS photo-z in the wide fields is still a work in progress, and thus some artefacts that can be appreciated in \cref{fig:z_comparison} (horizontal stripes) may disappear in future data releases.

\begin{figure}
 	\includegraphics[width=\columnwidth]{z_comparison.png}
     \caption{PAUS photo-z versus VIPERS spec-z, for the cross-match of 28.788 galaxies with accurate spec-z measurements. Points are coloured according to the logarithm of the point density (with lighter areas having more objects). The red line represents the 1:1 equivalence between redshift measurements. The redshift cuts introduced for the D4000 measurement, both in PAUS photo-z and VIPERS spec-z, are represented by the orange box.}
     \label{fig:z_comparison}
\end{figure}

We can further evaluate the performance of PAUS photo-z with its dispersion, $\sigma_{68}/(1+z)$. If we first define $\Delta z$ as

\begin{equation}\label{eq:delta_z}
    \Delta z = \frac{z_{\rm PAUS}-z_{\rm spec}}{1+z_{\rm spec}},
\end{equation}

we can define $\sigma_{68}$ as

\begin{equation}\label{eq:sigma68}
    \sigma_{68} = \frac{P_{\rm 84.1\%}(\Delta z) - P_{\rm 15.9\%}(\Delta z)}{2},
\end{equation}

where $P_{i \%}$ is the \textit{i}th percentile of the distribution. This $\sigma_{68}$ is equivalent to $\sigma$ if $\Delta z$ had a Gaussian distribution, while being much less sensitive to outliers. For this work, outliers have been defined as all galaxies which have $|\Delta z| > 0.15$, following \citet{Soo2021}. In \cref{fig:z_sigma_outlier}, the average $\sigma_{68}/(1+z)$ value, as well as the outlier fraction, is shown for both the PAUS photo-z and the broad-band photo-z from the CFHTLS reference catalogue \citep{Ilbert2006, Coupon2009}. For the D4000 redshift cut, the outlier fraction for PAUS is kept below 2\%, and PAUS photo-z shows a smaller scatter than the CFHTLS catalogue for the whole magnitude range ($\langle\sigma_{68}/(1+z)\rangle=0.019$ for PAUS, $\langle\sigma_{68}/(1+z)\rangle=0.032$ for CFHTLS). The worse performance of PAUS photo-z when compared to earlier works in the COSMOS field \citep[$\langle\sigma_{68}/(1+z)\rangle\simeq0.0037$ for a 50\% quality cut;][]{Eriksen2019, Alarcon2021} is partially due to the smaller number of exposures and higher mean redshift in the wide fields.


\begin{figure}
 	\includegraphics[width=\columnwidth]{z_sigma_outlier.pdf}
     \caption{$\sigma_{68}/(1+z)$ (middle panel) and outlier fraction (lower panel) for the PAUS photo-z (orange lines) and CFHTLS photo-z (green lines), in magnitude bins. Solid line represents the full cross-match, dotted line the redshift cut for D4000 measurement. Upper panel displays the magnitude histogram.}
     \label{fig:z_sigma_outlier}
\end{figure}


\subsection{Low-redshift sample: GSWLC-2}\label{sec:GSWLC-2}

In order to evaluate the usefulness of the D4000 measured on narrow bands in galaxy evolution studies, we analyse in \cref{sec:D4000 versus stellar mass and SFR} the evolution of D4000-mass relation at $0<z<1$. The low-redshift sample for this study was drawn from \citet{Turner2021}, extracted from the GALEX-SDSS-WISE Legacy Catalogue \citep[GSWLC-2][]{Salim2016, Salim2018}, which is based on the SDSS Data Release 10 \citep{Ahn2014}. This catalogue consists of galaxies within the footprint of the Galaxy Evolution Explorer \citep[GALEX][]{Martin2005, Morrissey2007}, with spec-z $0.01<z<0.3$ and Petrosian magnitude $r<18$. 
Moreover, additional cuts were applied in \citet{Turner2021} to keep only low-redshift objects ($0.02<z<0.08$) and ensure completeness (stellar masses above $10^{9.5}$ M$_{\odot}$). We refer the reader to \citet{Turner2021} for a full description of the GSWLC-2 sample, as well as a explanation of how stellar masses and other galaxy properties have been determined in this catalogue using CIGALE. The resulting sample of \citet{Turner2021} consists of 177,362 galaxies, with an average redshift $\langle z \rangle = 0.0058$ 

As low- and intermediate- redshift samples are coming from different surveys, \citet{Turner2021} have applied cuts to mimic the higher-redshift counterparts of low-redshift galaxy population. The stellar mass distribution for low- and intermediate- redshift sample is preserved, whereas at higher redshift galaxies have bluer colours and lower D4000 values (see \cref{fig:sm_histograms}). The low-z sample consists of galaxies that are the older and redder counterparts of galaxies at higher redshift allowing us to study galaxy evolution over the last 7 Gyr, i.e., half of the age of the Universe.

\begin{figure}
 	\includegraphics[width=\columnwidth]{sm_histograms.pdf}
     \caption{\textit{Upper panel}: Histogram of stellar mass distribution for the PAUS-VIPERS sample described in \cref{sec:Sample selection} (filled histogram), and the GSWLC-2 sample from \citet{Turner2021} (line histogram). \textit{Lower panel}: Same histograms, but for blue and red galaxies, classified with a single cut in the spectroscopic D4000$_{\rm n}$ \citep[D4000$_{\rm cut}=1.55$, as defined in][]{Kauffmann2003b}.}
     \label{fig:sm_histograms}
\end{figure}

\section{Methodology: D4000 estimators}\label{sec:Methodology: D4000 estimators}

In this section, we will describe in detail the two different methods used to measure the D4000 from PAUS data: the direct estimation by measuring the rest-frame bands over PAUS NBs (\cref{sec:Direct estimator}), and the SED-fitting procedure with CIGALE that, among other physical parameters, yields the D4000 of the galaxies in the selected sample (\cref{sec:CIGALE estimation}). Moreover, in \cref{sec:Direct estimator} we will also briefly review the general D4000 definition, as well as its calculation with spectroscopic data.

\subsection{Direct estimator}\label{sec:Direct estimator}

\subsubsection{Estimator definition}\label{sec:Estimator definition}

{The measurement of the D4000} is defined as the ratio between two average flux frequency densities ($F_\nu$), integrated in rest frame (also known as \textit{rest-frame bands}),

\begin{equation}\label{eq:D4000_definition}
{\rm D4000} = \frac{\langle F_\nu \rangle_{\rm red}}{\langle F_\nu \rangle_{\rm blue}}.
\end{equation}

If these average flux frequencies bands are to be directly measured on spectra, its integration is straightforward,

\begin{equation}\label{eq:D4000_band_integration}
\langle F_\nu \rangle = \frac{1}{(\lambda_{\rm max} - \lambda_{\rm min})(1+z)} \int_{\lambda_{\rm min}\cdot(1+z)}^{\lambda_{\rm max}\cdot(1+z)} d\lambda\, F_\nu(\lambda),
\end{equation}
where $\lambda_{\rm min}$ and $\lambda_{\rm max}$ are the wavelength boundaries for a given band, and $z$ is the redshift of the object.

In \cref{eq:D4000_definition}, $\langle F_\nu \rangle_{\rm red}$ is the integrated flux of the rest-frame band defined at wavelengths larger than 4000\AA\ (i.e., the region unaffected by the combination of absorption lines that causes the break itself), and $\langle F_\nu \rangle_{\rm blue}$ is the integrated flux at the rest-frame band at shorter wavelengths (where the continuum is affected by the set of absorption lines of the 4000 \AA\ break). The wavelength boundaries of these rest-frame bands are specified in \cref{tab:D4000_wavelengths}, as specified in \citet{Bruzual1983} for D4000$_{\rm w}$ and \citet{Balogh1999} for D4000$_{\rm n}$. We will refer to these bands, as well as to their integrated fluxes, as \textit{red band} and \textit{blue band} respectively (or simply \textit{D4000 bands}). The stronger the spectral break (i.e., the more absorption), the fainter the blue band compared to the red one, and the higher the D4000 value (since in \cref{eq:D4000_definition} the flux of the red band is in the numerator, while the blue band flux is in the denominator).

In this work, the measurements of the D4000 from VIPERS spectra have been computed following \cref{eq:D4000_band_integration} with the EZ redshift code \citep{Garilli2010}. If the D4000 has to be determined with narrow-band photometry, however, \cref{eq:D4000_band_integration} cannot be directly applied. The spectral resolution of the NBs is of the same order of magnitude as the width of the D4000 bands, and thus common numerical integration methods (e.g., Trapezoidal rule, Simpson's rule) may result in large inaccuracies. Consequently, we have developed a specific estimator to compute the D4000 bands with narrow-band photometry. While its performance will only be evaluated for PAUS in this work, by definition it can be applied to any combination of narrow-band filters, as long as their FWHM is smaller than the D4000 bands when shifted to the observed frame, and the wavelength coverage in the redshift range of interest is reasonably complete.

For PAUS NBs, $\langle F_\nu \rangle$ is computed as

\begin{equation}\label{eq:PAUS_estimator}
\langle F_\nu \rangle  = \frac{\sum_{\rm i}\Delta \lambda_{\rm i} r_{\rm i}^2 \sigma_{\rm i}^{-2} F_{\rm\nu\,i}}{\sum_{\rm i} \Delta \lambda_{\rm i} r_{\rm i}^2 \sigma_{\rm i}^{-2}},
\end{equation}
where $F_{\rm \nu\, i}$ and $\sigma_{\rm i}$ are the flux and its error for the band $i$, respectively, and the sum is over all the NBs considered for the D4000 measurement (\cref{fig:PAUS_filters}).

The $r_{\rm i}$ factor is the following ratio

\begin{equation}\label{eq:r_definition}
r_{\rm i} = \frac{\int_{\lambda_{\rm min}\cdot(1+z)}^{\lambda_{\rm max}\cdot(1+z)}d\lambda\, R_{\rm i}(\lambda)}{\int_0^\infty d\lambda\, R_{\rm i}(\lambda)},
\end{equation}
where $R_{\rm i}(\lambda)$ is the response function for the filter $i$. In the numerator, $R_{\rm i}(\lambda)$ it is integrated only over the limits of the D4000 band of interest (as defined in \cref{tab:D4000_wavelengths}), redshifted to the observed frame (hence the redshift of the object, $z$). In the denominator, however, the total area of $R_{\rm i}(\lambda)$ is computed. Thus, this $r_{\rm i}$ factor can be interpreted as the fraction of the NB that is inside the wavelength range of the D4000 band.

Regarding the $\Delta \lambda_{\rm i}$ factor in \cref{eq:D4000_definition}, it must be a term with wavelength units to make the broadest NBs weight more in the calculation of the D4000 bands. The definition we have chosen is simply

\begin{equation}\label{eq:d_lambda_definition}
\Delta \lambda_{\rm i} = \int_0^\infty d\lambda\, R_{\rm i}(\lambda),
\end{equation}

If the response functions $R_{\rm i}(\lambda)$ were ideal top-hat functions with a maximum value of 1, intuitively $\Delta \lambda_{\rm i}$ would be the width of the top-hat, and the product $\Delta \lambda_{\rm i}F_{\rm \nu\, i}$ would simply correspond to the area of the flux integrated by the NB $i$. Consequently, \cref{eq:PAUS_estimator} in this ideal case could be interpreted as a Riemann sum weighted by $r_{\rm i}^2 \sigma_{\rm i}^{-2}$. Hence, \cref{eq:PAUS_estimator} is the generalisation of a weighted Riemann sum to any set of photometric bands with response functions $R_{\rm i}(\lambda)$.

The weighting $r_{\rm i}^2 \sigma_{\rm i}^{-2}$ can be interpreted as the contribution of two different error sources: the error of the NB measurement itself ($\sigma_{\rm i}$), and the part of the NB corresponding to the flux integrated outside of the D4000 band of interest. All flux information coming from outside the D4000 band wavelength range can be regarded as noise; therefore a NB which has half of its area outside of the D4000 band should have half the SNR than a NB which is fully inside. This can be expressed in terms of a net error, $\sigma_{\rm net\, i} = r_{\rm i}^{-1} \sigma_{\rm i}$. Therefore, the weighting is just a standard inverse variance weighting ($\sigma_{\rm net\, i}^{-2}$), but using a $\sigma_{\rm net\, i}$ error that accounts for both the intrinsic error of the observation of each band flux, and the undesired flux information outside of the D4000 rest-frame band. Regarding the error of \cref{eq:PAUS_estimator}, it is simply determined by standard error propagation of the errors of the NB fluxes, $F_{\rm \nu \, i}$

In \cref{fig:D4000_measurement_example} an example of the D4000$_{\rm w}$ measurement for a single object is displayed, both for its VIPERS spectrum and PAUS NBs. The selected object is a galaxy with D4000$_{\rm w} \sim 1.7$, a value high enough to have a spectral break easily distinguishable by eye, and typical for red galaxies. Hence, it can be considered a fairly representative example of a red galaxy in our sample. The apparent magnitude of the object is $i_{\rm AB}=20.71$. The plot is shown in rest frame, and the values of the spectrum mean fluxes measured in the blue and red bands used to compute the D4000 index for VIPERS and PAUS are computed with \cref{eq:D4000_band_integration} and \cref{eq:PAUS_estimator} respectively. Besides, for PAUS the NB response functions are plotted with a faint grey colour for reference. The relevant data of regarding the D4000 measurement of the object shown in \cref{fig:D4000_measurement_example} are displayed in \cref{tab:example_object_data}. It is worth noting that if the PAUS D4000 is computed using the VIPERS spec-z, we find D4000$_{\rm w}=1.50\pm 0.14$, a result consistent with the PAUS value displayed in \cref{tab:example_object_data}, but not so much with its VIPERS counterpart. The reason for this discrepancy may lie in how the noise in PAUS NBs influence the determination of each photo-z, yielding D4000 values that are more self-consistent than these computed with an external redshift measurement. However, as it is shown in \cref{sec:SNR}, the actual D4000 error budget is perfectly accounted for by the errors in PAUS photometry alone.

\begin{table}
\centering
	\caption{Wavelength ranges for the blue and red rest-frame bands of \cref{eq:D4000_definition}, for both the D4000$_{\rm w}$ and D4000$_{\rm n}$ definitions.}
 	\label{tab:D4000_wavelengths}
 	\begin{tabular}{rcc}
 		\hline
 		 & Blue band (\AA) & Red band (\AA)\\
 		\hline
 		D4000$_{\rm w}$  & 3750-3950 & 4050-4250\\
        D4000$_{\rm n}$  & 3850-3950 & 4000-4100\\
		\hline
 	\end{tabular}
 \end{table}

\begin{figure}
 	\includegraphics[width=\columnwidth]{D4000_measurement_example_14342.pdf}
     \caption{Example of measurement of D4000$_{\rm w}$ bands (red and blue areas). PAUS NB fluxes are represented by black points with error bars, while the VIPERS spectrum is shown with a solid purple line; the dotted lines represent their respective D4000$_{\rm w}$ bands. PAUS response functions in rest-frame are plotted in very light-grey for reference (normalised to fit the plot). The VIPERS spectrum has been shifted to the rest frame using its spectroscopic redshift; while the PAUS photo-z has been used for PAUS data.}
     \label{fig:D4000_measurement_example}
\end{figure}

\begin{table}
\centering
	\caption{Redshifts, D4000$_{\rm w}$ measurements and catalogue IDs for the representative object displayed in \cref{fig:D4000_measurement_example}. The error for VIPERS spec-z is the average error specified in \citet{Scodeggio2018}.}
 	\label{tab:example_object_data}
 	\begin{tabular}{rccc}
 		\hline
 		 & ID  & z & D4000$_{\rm w}$ \\
 		\hline
        VIPERS & 117158758 & 0.6995 $\pm$ 0.0013 & 1.73 $\pm$ 0.03 \\
 		PAUS photo-z & 10691571 & 0.66 $\pm$ 0.025 & 1.65 $\pm$ 0.18\\
  		PAUS spec-z & 10691571 & 0.6995 $\pm$ 0.0013 & 1.50 $\pm$ 0.14\\
		\hline
 	\end{tabular}
 \end{table}


\subsubsection{Synthetic PAUS tests}\label{sec:Synthetic PAUS tests}

Before applying it to real PAUS data, the estimator for the D4000 bands defined in \cref{eq:PAUS_estimator} has been tested against synthetic PAUS NBs, in order to evaluate the potential biases stemming from the estimator alone, without the experimental errors in the PAUS photometry or photo-z, as well as other possible unaccounted systematics.

The synthetic PAUS dataset (sPAUS) has been generated by selecting the whole VIPERS sample in W1, and integrating the spectra for all PAUS NBs considered in this work (\cref{fig:PAUS_filters}). These synthetic NBs have been used to determine the D4000 with \cref{eq:PAUS_estimator}, using the respective spectroscopic VIPERS redshifts. Therefore, any deviations from the spectroscopic measurements must be due to our estimation method of the D4000 (which is limited by the spectral resolution of the narrow-band photometry).

A comparison between the VIPERS D4000 and the D4000 determined from sPAUS is shown in \cref{fig:bias_scatter_synth}, both for D4000$_{\rm w}$ and D4000$_{\rm n}$. In both panels, the scatter plot on the left displays the VIPERS D4000 versus the bias of the sPAUS D4000, defined as 

\begin{equation}\label{eq:bias_definition}
\rm{Bias\, (\%)} = 100 \cdot\left( \frac{D4000_{\rm sPAUS}}{D4000_{\rm VIPERS}} - 1 \right),
\end{equation}
together with a linear fit and its error (yellow line). The histogram on the right is a histogram of the bias, with its mean value and $\sigma$ shown in yellow. From these plots, it can be inferred that the D4000$_{\rm w}$ has a slight mean negative bias of the order of $\sim$-1\% that seems fairly constant across all the VIPERS D4000 range (the linear fit shows just a small correlation). On the other hand, the D4000$_{\rm n}$ shows a smaller net bias but also more dispersion, and a clear correlation between bias and D4000 values: D4000$_{\rm n}$ is overestimated for bluer galaxies (D4000$_{\rm n}<1.4$), while it is underestimated for higher values (i.e.,  for redder galaxies). Moreover, in both cases the total bias distribution in the histograms is fairly close to Gaussian. Some numerical results from this comparison are summarised in \cref{tab:bias_results}.

Overall, these results show a significant improvement over the preliminary analysis carried out in \citet{Stothert2018}, where a simple linear interpolation was used to estimate the D4000 over a similar synthetic catalogue (computed from SDSS spectra instead of VIPERS). In Figure 10 of \citet{Stothert2018}, a comparison akin to \cref{fig:bias_scatter_synth} is displayed, but showing only mean biases (without \%) in bins of the VIPERS D4000. While the same trends appear (a clear linear correlation in the D4000$_{\rm n}$), the absolute bias values are significantly lower in this work. This is especially noticeable on the low and high D4000 ends, e.g., at D4000$_{\rm n}\sim 2 $ \citet{Stothert2018} finds a mean bias of $\sim$-7.5\% (dashed line), while in this work the linear fit shows a bias of $\sim$-5\%. A similar improvement appears in the D4000$_{\rm w}$, where they find biases of $\sim$-7.5\% and $\sim$-2.5\% for the low and high D4000 ends, while \cref{fig:bias_scatter_synth} clearly shows smaller mean biases in these regions. Besides, their mean bias of $\sim$-2\% for the D4000$_{\rm w}$ found in \citet{Stothert2018} is reduced by a factor of two.

The reason for this improvement is the integration of the D4000 bands using an estimator that properly weights the flux fraction in each NB that is relevant to the rest-frame band (\cref{eq:PAUS_estimator}), as well as the observational error. With linear interpolation, NBs mostly outside the rest-frame band can still affect the slope of the interpolated SED (if they are adjacent to NBs "fully" inside the rest-frame band), and thus affect significantly the value of the integrated flux (\cref{fig:D4000_measurement_example} may help visualising this effect).

\begin{table}
\centering
	\caption{Mean and $\sigma$ of the bias for the D4000$_{\rm w}$ and D4000$_{\rm n}$ in the synthetic PAUS catalogue, together with the percentage of objects below absolute bias thresholds of 1\%, 2.5\% and 5\%.}
 	\label{tab:bias_results}
 	\begin{tabular}{rccccc}
 		\hline
 		 & & & \multicolumn{3}{c}{\% with absolute bias}\\
 		 & Mean bias (\%)  & $\sigma$ bias (\%) & $<$1\% & $<$2.5\% & $<$5\%\\
 		\hline
 		D4000$_{\rm w}$ & -1.03 & 2.59 & 41.06 & 77.21 & 95.11 \\
 		D4000$_{\rm n}$ & -0.23 & 3.19 & 32.07 & 67.44 & 92.62 \\
		\hline
    \end{tabular}
\end{table}

\begin{figure*}
 	\includegraphics[width=\columnwidth]{scatter_wide.png}
 	\includegraphics[width=\columnwidth]{scatter_narrow.png}
     \caption{The bias of the D4000 measured in the synthetic PAUS NB, vs VIPERS D4000 values. A linear fit with its error and the mean bias and its $\sigma$ in the histograms are marked with yellow lines and areas, respectively. \textit{Left:} D4000$_{\rm w}$. \textit{Right:} D4000$_{\rm n}$.}
     \label{fig:bias_scatter_synth}
\end{figure*}

In addition to the dependency of the bias with the VIPERS D4000, we investigate its correlation with redshift. Given that the D4000 bands are defined in rest frame, the $r_{\rm i}$ factor in \cref{eq:r_definition} and thus the NBs used in the D4000 calculation will be a function of $z$. Therefore, one could expect the redshift regions where the NBs better match the D4000 bands to be less biased and vice-versa (i.e., when the D4000 bands are covered solely by NBs fully inside the band, the measurement should be more accurate). As a consequence, the bias as a function of redshift should exhibit an oscillatory pattern as redshift increases and the D4000 bands shift to redder wavelengths in observed frame (since there will be an alternation of "good" and "bad" NB matches to the D4000 bands).

It is worth noting that this redshift dependency is just an effect of the relative position of the NBs with respect to the redshifted D4000 bands; any possible effect derived from galaxy evolution or observational systematics dependent on redshift is not considered. Since we are working with synthetic NBs integrated from VIPERS spectra, we can shift the wavelength of the spectra with the following change of variable before NB integration,

\begin{equation}\label{eq:apparent_redshift}
    \lambda' = \frac{1+z_{\rm apparent}}{1+z}\lambda,
\end{equation}
where $z$ is the actual redshift of the object, and $z_{\rm apparent}$ is the the redshift we want the NBs to "observe" the object with. This transformation is akin to shifting the object to the rest frame and then moving it to a different observed frame defined by $z_{\rm apparent}$. Hence, we can evaluate the redshift bias of any object not only at its real redshift $z$, but at any $z_{\rm apparent}$, as long as the D4000 can still be measured in the new observed frame.

Consequently, we have evaluated the redshift bias for all objects in the VIPERS W1 sample by computing their NBs in a fine $z_{\rm apparent}$ grid. The results are shown in \cref{fig:redshift_bias}. The bias appears as a continuous function because of the small grid size. At each point, the displayed bias and its error are respectively the mean bias and its $\sigma$ of all the objects of the VIPERS W1 sample where the D4000 could be measured after applying \cref{eq:apparent_redshift}.

\begin{figure}
 	 \includegraphics[width=\columnwidth]{bias_zt.pdf}
     \caption{Bias versus $z_{\rm apparent}$ for the D4000$_{\rm w}$ (upper panel) and D4000$_{\rm n}$ (lower panel). Grey line and shaded area represent the mean bias and its $\sigma$ for each $z_{\rm apparent}$, while the yellow line and its shaded area are the mean bias and $\sigma$ for the whole $z_{\rm apparent}$ range.}
     \label{fig:redshift_bias}
\end{figure}

For the D4000$_{\rm w}$, this redshift bias oscillates $<$2\% around the mean bias, while in D4000$_{\rm n}$ the oscillations reach well above 2\%. In both cases, the oscillations become significantly smaller as redshift increases, because the larger the redshift, the wider the D4000 bands in observed frame, and the smaller the error induced by NBs partially outside the D4000 band ($0<r_{\rm i}<1$). Moreover, the oscillations seem fairly stable around the mean bias (yellow lines); hence we can consider the redshift oscillations independent of the D4000 bias (see \cref{fig:bias_scatter_synth}).

After these tests, we can state that our estimator for NB photometry has a mean bias of $\sim-1.03\pm2.59$\% and $\sim-0.23\pm3.19$\% for D4000$_{\rm w}$ and D4000$_{\rm n}$ respectively (see \cref{tab:bias_results}), plus an oscillatory redshift bias due to the relative position of the NBs to the D4000 bands in observed frame. This oscillatory bias  adds an extra $\sim$2\% to the D4000$_{\rm w}$ in the worst cases (yielding a much smaller effect in most of the redshift range), while this increase is also larger for the D4000$_{\rm n}$. Besides, for D4000$_{\rm n}$ there is a clear decreasing linear correlation between bias and D4000 value, while for D4000$_{\rm w}$ this correlation is much weaker. In any case, a significant fraction of the sample shows sub-percent bias (41\% and 31\% for D4000$_{\rm w}$ and D4000$_{\rm n}$ respectively), and the large majority has an absolute bias below 5\% (95\% and 93\% respectively, see \cref{tab:bias_results}). Given these results, no bias corrections have been applied to the D4000 measurements, since the errors of the bias are larger than the biases themselves.

Overall, the estimation of the D4000$_{\rm w}$ through this method seems more reliable, but given the preponderance in the literature of the D4000$_{\rm n}$, we will consider both for scientific use. Considering that these results are for a synthetic dataset generated from spectroscopic data, without the larger photometric and redshift errors from narrow-band photometry, it is safe to assume that the biases of the estimator are negligible, or at least completely subdominant, when compared to the observational errors that we can expect.

\subsection{CIGALE estimation}\label{sec:CIGALE estimation}

In addition to the direct measurement over PAUS NBs, we have used the SED fitting algorithm Code Investigating GALaxy Emission \citep[CIGALE;][]{Noll2009, Boquien2019} to derive D4000 estimations from photometric observations. CIGALE is a physically-motivated state-of-the-art Python code for SED fitting based on the principles of the energetic balance between dust-absorbed stellar emission and its re-emission in the infrared (IR). The capabilities of this SED fitting tool have already been verified on PAUS observations \citep{Johnston2021, Tortorelli2021}. For this work, we have used a delayed star formation history, \citet{Bruzual2003} single stellar population models with the initial mass function (IMF) given by \citet{Chabrier2003}, a \citet{Charlot2000} attenuation law and the dust emission models of \citet{Dale2014} to built a grid of models. A detailed description of each module can be found in \citet{Malek2018} and \citet{Boquien2019}.

The adopted parameters employed for the SED fitting are listed in \cref{tab:cigale}.
Thanks to the use of only one free parameter in the \citet{Dale2014} model (i.e., the $\alpha$ slope in $dM_{\rm dust} \propto U^{-\alpha}dU$, where $M_{\rm dust}$ and $U$ are dust mass and radiation-field intensity, respectively), the SED-fitting procedure reduces the number of parameters to constrain without far infrared measurements. Those models are then fitted to the galaxy SEDs with the use of a Bayesian-like analysis. The quality of the fit is expressed by the reduced $\chi^2$, $\chi_{\rm r}^2$ (i.e., the $\chi^2$ divided by the number of data points). We have applied a quality cut to these fits by removing all objects with a $\chi_{\rm r}^2$ larger than ${\rm median}(\chi_{\rm r}^2)+3$ (in all CIGALE runs considered). This results in 802 objects being removed from the selected sample described in \cref{sec:Sample selection}, before the redshift cuts for D4000$_{\rm w}$/D4000$_{\rm n}$ measurement (the galaxy numbers displayed for these redshift ranges already take into account this quality cut).

For this work, SEDs were fitted to galaxies using: i) PAUS redshift and its corresponding NB photometry (hereafter \textit{PAUS CIGALE}), and ii) CFHTLS redshift \citep{Ilbert2006, Coupon2009} and its broad-band photometry (hereafter \textit{CFHTLS CIGALE}). These two datasets allow us to explore the improvement of D4000 measurement accuracy with narrow-band photometry. As one may expect more improvement fitting both NBs and broad bands, we also run CIGALE with both PAUS NBs and CFHTLS broad-band photometry, but the results were more discrepant with VIPERS spectroscopy than PAUS NBs alone. By adjusting the $\chi^2$  computation procedure \citep{Eriksen2019}, the combination of PAUS and CFHTLS photometry should yield better results than PAUS alone; however, any modifications to CIGALE are left as future work.

\begin{table*}
\centering
	\caption{The input parameters used for SED fitting with CIGALE.}
	\begin{tabular}{l | l}
\hline
Parameter & Values\\
\hline
\multicolumn{2}{c}{Delayed star formation history}\\
\hline
e-folding time of the main stellar population model [Myr] & 100, 300, 500, 1000, 2000, 5000\\
Age [Myr] & 300, 500, 1000, 1500,2500, 4500, 6000\\
\hline 
\multicolumn{2}{c}{Single stellar population \citep{Bruzual2003}}\\
\hline
Initial mass function & \citet{Chabrier2003}\\
Metallicity [$Z_{\odot}$] & 0.02\\
Age of separation between young and old stellar populations [Myr]  & 10\\
\hline
\multicolumn{2}{c}{Dust attenuation law \citep{Charlot2000}}\\
\hline
V-band attenuation ($A_{\rm V}$) in the interstellar medium (ISM) & 0.01, 0.1, 0.4, 0.7, 1.0, 1.5, 2.0, 2.5\\
Power law slopes of the attenuation in the birth clouds (BC) and ISM & -0.7\\
$A_{\rm V}$ ISM / ($A_{\rm V}$ BC +$A_{\rm V}$ ISM) & 0.8\\
\hline
\multicolumn{2}{c}{Dust emission \citep{Dale2014}}\\
\hline
AGN fraction & 0.0, 0.1, 0.3\\
Power law slope dU/dM ($U^{\rm \alpha }$)  & 2.0\\
\hline
\multicolumn{2}{c}{Nebular emission model}\\
\hline
Ionisation parameter & $10^{-2}$\\
Escape fraction of Lyman continuum photons & 0.0\\
Absorption fraction of Lyman continuum photons & 0.0\\
\hline
\end{tabular}
\label{tab:cigale}
\end{table*}	


\section{Accuracy and distribution of D4000 estimations with PAUS and CFHTLS data}\label{sec:Accuracy and distribution of D4000 estimations with PAUS and CFHTLS data}

Here, the different methods of D4000 measurement presented in the previous section are compared against each other. The D4000 determination from PAUS NB photometry (\cref{sec:Direct estimator}) will simply be referred to as \textit{PAUS direct}, while the D4000 measurements with CIGALE (\cref{sec:CIGALE estimation}) will be referred to as explained in the previous subsection.

\subsection{SNR}\label{sec:SNR}

We have computed both D4000$_{\rm w}$ and D4000$_{\rm n}$ for the sample specified in \cref{sec:Sample selection}, and examined the signal-to-noise ratio (SNR) for each method. \Cref{fig:snr_histogram} displays the SNR distribution for the D4000 measurements with each method (PAUS direct, CIGALE runs and VIPERS spectroscopy), together with the detection threshold we have imposed at $\rm SNR > 3$. This SNR limit has been chosen because it is commonly used in astrophysics as a threshold for source detection in imaging or spectral features, whether it is in the visible spectrum \citep[e.g,][]{Cutri2003, Sanchez2012}, X-ray \citep[e.g.,][]{Bulbul2014} or infrared wavelength range \citep[e.g.,][]{Labbe2013}. The distribution of VIPERS SNR appears as a dashed line; throughout this paper we will use the convention of representing photometric redshifts with solid lines and spectroscopic redshift data with dashed lines.

As shown in \cref{fig:snr_histogram}, the SNR from CIGALE measurements is significantly larger than the one from PAUS direct. The D4000 values from both CIGALE runs have a mean SNR of $\sim$20, being slightly larger for the CFHTLS case. In both CIGALE runs, all objects in the selected sample are well above the detection threshold, while in the PAUS direct case only 85.01\% (65.87\%) of D4000$_{\rm w}$ (D4000$_{\rm n}$) measurements have $\rm SNR > 3$. The mean SNR from the direct method is $\sim$5 for the D4000$_{\rm w}$ and $\sim$4 for the D4000$_{\rm n}$. Regarding the spectroscopic VIPERS D4000, we find a mean SNR of $\sim$35 for the D4000$_{\rm w}$ and $\sim$20 for the D4000$_{\rm n}$. The larger SNR in the D4000$_{\rm w}$ for both methods is simply due to the larger wavelength range of the D4000 bands for the D4000$_{\rm w}$ definition: if flux is integrated over a larger span, higher SNR is to be expected. The CIGALE D4000, however, seems insensitive to this effect, given that it uses all available flux information to fit a model that predicts a D4000 value. This results in a SNR that is closer to spectroscopy for D4000$_{\rm n}$.

It is reasonable to expect a higher SNR from SED fitting than PAUS direct, given that the spectral information provided to CIGALE spans a much larger wavelength window. CIGALE uses all reference broad-bands or PAUS NBs, while in the PAUS direct measurement just the NBs that may contain part of the D4000 bands are taken into account. Moreover, the SED fitting relies on underlying galaxies models, which already places constraints on the possible values of the spectral features, thus constraining the potential dispersion of D4000 values. Nevertheless, these factors alone cannot account for the extreme SNR boost in CIGALE measurements. It is worth noting that CIGALE only uses the observational errors as weights for the $\chi^2$ computation, without propagating them directly into the error budget; the error of the output values (in this case, the D4000) is the standard deviation of the PDF derived from the SED fit \citep{Noll2009}. In other words, the noise levels of the photometric fluxes will determine how much these fluxes are weighted in the fit relative to each other, but do not have a direct relationship to the error of the parameter estimated with CIGALE. Therefore, if the PDF of the fit is concentrated in a small probability volume (either because the models do not properly reproduce the diversity of the sample, or because the $\chi^2$ computation tends over-weight specific input data), the error of the output values will be low, even if the input data is noisy. This may result in an error underestimation, and thus explain the high SNR values; the possibility of an error underestimation due to a limited model grid or unaccounted photometric errors is largely discussed in \citet{Noll2009}. However, any modifications or improvements to the SED-fitting code are out of the scope of this work.

\begin{figure}
 	 \includegraphics[width=\columnwidth]{snr_hist.pdf}
     \caption{SNR distribution for PAUS direct, PAUS CIGALE, CFHTLS CIGALE, and VIPERS spectroscopy. The black vertical line displays the detection threshold of $\rm SNR > 3$. \textit{Upper panel}: D4000$_{\rm w}$. \textit{Lower panel:} D4000$_{\rm n}$.}
     \label{fig:snr_histogram}
\end{figure}

Given the significant percentage of objects with $\rm SNR<3$ in PAUS direct, we have evaluated up to which magnitude PAUS direct allows an individual D4000 measurement of all galaxies above the established SNR threshold ($\rm SNR>3$). In \cref{fig:snr_vs_magnitude}, the percentage of objects with $\rm SNR > 3$ in apparent magnitude bins is shown. Both D4000$_{\rm w}$ and D4000$_{\rm n}$ have $\rm SNR>3$ for almost all objects up to $i_{\rm AB}<21$ (99.88\% and 98.97\% for D4000$_{\rm w}$ and D4000$_{\rm n}$ respectively), with the percentage of objects with measurable D4000 decreasing above this threshold. Consequently, we define a $\rm SNR>3$ D4000 subsample by applying an additional $i_{\rm AB}<21$ cut to the sample defined in \cref{sec:Sample selection}; this leaves a total of 2,534 galaxies. We will refer to this $i_{\rm AB<21}$ sample as \textit{bright sample} henceforth, while the original sample defined in \cref{sec:Sample selection} will be referred to as \textit{full sample}. The advantage of this bright sample is that it preserves PAUS magnitude completeness (which large spectroscopic surveys do not achieve, due to target selection) while ensuring that the PAUS direct individual measurements have high enough SNR. For the bright sample, the average PAUS direct SNR is 11.42 for D4000$_{\rm w}$ and 8.63 for D4000$_{\rm n}$. At $i_{\rm AB}=23$, the magnitude limit for the PAUS catalogue, only $\sim$30\% of the objects have a detectable D4000$_{\rm w}$, while for D4000$_{\rm n}$ this percentage decreases to just $\sim$12\%. Hence, with the narrow-band configuration of PAUS we can achieve D4000 individual measurements with $\rm SNR > 3$ for a magnitude-completeness threshold two magnitudes brighter than the magnitude limit of the full catalogue. It is reasonable to expect similar performance with comparable narrow-band surveys, such as J-PAS \citep{Benitez2014} or S-PLUS \citep{DeOliveira2019}.

\begin{figure}
 	 \includegraphics[width=\columnwidth]{snr_vs_imag.pdf}
     \caption{Percentage of objects with the D4000 directly measurable with PAUS ($\rm SNR > 3$), in bins of apparent magnitude. Solid line represents D4000$_{\rm w}$, dash-dotted line D4000$_{\rm n}$.}
     \label{fig:snr_vs_magnitude}
\end{figure}


The Gaussianity of the errors associated to these D4000 estimations is evaluated in \cref{fig:error_gaussianity} and \cref{tab:error_fits}. There, we display the distribution of the difference between the D4000 estimations and the true value (i.e., VIPERS measurements), divided by the estimated error. If the errors are properly estimated, these histograms should follow Gaussian distributions of $\mu=0$ and $\sigma=1$. Errors from PAUS direct are realistic, as their histograms in \cref{fig:error_gaussianity} have $\sigma\sim1$ (underestimated by $\sim$10\% for D4000$_{\rm w}$ and overestimated by $\sim$5\% for D4000$_{\rm n}$, see \cref{tab:error_fits}). Both CIGALE methods show clear error underestimations, with $\sigma \sim 1.75$ for CFHTLS CIGALE, and $\sigma \sim 1.5$ for PAUS CIGALE, which is akin to a error underestimation of 75\% and 50\% respectively. Hence, the SNR values derived from the CIGALE measurements in \cref{fig:snr_histogram} should be divided at least by a factor equal to their $\sigma$ in \cref{tab:error_fits} to be considered realistic.

Most of the D4000 estimations show negative $\mu$ (see \cref{fig:error_gaussianity} and \cref{tab:error_fits}), which hint to a negative bias in the D4000 measurements. We will explore the bias of the different D4000 measurement methods in more detail later in \cref{fig:scatter_bias}, as these offsets do $\mu$ not necessarily imply a wrong estimation of the error. For now, we can say that these negative $\mu$ values are mostly consistent both with the bias estimation of \cref{sec:Synthetic PAUS tests} and the results shown later in \cref{fig:scatter_bias}. It is worth noting also that the $\mu$ offsets are not direct measurements of the bias, as they may also depend on other of aspects of the error distribution and the Gaussian fit (e.g., the noticeable skewness in the distribution of PAUS direct errors).

\begin{figure}
 	 \includegraphics[width=\columnwidth]{error_gaussianity.pdf}
     \caption{Distribution of the difference between D4000 measurements and VIPERS D4000 values, divided by the estimated error. All distributions are accompanied of their respective Gaussian fit; the solid black line shows a reference Gaussian with $\mu=0$ and $\sigma=1$. \textit{Upper panel}: D4000$_{\rm w}$. \textit{Lower panel:} D4000$_{\rm n}$.}
     \label{fig:error_gaussianity}
\end{figure}

\begin{table}
\centering
	\caption{Parameters of the Gaussian fits to all error distributions displayed in \cref{fig:error_gaussianity}.}
 	\label{tab:error_fits}
 	\begin{tabular}{rrcc}
 		\hline
 		 & & $\mu$ & $\sigma$\\
 		\hline
 		\multirow{2}{*}{PAUS direct} & D4000$_{\rm w}$ & $-0.10\pm0.03$ & $1.10\pm0.02$ \\
 	    & D4000$_{\rm n}$ & $0.06\pm0.02$ & $0.96\pm0.02$\\
 	    \hline   		
 	    \multirow{2}{*}{PAUS CIGALE} & D4000$_{\rm w}$ & $0.38\pm0.02$ & $1.51\pm0.02$ \\
 	    & D4000$_{\rm n}$ & $0.27\pm0.02$ & $1.53\pm0.02$\\
		\hline
  		\multirow{2}{*}{CFHTLS CIGALE} & D4000$_{\rm w}$ & $-0.44\pm0.02$ & $1.72\pm0.02$ \\
 	    & D4000$_{\rm n}$ & $-0.57\pm0.02$ & $1.77\pm0.02$\\
 	    \hline
    \end{tabular}
\end{table}

\subsection{Distribution and bias}\label{sec:Distribution and bias}

Once we have examined the SNR and error of the D4000 estimation methods, we study the distribution of the D4000 values themselves. \Cref{fig:D4000_hist} shows a histogram of D4000 values for each method, and for both the bright and full samples. In addition to this, we have also generated test datasets for PAUS direct, PAUS CIGALE and CFHTLS CIGALE D4000 by taking the VIPERS D4000 values for each object, and adding to them a value drawn from a Gaussian distribution of mean zero and $\sigma$ equal to the error of its respective non-spectroscopic measurement. If the D4000 measurements from these non-spectroscopic methods are unbiased and with an error estimation that behaves like a Gaussian, the D4000 distribution from the test dataset generated by adding these artificial errors to VIPERS D4000 should be the same as the D4000 distribution from its respective non-spectroscopic method. We know from \cref{fig:error_gaussianity} that the error in PAUS direct is reasonably close to Gaussian, and that for the CIGALE methods it is clearly underestimated; these test datasets allow us to check if the differences between the VIPERS D4000 distribution and the non-spectroscopic D4000 distributions can be accounted for solely by the non-spectroscopic error. The test datasets are represented by dashed black lines.

\begin{figure*}
 	 \includegraphics[width=\textwidth]{D4000_hist_both.pdf}
     \caption{Histogram of the D4000$_{\rm w}$ (even rows) and the D4000$_{\rm n}$ (odd rows) for the PAUS direct measurement (left column), PAUS CIGALE (middle column), and CFHTLS CIGALE (right column). The two upper rows correspond to the bright sample, while the two lower rows display the full sample. All panels include the distribution of the VIPERS D4000 (purple dashed line), as well as the distribution of the test dataset generated by adding a Gaussian value of mean zero and $\sigma$ equal to its respective non-spectroscopic error to the VIPERS D4000 values (black dashed line).}
     \label{fig:D4000_hist}
\end{figure*}

The spectroscopic D4000 distributions in \cref{fig:D4000_hist} exhibit a weak bimodality, with a peak centred on the blue cloud around 1.3 and 1.2 for D4000$_{\rm w}$ and D4000$_{\rm n}$, respectively. This blue peak is far stronger for the full sample: as blue galaxies are fainter on average, by imposing the $i_{\rm AB}<21$ cut most of the removed galaxies belong to the blue cloud (the correlation between D4000 and stellar mass will be explored in \cref{sec:D4000 versus stellar mass and SFR}). On the other hand, the red sequence appears as a plateau in the much longer tail of the high D4000 end; a result consistent with the D4000 thresholds used in the literature to separate blue/red galaxies. For example, in \citet{Kauffmann2003b} and \citet{Haines2017} a D4000$_{\rm n}=1.55$ cut is adopted for VIPERS data in $0.5<z<1.0$, and in \citet{Johnston2015} a threshold of D4000$_{\rm n}=1.3$ is used for galaxies at $z\sim3$. Moreover, this bimodality, not only in D4000 distribution \citep[][]{Kauffmann2003a} but also in most of the galaxy parameters, has been extensively demonstrated in the literature \citep[e.g.,][]{Mignoli2008, Davidzon2013, Siudek2017}, and in the case of the D4000 index, it has been shown to become less pronounced as redshift increases \citep[e.g.,][fig. 1]{Haines2017}. Therefore, the weak bimodality in our sample at $z>0.5$ is to be expected.
 
In order to quantify the agreement between the D4000 distribution of the different methods and the VIPERS D4000, we have performed the Epps-Singleton (ES) test \citep{Epps1986} on all cases displayed in \cref{fig:D4000_hist}, comparing the D4000 distributions against the noiseless VIPERS (the original D4000 measurements) and the VIPERS test datasets generated with the non-spectroscopic noise (black lines in \cref{fig:D4000_hist}). The ES test has been chosen instead of other popular alternatives such as the Kolmogorov-Smirnov \citep{Massey1951}, Cramer-von Mises \citep{Anderson1962} or Anderson-Darling \citep{Anderson1952} tests because it was the least dependant on the D4000 range where the empirical distribution function (EDF) was determined. This result is expected, given that the ES test has been specifically developed to provide enough power under a great variability of EDF parameters, such as location, scale or even family of distributions \citep[see][]{Epps1986}, and in our case the tails of the D4000 distribution greatly vary between D4000 methods. For PAUS direct, the tails are significantly larger than VIPERS due the lower SNR, and for both CIGALE estimations the tails end abruptly given the limitations of the SED models (see \cref{fig:D4000_hist}).

The D4000 EDF has been computed in all cases with a uniform binning between $\rm D4000=0.7$ and $\rm D4000=2.5$, with a bin width $\rm \Delta D4000 = 0.02$; this is the same binning of the histograms displayed in \cref{fig:D4000_hist}. The \textit{p}-values of the ES tests are shown in \cref{tab:ES_test_results}; these are the probabilities of the estimated D4000 values coming from the same distribution as the noiseless VIPERS D4000 (or VIPERS D4000 with non-spectroscopic noise, in parentheses).

\begin{table}
\centering
	\caption{\textit{p}-values of the ES test performed for all the D4000 distributions displayed in \cref{fig:D4000_hist}. For each case, the \textit{p}-values from the comparison of the respective D4000 distribution to VIPERS D4000 are shown first. The \textit{p}-values of the comparison to VIPERS D4000 with the respective non-spectroscopic Gaussian noise (black lines in \cref{fig:D4000_hist}) are displayed in parentheses.}
 	\label{tab:ES_test_results}
 	\begin{tabular}{rccc}
 		\hline
 		
   		 & PAUS direct  & PAUS CIGALE & CFHTLS CIGALE\\
 		\hline
 		\multicolumn{4}{l}{Bright sample ($i_{\rm AB}<21$)}\\
 		\hline
        D4000$_{\rm w}$ & 0.50 (0.93) & 0.81 (0.60) & 0.25 (0.09)\\
        D4000$_{\rm n}$ & 0.19 (0.88) & 0.71 (0.35) & 0.10 (0.03)\\
        \hline
 		\multicolumn{4}{l}{Full sample ($i_{\rm AB}<23$)}\\
 		\hline
        D4000$_{\rm w}$ & 0.02 (0.98) & 0.84 (0.58) & 0.55 (0.38)\\
        D4000$_{\rm n}$ & 0.00 (0.99) & 0.52 (0.20) & 0.17 (0.09)\\ 		
        \hline
 	\end{tabular}
\end{table}
 
The distribution of the PAUS direct D4000 (left column in \cref{fig:D4000_hist}) shows the weakest bimodality of all the non-spectroscopic methods, with a much smaller peak in the blue cloud, and a less pronounced difference between the high and low D4000 tails. This effect is caused by the noise in the D4000 measurements, and is far more noticeable for the full sample due to the much lower average SNR. In fact, the \textit{p}-values for the bright sample when compared to VIPERS are far from negligible (up to 0.5 in D4000$_{\rm w}$) while for the full sample they tend to zero. However, for PAUS direct the black line representing the VIPERS D4000 with PAUS direct Gaussian errors shows an excellent agreement (\textit{p}-$\rm value \sim0.9$ and \textit{p}-$\rm value \sim1$ for the bright and full samples respectively), with the only noticeable difference being a shift of the distribution peak of $\sim$0.1 towards lower values. This is consistent to a certain extent with the negative bias of the PAUS direct estimator shown in \cref{sec:Synthetic PAUS tests}. Nevertheless, this similarity between distributions is a clear indicator that the error in PAUS direct is close to Gaussian.

On the other hand, the bimodality displayed by the CIGALE D4000 distributions (centre and right columns in \cref{fig:D4000_hist}) is actually stronger than VIPERS D4000, which may be caused by the model-based methodology limitations. This is especially pronounced in the CFHTLS CIGALE case and for the D4000$_{\rm n}$, with a very sharp maximum at $\sim$1.2, and several smaller peaks at $\rm D4000 > 1.4$. Regarding PAUS CIGALE, this artificial bimodality is much less significant, to the point of having the closest D4000 distribution to noiseless VIPERS in all cases (higher \textit{p}-values, see \cref{tab:ES_test_results}), despite having slightly sharper blue and red peaks. The better behaviour of D4000$_{\rm w}$ with CIGALE may be due to the smaller difference in D4000 values between SED templates due to the larger continuum range, or the larger dependency on dust extinction smoothing this difference. When compared to PAUS direct, the ES test results in only PAUS CIGALE outclassing PAUS direct in the bright sample (\textit{p}-$\rm value \sim 0.75$ vs \textit{p}-$\rm value \sim 0.3$, see \cref{tab:ES_test_results}), but also CFHTLS CIGALE clearly outperforming PAUS direct in the full sample (with a \textit{p}-value up to 0.55 for D4000$_{\rm w}$), due to the low SNR heavily distorting PAUS direct D4000 distribution. However, we note that the \textit{p}-values change significantly when considering non-spectroscopic errors. In this case (black lines in \cref{fig:D4000_hist}), the match between CIGALE D4000 distributions worsens significantly (\textit{p}-$value \sim 0.4$, see \cref{tab:ES_test_results}). If the error in the CIGALE measurements behaved like a Gaussian, it should result in a smoothing of the D4000 distribution, decreasing the observed bimodality (even if the CIGALE error is underestimated, as shown in \cref{tab:error_fits}). Since the bimodality is artificially enhanced by CIGALE, adding the Gaussian errors to VIPERS results in a larger disagreement between distributions. Consequently, when the respective non-spectroscopic errors are added to the VIPERS D4000 distribution, PAUS direct shows the best agreement (\textit{p}-$\rm value \sim 0.95$). Despite the PAUS direct D4000 providing a realistic error estimate consistent with a Gaussian behaviour, and the CIGALE D4000 overestimating its SNR, it is worth noting that CIGALE still provides less dispersion, and will always yield a reasonable D4000 value, regardless of how faint the observed object is. We display the bias of these D4000 estimation methods for the bright sample in \cref{fig:scatter_bias}. This figure is an observational counterpart of \cref{fig:bias_scatter_synth}: each panel displays a scatter plot with the VIPERS D4000 value in the x-axis, and the bias of the respective D4000 estimation method in the y-axis, determined also with \cref{eq:bias_definition}; but this time with the D4000 computed from actual PAUS observations.

\begin{figure*}
 	 \includegraphics[width=\textwidth]{D4000_scatter_bias.pdf}
     \caption{Bias in the D4000 measurements for all objects in the bright sample ($i_{\rm AB}<21$), versus their respective VIPERS D4000 values. Results for PAUS direct in the left column, PAUS CIGALE in the centre column, and CFHTLS CIGALE in the right column. Results for D4000$_{\rm w}$ in the upper row, and D4000$_{\rm n}$ in the lower row. In each panel, the x-axis values are the VIPERS counterpart of the respective D4000 definition. In all panels, the dotted black line represents the median bias of the sample. Legends show the value of this median bias, as well as the parameters of the linear fit.}
     \label{fig:scatter_bias}
\end{figure*}

It is remarkable that all three estimators display similar average trends: a mean negative bias of the order of few percent (except for the PAUS CIGALE D4000$_{\rm w}$), with the linear fit showing a mild negative correlation between the D4000 value and bias. The reason for this negative correlation between D4000 value and bias comes from the low spectral resolution of the photometric data used. Since PAUS NBs have a FWHM of the same order of magnitude as the D4000 bands, the red D4000 band may contain some flux information from the slope of the spectral break itself, which would bias its measured flux towards higher values. The opposite may happen with the blue D4000 band, where including flux from the slope of the spectral break will decrease the measured flux (\cref{fig:D4000_measurement_example} may help better visualising this effect). The result of these two effects is an underestimation of the D4000 that becomes more pronounced as the D4000 value increases (see \cref{eq:D4000_definition}), a trend consistent with the linear fit to the bias displayed in \cref{fig:scatter_bias}. While showing the smaller absolute median bias, PAUS CIGALE has one of the most pronounced slopes for this linear tendency, with CFHTLS CIGALE and specially PAUS direct D4000$_{\rm w}$ showing weaker dependencies between bias and true D4000.

The overall scatter of the bias is much larger than the one presented in \cref{fig:bias_scatter_synth}, mostly due to the observational errors. The PAUS direct D4000 values show the largest scatter by far, e.g., for the D4000$_{\rm w}$, 15.82\% of objects have an absolute bias above 20\%, while for PAUS CIGALE this percentage drops to 2.33\% (and 4.06\% for CFHTLS CIGALE). These percentages of objects with >20\% bias increase by a factor of ~1.5 for D4000$_{\rm n}$. It is worth noting that for PAUS direct these biases are consistent with the error of the D4000 measurement. Regarding the CIGALE D4000 panels, albeit the scatter is much smaller, there is a stronger clustering of data points in a stripe pattern (especially for CFHTLS only), due to the tendency of the SED-fitting methodology to infer specific D4000 values. One possible explanation for these stripes is the finite number of SED templates in the SED-fitting code, with D4000 measurements tending to cluster around the most representative SEDs for red and blue galaxies (explaining also the stronger bimodality).


\section{D4000 and galaxy properties}\label{sec:D4000 and galaxy properties}

Here, we examine how the D4000 measurements vary across different observational parameters. For all the results displayed in this section, we have applied additional cuts to our galaxy sample: all objects with $\rm SNR<3$ in the VIPERS D4000 (either D4000$_{\rm w}$ or D4000$_{\rm n}$) have been removed, as well as spectroscopic outliers. We have considered outliers all objects outside of the range $0.7<\rm VIPERS\, D4000<2.5$, again, for both D4000 definitions. These cuts removed an extra 46 objects from the sample defined in \cref{sec:Sample selection}, resulting in 17,195 galaxies. The same cuts have been applied to the GSWLC-2 low-redshift sample (\cref{sec:GSWLC-2}), resulting in a total of 172,300 galaxies.

\subsection{D4000 versus redshift}\label{sec:D4000 versus redshift}

The first parameter we have considered is redshift: \cref{fig:D4000_vs_z} displays scatter plots of the different D4000 measurements versus redshift, for the full sample. PAUS data (PAUS direct and PAUS CIGALE) have PAUS photo-z in the x-axis; CFHTLS CIGALE uses the CFHTLS photo-z from broad-band data only, and for VIPERS D4000 its respective spec-z is used. In the panels using PAUS photo-z a sharp stripe of data points appears around $z\sim0.7$, but is absent from VIPERS spec-z. This is due to the large horizontal stripes in \cref{fig:z_comparison} around that same redshift. While this is an artefact of the current photo-z computations, it does not affect the average D4000 properties, as it is seen throughout this section. Moreover, such artefacts should be mitigated in future data releases.


\begin{figure*}
 	 \includegraphics[width=\textwidth]{D4000_vs_z_scatter_final.png}
     \caption{D4000$_{\rm w}$ (upper row) and D4000$_{\rm n}$ (lower row) versus redshift for PAUS direct measurement (first column), PAUS CIGALE (second column), CFHTLS CIGALE (third column) and VIPERS D4000 (fourth column). PAUS photo-z used in first and second columns, CFHTLS photo-z in the third column, and VIPERS spec-z in the fourth. The linear fit to each dataset is displayed as a grey or yellow line, depending on the weighting used for the fit (SNR$^{-2}$ or no weighting, respectively). The numerical values of the fit are shown in the legend of each plot. The dot with errorbars in the lower-right corner of each plot represents the median error in the respective D4000 measurement.}
     \label{fig:D4000_vs_z}
\end{figure*}



We have performed linear fits to all datasets to evaluate the average evolution of the D4000 versus redshift; all fits are unweighted except PAUS direct, where a SNR$^{-2}$ weighting has been applied. The reason for this weighting is that the high noise of the PAUS direct D4000 resulted in a linear fit with large error regions, which provided close to no meaningful information about the D4000 evolution. A SNR$^{-2}$ weighting has been chosen instead of $\sigma^{-2}$ to mitigate the dependence of the error with the D4000 value: when weighting objects with different D4000, the SNR is a more accurate estimator of the amount of information per measurement. We have tested this weighting by repeating the SNR$^{-2}$-weighted linear fit on the VIPERS D4000, but using PAUS direct SNR: the resulting linear fit was compatible with its unweighted counterpart (the error regions of the fits fully overlapped). Hence, we can affirm that the SNR$^{-2}$ weighting does not significantly distort the true D4000 evolution vs redshift. It is worth noting that such weighting can not be performed with CIGALE errors, as there is a far more significant dependence of errors vs D4000 (almost an order of magnitude, with errors increasing with D4000 value, reaching a maximum around $\rm D4000\sim1.8$). This error-D4000 correlation in CIGALE D4000 distorts the trend found in the unweighted linear fit.

For all cases, we find a decreasing trend of the D4000 with redshift: for CFHTLS CIGALE (both D4000 definitions) and PAUS direct (D4000$_{\rm w}$ only), these trends are in agreement within 1$\sigma$ with spectroscopy. PAUS direct D4000$_{\rm n}$ is also close to $\sim$1$\sigma$ to the results found in VIPERS, while for PAUS CIGALE the slope of the linear fit is approximately twice as steep as its spectroscopic counterpart (despite PAUS CIGALE mimicking much better the true VIPERS D4000 distribution). The reason for this exaggerated trend in PAUS CIGALE might lie in the smaller wavelength range of PAUS NBs compared to CFHTLS broad bands: at a given redshift, the wavelenght window to perform the SED fitting is smaller, even if the spectral resolution is higher. This may result especially problematic in the edges of our redshift range, where the D4000 bands are close to the wavelenght limits. Moreover, undesired biases at these redshift limits would affect more the slope of the linear fit than at intermediate redshift values.

At higher redshift stellar populations are younger, and thus a decrease of the average D4000 is to be expected, given that it is a proxy for stellar ages. This decreasing trend is widely documented in the literature. In fact, with the same data VIPERS used in this work \citep{Scodeggio2018}, a decreasing trend of D4000$_{\rm w}$ versus redshift can be seen in \citet{Siudek2017}, fig. 7, and \citet{Haines2017}, table 1. Far more examples can be find in the literature: e.g., \citet{Moresco2012} displays the decreasing D4000 dependency on physical parameters vs redshift for early-type galaxies from different surveys in $0.15<z<1.35$ (separated in stellar mass bins), while \citet{Joshi2019} and \citet{Borghi2021} find the same trend in a redshift range similar to this work, for passive galaxies only and for a high-quality sample without any specific galaxy property cuts, respectively. This consistent decreasing trend is a consequence of the D4000 increasing with stellar age, and is noticeable in \cref{fig:D4000_vs_z} despite the selection effects at different redshifts of a magnitude-limited sample.

\subsection{D4000 versus stellar mass and SFR}\label{sec:D4000 versus stellar mass and SFR}

Moreover, we also explore the dependency of the D4000 versus two of the most important galaxy physical properties for the full sample: stellar mass and SFR. For the D4000-stellar mass relation, we have also added as a comparison the low-redshift D4000$_{\rm n}$ spectroscopic data from \citep[][see Sect.~\ref{sec:GSWLC-2}]{Turner2021}. For this analysis, we have separated both our PAUS-VIPERS sample and the GSWLC-2 sample into blue and red galaxies by applying D4000$_{\rm n}=1.55$ cut, with galaxies below and above the cut being blue and red respectively \citep{Kauffmann2003b}. The same criterion is employed in \citet{Haines2017} in the same VIPERS data release \citep{Scodeggio2018}. In \cref{fig:D4000_mdn_vs_sm} the median D4000 values in stellar mass bins are displayed, together with linear fits to the full sample for the VIPERS D4000$_{\rm n}$ and the GSWLC-2 spectroscopic D4000$_{\rm n}$. \cref{fig:D4000_mdn_vs_sfr} displays the D4000-SFR relation in an analogous way, only for our PAUS-VIPERS full sample and without linear fits nor a red/blue separation.

The errorbars of \cref{fig:D4000_mdn_vs_sm,,fig:D4000_mdn_vs_sfr} are the median absolute deviation (MAD) of the D4000 for all objects in its respective bin (delimited by grey vertical lines). The MAD has been multiplied by its respective factor ($\sim$1.4826) so it is comparable to the standard deviation, and has not been divided by the square root of the number of objects per bin, so it accounts for the intrinsic variance of D4000 values inside a bin (therefore, it should remain constant for a number of objects large enough). We have used the median and the MAD to evaluate the dependence of the D4000 due to its insensitivity to outliers; this allows us to evaluate the full selected sample without introducing any cuts that might result in any additional selection effects. The current sample described in \cref{sec:Sample selection} is only limited by the magnitude cut of VIPERS and a colour selection that is negligible at $z>0.6$ \citep{Scodeggio2018}. Introducing a SNR cut to remove the noisiest objects in the PAUS direct D4000 measurements removes mostly blue galaxies and heavily skews the sample towards high D4000 values, given the positive correlation between the D4000 and stellar mass (\cref{fig:D4000_mdn_vs_sm}). Only three measurement methods from our full sample \cref{sec:Sample selection} have been considered: PAUS direct, PAUS CIGALE and VIPERS (following the colour convention of previous figures). CFHTLS CIGALE is not displayed for two reasons: its results are very similar to PAUS CIGALE, and for all the other methods the stellar masses and SFRs used for binning come from the PAUS CIGALE run. We have also generated a test dataset by adding artificial errors drawn from a Gaussian distribution to the VIPERS D4000, as described in \cref{sec:SNR}; however, we have only used as $\sigma$ the errors from PAUS direct measurements.

\begin{figure*}
 	 \includegraphics[width=\textwidth]{D4000_avg_vs_sm_final.pdf}
     \caption{Median D4000 in uniform bins of log $\rm M_{*}$, for PAUS direct measurement (orange errorbars), PAUS CIGALE (cyan) and VIPERS (purple). The low-redshift dataset from GWSLC-2 is also displayed in faint yellow in the lower panel, together with linear fits to the VIPERS and GWSLC-2 D4000$_{\rm n}$ (slopes and average spec-z displayed in the respective legend). The errorbars represent the MAD of the D4000 of sample. The black dotted errorbars in VIPERS show the MAD of the sample after adding to each object a Gaussian error with the same $\sigma$ as its respective PAUS direct measurement (as in \cref{fig:D4000_hist}). The errorbars for each measurement method have been offset in the x-axis for clarity, but in all cases the same binning has been used (as indicated by the grey vertical lines). Upper and lower rows are for D4000$_{\rm w}$ and D4000$_{\rm n}$ respectively, while left and right columns are for blue (spectroscopic D4000$_{\rm n}<1.55$) and red (spectroscopic D4000$_{\rm n}>1.55$) galaxies respectively, according to the criterion specified in \citet{Kauffmann2003b}.}
     \label{fig:D4000_mdn_vs_sm}
\end{figure*}

In the D4000-stellar mass relation (\cref{fig:D4000_mdn_vs_sm}), all our measurement methods show a remarkable agreement for the blue cloud, well within the errorbars of VIPERS D4000 for all stellar mass bins (at even less than $\sim$0.5$\sigma$ for most of them). On the other hand, the PAUS direct (and PAUS CIGALE to a lesser extent) D4000 show a far larger disagreement with VIPERS for the red sequence, with a very significant underestimation of the D4000 for the low-stellar mass bins (yet still within the large errorbars of the test dataset). This significant D4000 underestimation is due to the confluence of several factors: the relatively few red galaxies in the low-mass bins, the mean D4000 bias that starts being negative around $\rm D4000\sim1.5$ for all estimation methods (see \cref{fig:scatter_bias}), and above all, the effect of the D4000$_{\rm n}=1.55$ cut on the D4000 distributions. For red galaxies, this cut significantly affects the D4000 distribution on the low-mass bins (as it is close to the median of the distribution); the error in the D4000 estimation for PAUS direct and PAUS CIGALE "blurs" the cut, thus shifting the median towards lower values. This is less pronounced for high-mass bins as the cut is further away from the median D4000. For blue galaxies, this effect would result in an underestimation of the mean D4000 for high-mass bins, however, even in the higher mass bins the D4000$_{\rm n}$ cut is significantly farther away from the median (and the D4000 distribution is closer to Gaussian), which makes the effect of "blurring" the D4000 cut for PAUS direct and PAUS CIGALE negligible. The MAD of the test dataset (VIPERS with PAUS direct $\sigma$) in \cref{fig:D4000_mdn_vs_sm} is also very similar to the MAD of PAUS direct D4000 for the blue cloud, which reinforces that PAUS direct dispersion is fairly coherent with a Gaussian realisation of the error. 

For red galaxies, however, the PAUS direct D4000 in the lowest-mass bins shows a significantly smaller MAD than the VIPERS test dataset, which is a possible indication of some noise correlation or non-Gaussianity in the error of PAUS direct measurements; this may also partially be the cause of the D4000 underestimation discussed above. On the other hand, the CIGALE D4000 shows in the high-mass end of the red sample a smaller MAD than the VIPERS D4000 by a factor of $\sim$3 on average; a clear sign that, despite correctly determining the average spectral features of a given population, the SED templates may not fully reproduce the actual diversity of the sample. This smaller MAD of PAUS CIGALE is also present, albeit to a smaller extent, in the lower-mass bins of the blue cloud, which may be a sign of the SED-fitting templates not properly reproducing the diversity in the most "extreme" regimes: the bluest and smallest star-forming galaxies, and the largest and most quenched red galaxies.
 
Regarding the dependence of the median D4000 value versus stellar mass, the trend found in \cref{fig:D4000_mdn_vs_sm} is fully consistent with previous results in the literature. The main explanation for  is the downsizing scenario \citep{Cowie1996}, widely tested in the literature: more massive galaxies are assembled first, and thus on average will be older, and thus with higher D4000 values. If we compare the PAUS-VIPERS D4000$_{\rm n}$ with the low-redshift sample, we see that low-redshift galaxies have moved to higher D4000 values at a fixed stellar mass when compared to their higher redshift counterparts. The increase in D4000$_{\rm n}$ at log $\rm M_* / M_\odot\sim10.5$ (D4000$_{\rm n}\sim$0.1) for the blue cloud and the red sequence is similar to the results found in \citet{Haines2017} and \citet{Siudek2017} for blue star-forming and for red passive galaxies respectively. This change with redshift may be caused by the ageing of the stellar populations over 7 Gyr and the downsizing, the steady decline in the specific SFRs of the star-forming main sequence as time passes \citep{Noeske2007, Behroozi2013, Lee2015}.

The D4000-mass relations for both the blue cloud and red sequence in \cref{fig:D4000_mdn_vs_sm} are further evaluated with linear fits for the spectroscopic D4000$_{\rm n}$ of VIPERS and GSWLC-2. For blue galaxies, we find a slope of $\sim$0.155 approximately invariant with redshift, close to the invariant slope of 0.12-0.14 reported in  \citet{Haines2017}. These similar values are especially remarkable, given the different methodologies: we perform a liner fit directly to all our data points, while \citet{Haines2017} fit a Gaussian to the D4000 distribution in each stellar mass bin, and fit a line to the mean values of these Gaussians. This consistency between results proves that narrow-band photometry is an accurate proxy to study downsizing and evolution of blue population through D4000. For red galaxies, however, \citet{Haines2017} finds a slope of $\sim$0.23 for VIPERS; we note that most of this discrepancy comes from the different methodology (as they fit Gaussians to the stellar mass bins, and the red population has a significantly less Gaussian D4000$_{\rm n}$ distribution). Other factors that may account for this disagreement are the additional stellar mass cuts in the low-mass regime of the red population in \citet{Haines2017} (replicating them increases our slope by $\sim$0.02), as well as the narrower redshift range of our selected sample.

Hence, we compare our results in the red sample with \citet{Siudek2017}, which was focused on the evolution of the red passive population from $z\sim1$ to the present day, and computes the linear fit with the same methodology as this work. The D4000$_{\rm n}$-mass relation appears linear with a slope $\sim$0.08 and $\sim$0.12, for VIPERS and GSWLC-2 respectively, while \citet{Siudek2017} finds a slope of $\sim$0.16 for VIPERS at $0.4<z<1$, and $\sim$0.14 for a SDSS sample at $0.15<z<0.25$. This flattening of the slope with time is the opposite trend of what we find here, and is not a consequence of sample selection, since the PAUS galaxy population is a representative sample of the VIPERS galaxy population. The reason for this disagreement in red slopes is the different criteria used to determine red galaxies: in this work we use a D4000$_{\rm n}=1.55$ cut, while in \citet{Siudek2017} a redshift-dependent $U-V$ colour cut \citep{Fritz2014} is employed. In fact, the criterion used to select red passive galaxies may alter significantly the properties of the sample \citep[e.g.,][]{Moresco2012, Trager2000}. For this particular case, if we repeat the linear fit in \cref{fig:D4000_mdn_vs_sm} with the machine-learning classification from \citet{Siudek2018} used in \cref{sec:Galaxy classification}, we obtain a slope of $\sim$0.3 for the VIPERS sample of red galaxies, indicating that machine-learning classification methods may be more suitable than a simple D4000 cut. Therefore, in order to study the properties of the red sequence with narrow-band photometry the high sensitivity of the galaxy properties to the selection criterion must be taken into account, as well as the significant underestimation of the D4000 in the low-mass end.

Regarding the D4000-SFR dependency displayed in \cref{fig:D4000_mdn_vs_sfr}, we find an agreement with spectroscopy within 1$\sigma$, and a the MAD of the test dataset (VIPERS D4000 with PAUS direct noise) is again similar to that of PAUS direct. The only significant caveat that arises is the underestimation of the MAD for PAUS CIGALE D4000 when compared to VIPERS D4000, especially for the very low and highest SFR bins. This is consistent with \cref{fig:D4000_mdn_vs_sm}, and again shows that the SED templates do not properly reproduce the true galaxy diversity in the most quenched and star-forming regimes. Overall, this agreement within estimation methods and the D4000-SFR trend in \cref{fig:D4000_mdn_vs_sfr} is to be expected, as the D4000 itself is a sensitive indicator of the presence (or absence) of young stellar population \citep[e.g.,][]{Kauffmann2003a, Brinchmann2004}, and although a degeneracy with metallicity exists, the negative D4000-SFR relationship is widely documented \citep[e.g.,][]{Brinchmann2004, Salim2007}.

\begin{figure}
 	 \includegraphics[width=\columnwidth]{D4000_avg_vs_sfr.pdf}
     \caption{Median uniform bins of log SFR instead of log $\rm M_{*}$, following the colour code of \cref{fig:D4000_mdn_vs_sm}, but without the GWSLC-2 data nor red/blue classification. Upper panel shows a density histogram in logarithmic scale.}
     \label{fig:D4000_mdn_vs_sfr}
\end{figure}

With the dependency of D4000 with galaxies properties shown in this subsection, and its overall agreement with the literature, we see that narrow-bands surveys show potential to break the incompleteness issue of flux-limited and target-based spectroscopy, especially to study the evolution of the number density of massive blue star-forming galaxies \citep{Haines2017}, although they may also be used for analyzing passive red galaxies if the caveats presented here are taken into account. Moreover, the study of environmental dependence on the statistical significance so far not achievable by spectroscopic surveys (Siudek et al. in prep) could also be performed with narrow-band data. The synergy of wide coverage with accurate measurements of spectral features may open a new insight in the nature vs nurture dilemma \citep[e.g.,][]{DeLucia2012, Davidzon2015}.


\subsection{Galaxy classification}\label{sec:Galaxy classification}

The classification of galaxies into different categories has been one of the main topics of galaxy study ever since the very beginnings of observational cosmology, with the first example being the morphological classification into \textit{early-type} (elliptical) and \textit{late-type} (spiral) galaxies \citep{Hubble1926, DeVaucouleurs1959}. More sophisticated morphological classifications have been developed \citep[e.g.,][]{Strateva2001, Driver2006}, as well as classifications based on other observables: spectral features \citep[e.g.,][]{Kauffmann2003a}, colours \citep[e.g.,][]{Arnouts2013, Taylor2015}, or a combination of them \citep[e.g.,][]{Mignoli2008, Krywult2017}, including the D4000. One defining feature of most of these is the bimodality of their parameters, as it is the case for the D4000 distribution in this work (\cref{fig:D4000_hist}).

It is natural for the simplest classification models to separate galaxies into two different types that mimic the aforementioned bimodality in galaxy parameters. In this subsection, we will evaluate how well a D4000-based classification with the accuracy of the different methods can separate the blue and red galaxy populations, as defined by a fiducial classification. Given that the D4000 has already been used as a classification parameter in the literature \citep[e.g.,][]{Kauffmann2003a, Mignoli2008, Kim2018}, this analysis will assess how well the D4000 determined with PAUS data, either by direct measurement or SED fitting, fares against spectroscopy when classifying galaxies.

The fiducial classification used in this work is presented in \citet{Siudek2018}; it has been carried out over the entire VIPERS data release \citep{Scodeggio2018} with a Fisher Expectation-Maximisation unsupervised algorithm, using as entry parameters 12 different rest-frame magnitudes and spectroscopic redshift. The algorithm distinguishes between 11 different galaxy classes among the data, with an extra class for broad-line AGNs that has been omitted for this work. These classes are defined in order: 1 corresponds to the earliest-type galaxy (reddest), and 11 to the latest type (bluest). For the binary red/blue classification used in this work, we have considered all objects of class 6 and below to be red, and 7 and above to be blue.

This separation between red/blue galaxies is directly tied to their SFRs, with red galaxies being mostly quenched, and blue galaxies having active star-forming regions. Another methodology that allows to evaluate the SFRs of a given galaxy sample is the use of colour diagrams; hence the position in a colour diagram will be related to the galaxy type. In our case, we employ the $NUV-r$ vs $r-K$ diagram \citep[$NUVrK$][]{Arnouts2013}. The $NUV-r$ colour traces specific SFR, given that the flux in the $NUV$ band increases in star-forming regions, and the $r$ band is correlated to old stellar populations \citep{Salim2004}. This colour, however, depends significantly on dust attenuation, so another colour, $r-K$, is used to break this degeneracy \citep{Williams2008}. The result is a diagram where the passive red galaxies tend to cluster on the upper part, and an approximately diagonal cut separates these quiescent galaxies from the star-forming ones on the lower regions of the diagram \citep[e.g.,][]{Arnouts2013, Moutard2018}. In \cref{fig:scatter_classes}, we show the $NUVrK$ colour diagram for the bright sample ($i_{\rm AB}<21$), with the data points colour-coded with their PAUS direct D4000$_{\rm w}$ values, and the $NUV-r$ and $r-K$ colours being extracted from the PAUS CIGALE run. The average positions in the diagram of red and blue galaxies, according to our fiducial classification, is also displayed. The placement of the objects is coherent with the aforementioned references, as well as with the average positions of galaxy classes in the $NUVrK$ colour diagrams in fig. 1 of \citet{Siudek2018}.

\begin{figure}
 	 \includegraphics[width=\columnwidth]{scatter_red-blue.pdf}
     \caption{$NUVrK$ colour diagram for the bright sample, colour-coded with the PAUS direct D4000$_{\rm w}$ (with colour scale limited by the outlier cuts defined for VIPERS D4000). The average positions of the red/blue galaxies from our fiducial classification are also displayed, with their errorbars being their standard deviations.}
     \label{fig:scatter_classes}
\end{figure}

This fiducial galaxy classification is used to test the performance of a single D4000 cut (hereafter D4000$_{\rm cut}$) in order to distinguish between red and blue galaxies, with a galaxy being blue if $\rm D4000 < D4000_{\rm cut}$, and red otherwise. For each one of the four D4000 measurement methods considered (PAUS direct, PAUS CIGALE, CFHTLS CIGALE and VIPERS spectroscopy), we have tested D4000$_{\rm cut}$ values in a physically meaningful range that comprises all but the reddest/bluest galaxies ($1.1<{\rm D4000}_{\rm cut}<1.9$), in order to remove the tails of the distribution, and determined the percentage of galaxies correctly classified as red/blue with each given cut. The results are displayed in \cref{fig:D4000_threshold}. In addition to this figure, \cref{tab:D4000_cut_results} compiles the D4000$_{\rm cut}$ value that maximises the percentage of correctly classified objects for each case, together with its respective percentage of correctly classified objects (in parentheses). In order to check the consistency of these results with the literature, we also evaluate the percentage of correctly classified galaxies using the same cut used in \cref{sec:D4000 versus stellar mass and SFR} of D4000$_{\rm cut}=1.55$ from  \citet{Kauffmann2003b}. This is a value significantly higher than the D4000$_{\rm cut\, n}=1.4$ we find for VIPERS data in the full sample, but still lower than its counterpart for the wide definition, D4000$_{\rm cut\, w}=1.57$. This discrepancy may simply arise from the different classification criteria adopted, but it is remarkable that the difference in D4000$_{\rm cut}$ between classifications is still smaller than the difference we have found in this work between D4000 definitions (i.e., D4000$_{\rm cut\, w}$ and D4000$_{\rm cut\, n}$).


\begin{figure}
 	 \includegraphics[width=\columnwidth]{D4000_threshold.pdf}
     \caption{Percentage of correctly classified objects in the red/blue galaxy sample determined with a given D4000$_{\rm cut}$, using as a fiducial galaxy classification the results of \citet{Siudek2018}. Vertical lines represent the D4000 threshold for maximum percentage for each D4000 measurement method (orange for PAUS direct, cyan for PAUS CIGALE, green for CFHTLS CIGALE, and purple for VIPERS). The standard D4000$_{\rm cut}=1.55$ is also shown as a vertical grey line. Left column shows results for D4000$_{\rm w}$, right column for D4000$_{\rm n}$. Upper row displays the results only for the bright sample ($i_{\rm AB}<21$), while lower row for the full sample.}
     \label{fig:D4000_threshold}
\end{figure}

\begin{table*}
\centering
	\caption{D4000$_{\rm cut}$ that ensures the maximum percentage of correctly classified red/blue galaxies, for all cases represented in \cref{fig:D4000_threshold}. The percentage of correctly classified galaxies with this optimal D4000$_{\rm cut}$ is displayed in parentheses, while the same percentage for the standard D4000$_{\rm cut}=1.55$ is shown in brackets.}
 	\label{tab:D4000_cut_results}
 	\begin{tabular}{rcccc}
 		\hline
 		 & PAUS direct  & PAUS CIGALE & CFHTLS CIGALE & VIPERS\\
 		\hline
 		\multicolumn{5}{l}{Bright sample ($i_{\rm AB}<21$)}\\
 		\hline
 		D4000$_{\rm cut\, w}$ & 1.54 (81.45\%) [80.96\%] & 1.57 (89.86\%) [89.21\%]& 1.45 (92.90\%) [90.68\%] & 1.57 (85.36\%) [84.83\%]\\
 		D4000$_{\rm cut\, n}$ & 1.39 (76.36\%) [70.05\%] & 1.38 (88.99\%) [79.61\%] & 1.24 (92.27\%) [80.09\%] & 1.42 (84.10\%) [78.90\%]\\
  		\hline
 		\multicolumn{5}{l}{Full sample ($i_{\rm AB}<23$)}\\
 		\hline
  		D4000$_{\rm cut\, w}$ & 1.65 (75.67\%) [74.26\%] & 1.58 (90.61\%) [90.13\%] & 1.44 (93.43\%) [91.57\%] & 1.57 (87.20\%) [86.98\%]\\
 		D4000$_{\rm cut\, n}$ & 1.53 (69.13\%) [69.03\%] & 1.38 (89.98\%) [84.75\%] & 1.24 (92.74\%) [82.90\%] & 1.40 (85.13\%) [81.33\%]\\
		\hline
 	\end{tabular}
\end{table*}

In all cases, the PAUS direct D4000 measurement achieves the lowest percentage of correct classification due to its scatter, with at most only 81\% of objects correctly classified (for the bright sample using the D4000$_{\rm w}$). This is also the instance where its effectiveness at classifying becomes closest to VIPERS D4000 (85\%). Using the full sample significantly degrades the percentage of correct classification of the PAUS direct cut, given that there is a significant fraction of objects with $\rm SNR < 3$. This also translates in a flattening of the curve in \cref{fig:D4000_threshold}; in fact, for the D4000$_{\rm n}$ this curve is almost horizontal after the optimal D4000$_{\rm cut}$ value, which shows that varying D4000$_{\rm cut}$ barely has any effect on the reliability of the classification, and thus the correlation between galaxy type and D4000 value is weak.

Regarding the classification results with the CIGALE D4000, both the PAUS and the CFHTLS runs outperform the spectroscopic measurement for VIPERS in their respective optimal D4000$_{\rm cut}$ (at least 90\% and 93\% maximum percentage of correct classification, respectively). This is reasonable, given that the model-driven bimodality/clustering that appears in the CIGALE D4000 values of SED templates (\cref{fig:D4000_hist}). Despite this similar percentage, there is a considerable difference between both CIGALE runs: with CFHTLS only, the optimal D4000 threshold is always the furthest away from the VIPERS optimal cut (and also has the lowest absolute value), while for PAUS, the CIGALE D4000 threshold is always the closest to its spectroscopic counterpart (except for a very slight advantage of PAUS direct for D4000$_{\rm n}$, $i_{\rm AB}<21$). Therefore, using PAUS NBs instead of broad-bands results in much more realistic D4000 estimation for the objects in the intermediate D4000 range, since these are the ones that will determine the optimal red/blue cut.

It is worth noting that, for the case of D4000$_{\rm cut}=1.55$, the difference in the percentage of correctly classified galaxies between the VIPERS D4000 and the CIGALE D4000 measurements is significantly smaller for D4000$_{\rm n}$, which is the D4000 definition used in \citet{Kauffmann2003b} for this specific cut. In the case of the bright sample, the difference in performance between VIPERS and the best CIGALE result (PAUS CIGALE) is just less than 2\% (see \cref{tab:D4000_cut_results}). This result is reasonable: if we use a D4000 cut already defined in the literature for spectroscopic D4000 measurements, the SED-fitting approach of CIGALE does not outperform the VIPERS D4000 nearly as much.

In order to check if these results were consistent with a different criterion for red/blue galaxy classification, we have recomputed the optimal D4000 threshold and its percentage of correctly classified objects, as in \cref{fig:D4000_threshold}, but using as a fiducial classification the spectroscopic VIPERS D4000$_{\rm cut}$ shown in \cref{tab:D4000_cut_results} for the bright sample. The results are largely the same (similar maximum percentage and optimal D4000 thresholds), and thus we can state that the performance of the D4000 estimations for galaxy classification is not largely dependent on the fiducial classification itself.


\section{Conclusions}\label{sec:Conclusions}

In this work, we have carried out the first in-depth study of the direct measurement of the D4000 with narrow-band photometry, using the observational data of PAUS cross-matched with VIPERS \citep{Scodeggio2018} in the CFHTLS W1 field. The results of the D4000 measurement have been compared to its spectroscopic counterpart, as well as the results of the SED-fitting code CIGALE run over the same cross-match, both with broad-band data from CFHTLS and PAUS narrow-band photometry. Both the original definition of the spectral break from \citet{Bruzual1983}: D4000$_{\rm w}$, and the narrower definition from \citet{Balogh1999}: D4000$_{\rm n}$, have been taken into account.

First, we have developed a general estimator for narrow-band photometry, and we have tested it by measuring the D4000 in a synthetic catalogue of PAUS NBs created by integrating the observed VIPERS spectra over the narrow-band response functions. In this noiseless case, we find that over 95\% (92\%) of objects have an absolute bias below 5\% when comparing the D4000$_{\rm w}$ (D4000$_{\rm n}$). We also find similar trends between bias and D4000 value to the preliminary work of \citet{Stothert2018}, but with a significant improvement (e.g., the average bias from the D4000$_{\rm w}$ is reduced by a factor of $\sim$2). When applying this estimator to the real PAUS narrow-band observations, only 85.01\% (D4000$_{\rm w}$) and 65.87\% (D4000$_{\rm n}$) have $\rm SNR > 3$. Moreover, for both D4000 definitions a magnitude cut at $i_{\rm AB}<21$ results in a bright sample where virtually all of the objects have a D4000 measurement with $\rm SNR > 3$. Hence, the PAUS catalogue achieves "D4000-completeness" two magnitudes below the actual magnitude limit. The D4000 results with CIGALE present much higher SNR than the direct PAUS measurements, however, we show that the error that the SED-fitting code returns is underestimated by 50\% for PAUS CIGALE, and 75\% for CFHTLS CIGALE. The bias of these D4000 estimation methods has been evaluated in the bright sample: all of them show a similar trend of a median negative bias of few \%, with PAUS CIGALE having the smallest absolute values. In all cases there is a negative correlation between bias and true D4000 value. For all cases, this linear trend is kept within a range of <10\% for a reasonable D4000 range ($1 < \rm D4000 < 2$).

The D4000 distributions of the different methods have been compared to the VIPERS D4000 using the Epps-Singleton test \citep{Epps1986}, both for the bright sample and the full sample. For all cases, we find better agreement in the D4000$_{\rm w}$ distributions than the D4000$_{\rm n}$. In principle, PAUS CIGALE shows the best agreement (\textit{p}-$\rm value > 0.8$ and \textit{p}-$\rm value > 0.5$ for D4000$_{\rm w}$ and D4000$_{\rm n}$, respectively), while CFHTLS CIGALE has much poorer agreement due to the artificial bimodality. PAUS direct has \textit{p}-$\rm value \sim 0$ for the full sample due to the low SNR, but for the bright sample the D4000 distribution is much closer to VIPERS, especially for D4000$_{\rm w}$ (\textit{p}-$\rm value = 0.5$). However, when we account for the effect of the non-spectroscopic noise in the distributions by adding it to the VIPERS D4000 as Gaussian values, PAUS direct has the best match by far (\textit{p}-$\rm value \sim 0.9$ and \textit{p}-$\rm value \sim 1$ for the bright and full samples, respectively).

The dependency of the D4000 versus redshift, stellar mass and SFR has also been evaluated. For the former, we have computed linear fits to the full sample, and find that the average D4000 decreases as redshift increases \citep[as largely demonstrated in the literature, e.g.,][]{Moresco2012, Joshi2019, Borghi2021}. Despite the low SNR, the linear fit to PAUS direct is fully compatible with the trend found in VIPERS D4000. This is also the case for CFHTLS CIGALE, while PAUS CIGALE overestimates the slope by a factor of $\sim$2. For the D4000-stellar mass relation, we have taken the results of the PAUS CIGALE run to classify all objects in uniform bins, and determined the median and MAD of the D4000 for all the measurement methods. This has been done separately for blue and red galaxies, classified by a cut in D4000$_{\rm n}=1.55$ \citep[][]{Kauffmann2003b}, also with a low-redshift sample with $\langle z \rangle = 0.058$ \citep[GSWLC-2][]{Turner2021}. We find that the D4000 evolution with time at a given stellar mass bin is of the same order of previous results in the literature \citep[][]{Haines2017, Siudek2017}. The agreement between VIPERS and PAUS direct D4000 is excellent for blue star-forming galaxies, while for red passive galaxies the D4000 is consistently underestimated at the low-star mass end. The PAUS CIGALE D4000, although it shows a similar level of agreement with VIPERS, underestimates the sample diversity for low-mass blue galaxies and high-mass red galaxies. Regarding the D4000-SFR dependence, we find an excellent agreement between all measurement methods.

Finally, we have examined the potential of these D4000 measurements for galaxy classification by evaluating how well a given D4000$_{\rm cut}$ value can separate blue/red galaxies, taking as a fiducial classification the results of \citet{Siudek2018}, and determining the D4000$_{\rm cut}$ values which maximise the percentage of correctly classified objects. The D4000 determined by CIGALE outperform even VIPERS spectroscopy in this regard (>90\% of correctly classified objects vs >85\%), while the PAUS direct measurements perform poorly due to the larger scatter (81\% maximum percentage of correct classification for the D4000$_{\rm w}$ and the bright sample). Using PAUS data in the CIGALE run does not improve the classification percentage, but results in a more realistic D4000 red/blue threshold value, much closer to the VIPERS D4000$_{\rm cut}$.

In conclusion, this work shows that narrow-band photometry with PAUS-like spectral resolution ($R\sim65$) can be used to directly measure the D4000 in a model-independent way, and almost all objects two magnitudes below the magnitude limit of the narrow-band catalogue can be reliably measured. For fainter magnitudes, an increasing fraction of objects have too low SNR, but stacking low SNR measurements yields results consistent with spectroscopy. When compared against the results of the SED-fitting code CIGALE, the direct D4000 measurement shows much lower SNR, but a distribution and sample variance consistent with spectroscopic measurements plus a Gaussian error, while the SED-fitting results underestimate the error. Besides, if CFHTLS broad-band photometry instead of PAUS NBs are used for SED-fitting, clear artefacts on the distribution appear, stemming from the SED templates.

This direct measurement of the D4000 opens up several possibilities for narrow-band photometry that may not be available to conventional spectroscopy, such as the study of the radial dependence of this spectral feature by comparing the D4000 measurements at different apertures. In addition to the radial D4000 measurement, more conventional studies can be carried out with PAUS D4000 measurements, such as exploring the star formation history of galaxies in the PAUS catalogue by constraining their stellar ages and redshift of formation. The wealth of narrow-band photometric data from PAUS may also be used to further study the relationship between morphology and D4000/galaxy quenching \citep[e.g., see][and the references therein]{Kim2018}, or to analyse the role of the environment in these processes, and thus disentangle the influence of nature vs nurture in galaxy evolution \citep[e.g.,][]{DeLucia2012, Davidzon2015}. SED-fitting techniques can be complementary to these studies, as they reproduce with good accuracy the dependency of the D4000 on other physical parameters (e.g., redshift, stellar mass, or SFR) and provide reasonable estimates even for the fainter objects, but ultimately are not able to reflect the true complexity of the galaxy zoo.


\section*{Acknowledgements}

The PAU Survey is partially supported by MINECO under grants CSD2007-00060, AYA2015-71825,  ESP2017-89838, PGC2018-094773, PGC2018-102021, SEV-2016-0588, SEV-2016-0597, MDM-2015-0509 and Juan de la Cierva fellowship and LACEGAL and EWC Marie Sklodowska-Curie grant No 734374 and no.776247 with ERDF funds from the EU  Horizon 2020 Programme, some of which include ERDF funds from the European Union. IEEC and IFAE are partially funded by the CERCA and Beatriu de Pinos program of the Generalitat de Catalunya. Funding for PAUS has also been provided by Durham University (via the ERC StG DEGAS-259586), ETH Zurich, Leiden University (via ERC StG ADULT-279396 and Netherlands Organisation for Scientific Research (NWO) Vici grant 639.043.512), University College London and from the European Union's Horizon 2020 research and innovation programme under the grant agreement No 776247 EWC. The PAU data center is hosted by the Port d'Informaci\'o Cient\'ifica (PIC), maintained through a collaboration of CIEMAT and IFAE, with additional support from Universitat Aut\`onoma de Barcelona and ERDF. We acknowledge the PIC services department team for their support and fruitful discussions. P.R. and Z.C. are supported by  National Science Foundation of China (grant No. 12073014). The results published have been funded by the European Union's  Horizon 2020 research and innovation programme under the Maria Skłodowska-Curie (grant agreement No 754510), the National Science Centre of Poland (grant UMO-2016/23/N/ST9/02963) and by the Spanish Ministry of Science and Innovation through Juan de la Cierva-formacion program (reference FJC2018-038792-I). AHW is supported by an European Research Council Consolidator Grant (No. 770935).


\section*{Data Availability}

 
The data underlying this article will be shared on reasonable request to the corresponding author.





\bibliographystyle{mnras}

\section{Introduction}

In a broad sense, galaxy observations are divided in two different methodologies: spectroscopy and photometry. Spectroscopic surveys (e.g., DEEP2 \citep{Davis2003}, GAMA \citep{Baldry2010} eBOSS \citep{Dawson2016a}, VIPERS \citep{Scodeggio2018}, VANDELS \citep{Pentericci2018}) provide enough spectral resolution to clearly distinguish emission lines, breaks, etc. from the spectral continuum, as well as to determine with high precision the redshifts of the observed galaxies, to the point of redshift errors being considered negligible for most applications. Nevertheless, spectroscopic observations require large integration times for each object, as well as previous target selection.

On the other hand, most photometric surveys observe with broad-band filters (e.g. KiDS \citep{DeJong2013}, DES \citep{Abbott2018}, DESI Legacy Imaging Surveys \citep{Dey2019}) which can observe entire sky fields with far less telescope time, thanks to the large full width at half maximum (FWHM) of the filters used (roughly of the order of $\sim 1000$ \AA). This filter width allows to obtain high signal-to-noise ratio (SNR) with relatively low integration times, but also prevents the observation of any spectral features other than the continuum, given the low spectral resolution.

A middle ground between spectroscopic and broad-band photometric surveys are narrow-band photometric surveys, with photometric filters of the order of $\rm FWHM \sim 100$ \AA. These offer much larger spectral resolution and higher redshift precision than their broad-band counterparts, without increasing observation time as much as spectroscopy. They also keep other advantages of photometric surveys: no specific target selection is required, and the reduction of their images is still significantly less complex than that of spectra. Most existing narrow-band surveys so far observed small areas of the order of few deg$^2$, covering the visible spectrum with medium-width filters of $\rm FWHM > 200$ \AA, such as COMBO-17 \citep{Wolf2003} or ALHAMBRA \citep{Moles2008}. Also, surveys specifically designed for the observation of certain emission lines with very few filters have also been carried out, like SILVERRUSH \citep{Ouchi2018} for the Ly$\alpha$ line.

Narrow-band surveys covering significant angular areas, sampling the whole visible spectrum with filters of $\rm FWHM \sim100$ \AA, have been proposed during the past decade, and are currently starting to reveal its potential. One example of these surveys is the ongoing Physics of the Accelerating Universe Survey \citep[PAUS,][]{Benitez2009}, whose data is employed in this work. PAUS has been primarily designed to determine high-precision photometric redshifts \citep{Marti2014, Eriksen2019}, mostly allowing for precise cross-correlation of lensing and redshift distortion probes \citep{Gaztanaga2012}. Other examples of narrow-band surveys with larger angular coverage are J-PAS \citep{Benitez2014}, J-PLUS \citep{Cenarro2019} and S-PLUS \citep{DeOliveira2019}. These more general-purpose narrow-band surveys show potential to resolve specific spectral features, with closer approximation to spectroscopy \citep[e.g.,][]{Stothert2018, Martinez-Solaeche2020}.

The observation of specific spectral features besides the spectral continuum allows us to determine key galaxy properties such as star formation rate (SFR), stellar age ans metallicity \citep[e.g.,][]{Worthey1994, Kauffmann2003a}; these spectral features are the results of different physical processes, and thus are a proxy to study the formation and evolution of galaxies. Generally, emission lines provide information about the ionised interstellar medium \citep[ISM;][]{Kewley2019}, while absorption lines inform of the properties of the stellar population \citep{Maraston2009}. For example, emission lines are commonly used to select active galactic nuclei (AGN) based on the Baldwin-Phillips-Terlevich (BPT) diagram \citep{Baldwin1981, Kauffmann2003, Kewley2013}, since they allow to discern between ionisation in the intergalactic medium (IGM) due to a soft UV source (e.g. star formation) or hard UV (e.g. AGN emission). On the other hand, absorption Lick indices are proxies for inferring stellar ages and metallicities \citep{Worthey1994, Thomas2003}.

The direct measurement of spectral features is generally reserved to spectroscopic surveys. However, galaxy properties can also be estimated with other methods, where the entirety of the spectrum is fit to stellar population models (full spectrum fitting). These fits are often convolved with the line-of-sight velocity distribution, which makes it especially useful to study galaxy kinematics. Some examples of full spectrum fitting codes are \textsc{STECKMAP} \citep{Ocvirk2006}, \textsc{ULySS} \citep{Koleva2009} and \textsc{pPFX} \citep{Cappellari2017}. Perhaps the most prominent one is spectral energy distribution (SED) fitting, in which a linear combination of spectral templates associated with different physical systems (stellar population models, dust emission/attenuation, AGNs, etc.) are fit to the observed spectral energy distribution, and the galaxy properties are inferred from the fit. This is a method widely applied to broad-band photometry, and several codes exist in the literature for this purpose, such as \textsc{LePHARE} \citep{Ilbert2006}, \textsc{CIGALE} \citep{Noll2009, Boquien2019} or \textsc{ProSpect} \citep{Robotham2020}; moreover, the application of SED-fitting codes for narrow-band photometric surveys has already been evaluated in \citet{Delgado2021} for the miniJPAS data release.

One spectral feature of special interest for this work is \textit{spectral breaks}: combinations of absorption lines in broader features that damp the continuum emission at given wavelength ranges. The most important of these features in the optical part of galaxy spectra is the 4000 \AA\ break, generated around that wavelength range by the absorption of several ionised metallic elements, as well as the latest lines in the Balmer series. The strength of this spectral break is quantified by the ratio between the continuum fluxes before and after the break itself; this quantity is known as the D4000 spectral index, or just \textit{D4000}. Two definitions for the D4000 with slightly different wavelength ranges exist in the literature: the original D4000 wide definition \citep{Bruzual1983, Hamilton1985}, and another defined in a narrower wavelength span \citep{Balogh1999}, which is the current standard. Henceforth, we will refer to these definitions as D4000$_{\rm w}$ and D4000$_{\rm n}$ respectively.

While D4000$_{\rm n}$ is generally preferred, mostly because it is far less sensitive to reddening effects due to the smaller continuum regions, both D4000 definitions have been extensively applied to study galaxy properties (e.g., stellar age, metallicity). The D4000 strength is correlated to the age of stellar populations: as galaxies grow old, they become redder and the strength of D4000 increases. However, it is also correlated with metallicity \citep{Worthey1994}, and when D4000 is used to determine galaxy ages, it is generally combined with metallicity indicators to break the age-metallicity degeneracy.

Given these characteristics, the D4000 has been widely used in galaxy evolution works as a measurement of stellar age, based mostly on D4000$_{\rm n}$ \citep[e.g.][]{Balogh1999, Brinchmann2004, Marcillac2006, Siudek2017}, but also D4000$_{\rm w}$ \citep[e.g.][]{Bruzual1983, Mignoli2005, Kriek2011, Kim2018}, or even alternative definitions \citep{Tresse1999}. In addition to these studies of galaxy properties, the D4000 has also been used in cosmology to independently determine the Hubble expansion rate, $H(z)$, with the method of cosmic chronometers \citep{Moresco2012}. In that work, the measurement of D4000$_{\rm n}$ is used to infer stellar ages of passive red galaxies; the age difference between redshift bins allows us to directly estimate the evolution of the Hubble parameter.

While the D4000 has been traditionally measured with spectroscopic observations, narrow-band photometric surveys may also yield enough spectral resolution for its measurement \citep{Stothert2018, Angthopo2020}. In this work, we will assess the possibility of measuring the D4000 with PAUS narrow-band photometry. In fact, due to its high spectral resolution for an imaging survey, several works have already partially explored the possibilities of its photometry to detect spectral features and/or derive galaxy properties with PAUS. For example, in \citet{Johnston2021} and \citet{Tortorelli2021} \textsc{CIGALE} is applied to PAUS photometry to derive rest-frame colours and luminosities, as well as stellar masses and SFRs, while the photometric redshift code developed in \citet{Alarcon2021} also estimates emission line fluxes. Detection of spectral features has also been evaluated, like the Ly$\alpha$ line for intensity mapping studies in \citet{Renard2021}, or even the possibility of D4000 measurements briefly evaluated with mock catalogues and synthetic datasets in \citet{Stothert2018}, which is a precursor to the work presented here.

In order to evaluate PAUS capability to determine the D4000 value, we develop an estimator for directly measuring this spectral feature over its narrow-band photometry, and compare this methodology against the spectroscopic measurements provided by the VIMOS Public Extragalactic Redshift Survey (VIPERS), as well as the ones obtained from the SED-fitting code CIGALE. In order to do so, the D4000 distribution and its average trends versus different observables (redshift, stellar mass, SFR) will be evaluated, as well as the validity of these D4000 measurements to discriminate between red and blue galaxies when compared to a fiducial classification. It is worth noting that this is the first work were the D4000 is determined by CIGALE using narrow-band photometry and compared to spectroscopy, although other works using CIGALE-derived D4000 with only broad-band photometry already exist. For example, in \citet{Buat2011} it is studied along other spectral features, in \citet{Boquien2012} it is used to examine the dependency of physical parameters on attenuation, and in \citet{Johnston2015} it is employed for galaxy classification. Moreover, the estimation of D4000 (as well as other spectral indices) with SED-fitting techniques has also been evaluated in \citet{Mejia-Narvaez2017} with synthetic J-PAS data.

The paper is structured as follows. In \Cref{sec:Data samples}, we will explain the observational datasets that have been used. The D4000 estimator specifically developed for narrow-band photometry will be discussed in \Cref{sec:Methodology: D4000 estimators}, as well as the estimation of D4000 and other galaxy properties with \textsc{CIGALE}. In \Cref{sec:Accuracy and distribution of D4000 estimations with PAUS and CFHTLS data}, the performance of the D4000 estimator will be evaluated against spectroscopic and SED-fitting results by evaluating its SNR, distribution and bias. In \Cref{sec:D4000 and galaxy properties}, the evolution of the D4000 as determined by each estimation method will be examined, as well as its performance for galaxy classification. We will conclude with \Cref{sec:Conclusions}.

\section{Data samples}\label{sec:Data samples}

\subsection{PAUS}\label{sec:PAUS}

PAUS is a narrow-band photometric survey carried out at the William Herschel Telescope. Observations are performed with a special-purpose instrument, the PAU Camera \citep{Padilla2019}, with a configuration of 40 narrow-band filters (NBs) uniformly spaced between 4550 \AA\ and 8450 \AA\ in steps of 100 \AA\ (see \cref{fig:PAUS_filters}). This filter configuration yields an average spectral resolution of $\rm R \sim 65$. It has targeted five different fields: the COSMOS field \citep{Laigle2016} and the wide fields (W1, W2, W3, W4) of the Canada-France-Hawaii Telescope Legacy Survey \citep[CFHTLenS,][]{Cuillandre2012, Hudelot2012}. In all fields, a broad-band reference catalogue is used as a detection mask (COSMOS and CFHTLS respectively), and the photometry is estimated on the areas given by this reference catalogue (a process known as \textit{forced photometry}, see \citealt{Eriksen2019}, \citealt{Cabayol2021}).

The current angular footprint of the survey is $\sim 50$ deg$^2$, and its catalogue is complete up to $i_{\rm AB}\leq23$, with slightly over 3 million galaxies if all fields are considered. The redshift range of the catalogue is $0<z<1.2$, and early results show that the photometric redshift is determined with an error of $\sigma_{68}/(1+z) = 0.0037$ to $i_{\rm AB}<22.5$ for a 50\% redshift quality cut \citep{Eriksen2019} in the COSMOS field. These benchmark results have been improved with enhancements over the original photo-z code \citep{Alarcon2021}, or machine learning approaches \citep{Eriksen2020, Soo2021}.

\begin{figure}
 	\includegraphics[width=\columnwidth]{PAUS_filters.pdf}
     \caption{Response functions for the PAUS narrow-band filters (coloured), together with VIPERS total wavelength range (light-grey shaded area), and the wavelength span considered for this study (dark-grey shaded area). The diagonal black lines represent the redshift of the wavelength limits of the D4000 (right y-axis) versus its observed wavelength, while the horizontal black lines highlight the redshift range for the D4000 measurement, given the wavelength coverage of our D4000 study. Solid line for D4000$_{\rm w}$, dash-dotted line for D4000$_{\rm n}$.}
     \label{fig:PAUS_filters}
\end{figure}


\subsection{VIPERS}\label{sec:VIPERS}

The VIMOS public extragalactic redshift survey \citep[VIPERS,][]{Guzzo2013, Scodeggio2018} is a spectroscopic survey carried out at the Very Large Telescope in Cerro Paranal, Chile, with the VIMOS instrument \citep{LeFevre2003}. The grism used for this survey (low-resolution red) yields a spectral resolution $R \simeq 220$. The wavelength coverage by VIPERS with this grism is shown in \cref{fig:PAUS_filters} as a light-grey shaded area. For this work, we utilise its second public data release, PDR-2 \citep{Scodeggio2018}.

The target selection of PDR-2 comprises objects in the redshift interval $0.5<z<1.2$, with a magnitude limit of $i_{\rm AB}\leq 22.5$, which makes it one of the deepest spectroscopic catalogues publicly available. The complete catalogue covers a total of $\sim 23.5$ deg$^2$, split between the CFHTLS W1 and W4 fields, which results in a catalogue of 86,775 galaxies in total.

\subsection{Sample selection}\label{sec:Sample selection}

Thanks to its unprecedented volume and the wealth of auxiliary data, VIPERS is an ideal spectroscopic dataset to validate PAUS capabilities. In order to do so, we have cross-matched the W1 VIPERS catalogue with PAUS observations, using a radius of 1 arcsec to match objects between catalogues. In \cref{fig:W1_angular_footprint}, the footprints of both catalogues in the W1 field are displayed; the cross-match between both yields a sample of 33,363 objects covering the whole PAUS redshift range ($0<z<1.2$). Moreover, we applied a cut based on the VIPERS redshift quality flags: only objects with $2\leq \texttt{zflg} <10$ or $22\leq \texttt{zflg} <30$ were included in the sample \citep{Scodeggio2018}. This cut keeps all the primary (i.e., in the original target catalogue) and secondary (i.e., observed in the slit but not in the target catalogue) objects with a redshift measurement good enough for science (>90\% confidence level), while removing AGNs from the sample. This redshift quality cut leaves the selected sample with 28,788 galaxies. 

\begin{figure*}
 	\includegraphics[width=\textwidth]{W1_angular_footprint.png}
     \caption{Survey footprint in the W1 field for PAUS (orange), VIPERS (purple) and the cross-match between both (brown). Each point represents an object in the catalogue.}
     \label{fig:W1_angular_footprint}
\end{figure*}

Given that VIPERS spectra are observed in a redder wavelength span than PAUS, the wavelength range selected for D4000 measurements goes from 5850 \AA\ to 8350 \AA\ (\cref{fig:PAUS_filters}, dark-grey area). With this choice of wavelength coverage, the low SNR regions at the limits of the spectrograph range are avoided, and an extra PAUS NB is left outside of range in the red end to avoid undesired boundary effects in the D4000 estimation. This restriction in wavelength coverage also implies a constraint in the redshift interval where the D4000 can be measured, as shown in \cref{fig:PAUS_filters} by the horizontal black lines. For D4000$_{\rm w}$ and D4000$_{\rm n}$, this redshift range is $0.562<z<0.967$ and $0.521<z<1.039$ respectively. Nevertheless, we have applied just the most stringent cut of $0.562<z<0.967$, in order to use the same sample to evaluate both D4000$_{\rm w}$ and D4000$_{\rm n}$. After applying this redshift cut to both PAUS photo-z and VIPERS spec-z, the selected sample has 17,375 objects, with a mean redshift $\langle z \rangle=0.731$.

In addition to the redshift cut, once the D4000 has been computed all objects with an invalid D4000 measurement have been removed. This includes objects with missing NBs or masked spectral regions needed for D4000 calculation, as well as objects whose CIGALE fits were deemed not good enough. This leaves a final sample of 17,241 galaxies that is used throughout this work.

\subsection{Redshift comparison}\label{sec:Redshift comparison}

A comparison of the distribution of PAUS photo-z and VIPERS spec-z for the W1 cross-match is shown in \cref{fig:z_comparison}. The orange box in the middle of the plot represents the $0.562<z<0.967$ cut in both redshift estimations; hence all objects inside the box are the selected sample for D4000 measurements. Most of the PAUS photo-z follows closely along the red diagonal line representing the 1:1 equivalence. It is worth noting that the determination of PAUS photo-z in the wide fields is still a work in progress, and thus some artefacts that can be appreciated in \cref{fig:z_comparison} (horizontal stripes) may disappear in future data releases.

\begin{figure}
 	\includegraphics[width=\columnwidth]{z_comparison.png}
     \caption{PAUS photo-z versus VIPERS spec-z, for the cross-match of 28.788 galaxies with accurate spec-z measurements. Points are coloured according to the logarithm of the point density (with lighter areas having more objects). The red line represents the 1:1 equivalence between redshift measurements. The redshift cuts introduced for the D4000 measurement, both in PAUS photo-z and VIPERS spec-z, are represented by the orange box.}
     \label{fig:z_comparison}
\end{figure}

We can further evaluate the performance of PAUS photo-z with its dispersion, $\sigma_{68}/(1+z)$. If we first define $\Delta z$ as

\begin{equation}\label{eq:delta_z}
    \Delta z = \frac{z_{\rm PAUS}-z_{\rm spec}}{1+z_{\rm spec}},
\end{equation}

we can define $\sigma_{68}$ as

\begin{equation}\label{eq:sigma68}
    \sigma_{68} = \frac{P_{\rm 84.1\%}(\Delta z) - P_{\rm 15.9\%}(\Delta z)}{2},
\end{equation}

where $P_{i \%}$ is the \textit{i}th percentile of the distribution. This $\sigma_{68}$ is equivalent to $\sigma$ if $\Delta z$ had a Gaussian distribution, while being much less sensitive to outliers. For this work, outliers have been defined as all galaxies which have $|\Delta z| > 0.15$, following \citet{Soo2021}. In \cref{fig:z_sigma_outlier}, the average $\sigma_{68}/(1+z)$ value, as well as the outlier fraction, is shown for both the PAUS photo-z and the broad-band photo-z from the CFHTLS reference catalogue \citep{Ilbert2006, Coupon2009}. For the D4000 redshift cut, the outlier fraction for PAUS is kept below 2\%, and PAUS photo-z shows a smaller scatter than the CFHTLS catalogue for the whole magnitude range ($\langle\sigma_{68}/(1+z)\rangle=0.019$ for PAUS, $\langle\sigma_{68}/(1+z)\rangle=0.032$ for CFHTLS). The worse performance of PAUS photo-z when compared to earlier works in the COSMOS field \citep[$\langle\sigma_{68}/(1+z)\rangle\simeq0.0037$ for a 50\% quality cut;][]{Eriksen2019, Alarcon2021} is partially due to the smaller number of exposures and higher mean redshift in the wide fields.


\begin{figure}
 	\includegraphics[width=\columnwidth]{z_sigma_outlier.pdf}
     \caption{$\sigma_{68}/(1+z)$ (middle panel) and outlier fraction (lower panel) for the PAUS photo-z (orange lines) and CFHTLS photo-z (green lines), in magnitude bins. Solid line represents the full cross-match, dotted line the redshift cut for D4000 measurement. Upper panel displays the magnitude histogram.}
     \label{fig:z_sigma_outlier}
\end{figure}


\subsection{Low-redshift sample: GSWLC-2}\label{sec:GSWLC-2}

In order to evaluate the usefulness of the D4000 measured on narrow bands in galaxy evolution studies, we analyse in \cref{sec:D4000 versus stellar mass and SFR} the evolution of D4000-mass relation at $0<z<1$. The low-redshift sample for this study was drawn from \citet{Turner2021}, extracted from the GALEX-SDSS-WISE Legacy Catalogue \citep[GSWLC-2][]{Salim2016, Salim2018}, which is based on the SDSS Data Release 10 \citep{Ahn2014}. This catalogue consists of galaxies within the footprint of the Galaxy Evolution Explorer \citep[GALEX][]{Martin2005, Morrissey2007}, with spec-z $0.01<z<0.3$ and Petrosian magnitude $r<18$. 
Moreover, additional cuts were applied in \citet{Turner2021} to keep only low-redshift objects ($0.02<z<0.08$) and ensure completeness (stellar masses above $10^{9.5}$ M$_{\odot}$). We refer the reader to \citet{Turner2021} for a full description of the GSWLC-2 sample, as well as a explanation of how stellar masses and other galaxy properties have been determined in this catalogue using CIGALE. The resulting sample of \citet{Turner2021} consists of 177,362 galaxies, with an average redshift $\langle z \rangle = 0.0058$ 

As low- and intermediate- redshift samples are coming from different surveys, \citet{Turner2021} have applied cuts to mimic the higher-redshift counterparts of low-redshift galaxy population. The stellar mass distribution for low- and intermediate- redshift sample is preserved, whereas at higher redshift galaxies have bluer colours and lower D4000 values (see \cref{fig:sm_histograms}). The low-z sample consists of galaxies that are the older and redder counterparts of galaxies at higher redshift allowing us to study galaxy evolution over the last 7 Gyr, i.e., half of the age of the Universe.

\begin{figure}
 	\includegraphics[width=\columnwidth]{sm_histograms.pdf}
     \caption{\textit{Upper panel}: Histogram of stellar mass distribution for the PAUS-VIPERS sample described in \cref{sec:Sample selection} (filled histogram), and the GSWLC-2 sample from \citet{Turner2021} (line histogram). \textit{Lower panel}: Same histograms, but for blue and red galaxies, classified with a single cut in the spectroscopic D4000$_{\rm n}$ \citep[D4000$_{\rm cut}=1.55$, as defined in][]{Kauffmann2003b}.}
     \label{fig:sm_histograms}
\end{figure}

\section{Methodology: D4000 estimators}\label{sec:Methodology: D4000 estimators}

In this section, we will describe in detail the two different methods used to measure the D4000 from PAUS data: the direct estimation by measuring the rest-frame bands over PAUS NBs (\cref{sec:Direct estimator}), and the SED-fitting procedure with CIGALE that, among other physical parameters, yields the D4000 of the galaxies in the selected sample (\cref{sec:CIGALE estimation}). Moreover, in \cref{sec:Direct estimator} we will also briefly review the general D4000 definition, as well as its calculation with spectroscopic data.

\subsection{Direct estimator}\label{sec:Direct estimator}

\subsubsection{Estimator definition}\label{sec:Estimator definition}

{The measurement of the D4000} is defined as the ratio between two average flux frequency densities ($F_\nu$), integrated in rest frame (also known as \textit{rest-frame bands}),

\begin{equation}\label{eq:D4000_definition}
{\rm D4000} = \frac{\langle F_\nu \rangle_{\rm red}}{\langle F_\nu \rangle_{\rm blue}}.
\end{equation}

If these average flux frequencies bands are to be directly measured on spectra, its integration is straightforward,

\begin{equation}\label{eq:D4000_band_integration}
\langle F_\nu \rangle = \frac{1}{(\lambda_{\rm max} - \lambda_{\rm min})(1+z)} \int_{\lambda_{\rm min}\cdot(1+z)}^{\lambda_{\rm max}\cdot(1+z)} d\lambda\, F_\nu(\lambda),
\end{equation}
where $\lambda_{\rm min}$ and $\lambda_{\rm max}$ are the wavelength boundaries for a given band, and $z$ is the redshift of the object.

In \cref{eq:D4000_definition}, $\langle F_\nu \rangle_{\rm red}$ is the integrated flux of the rest-frame band defined at wavelengths larger than 4000\AA\ (i.e., the region unaffected by the combination of absorption lines that causes the break itself), and $\langle F_\nu \rangle_{\rm blue}$ is the integrated flux at the rest-frame band at shorter wavelengths (where the continuum is affected by the set of absorption lines of the 4000 \AA\ break). The wavelength boundaries of these rest-frame bands are specified in \cref{tab:D4000_wavelengths}, as specified in \citet{Bruzual1983} for D4000$_{\rm w}$ and \citet{Balogh1999} for D4000$_{\rm n}$. We will refer to these bands, as well as to their integrated fluxes, as \textit{red band} and \textit{blue band} respectively (or simply \textit{D4000 bands}). The stronger the spectral break (i.e., the more absorption), the fainter the blue band compared to the red one, and the higher the D4000 value (since in \cref{eq:D4000_definition} the flux of the red band is in the numerator, while the blue band flux is in the denominator).

In this work, the measurements of the D4000 from VIPERS spectra have been computed following \cref{eq:D4000_band_integration} with the EZ redshift code \citep{Garilli2010}. If the D4000 has to be determined with narrow-band photometry, however, \cref{eq:D4000_band_integration} cannot be directly applied. The spectral resolution of the NBs is of the same order of magnitude as the width of the D4000 bands, and thus common numerical integration methods (e.g., Trapezoidal rule, Simpson's rule) may result in large inaccuracies. Consequently, we have developed a specific estimator to compute the D4000 bands with narrow-band photometry. While its performance will only be evaluated for PAUS in this work, by definition it can be applied to any combination of narrow-band filters, as long as their FWHM is smaller than the D4000 bands when shifted to the observed frame, and the wavelength coverage in the redshift range of interest is reasonably complete.

For PAUS NBs, $\langle F_\nu \rangle$ is computed as

\begin{equation}\label{eq:PAUS_estimator}
\langle F_\nu \rangle  = \frac{\sum_{\rm i}\Delta \lambda_{\rm i} r_{\rm i}^2 \sigma_{\rm i}^{-2} F_{\rm\nu\,i}}{\sum_{\rm i} \Delta \lambda_{\rm i} r_{\rm i}^2 \sigma_{\rm i}^{-2}},
\end{equation}
where $F_{\rm \nu\, i}$ and $\sigma_{\rm i}$ are the flux and its error for the band $i$, respectively, and the sum is over all the NBs considered for the D4000 measurement (\cref{fig:PAUS_filters}).

The $r_{\rm i}$ factor is the following ratio

\begin{equation}\label{eq:r_definition}
r_{\rm i} = \frac{\int_{\lambda_{\rm min}\cdot(1+z)}^{\lambda_{\rm max}\cdot(1+z)}d\lambda\, R_{\rm i}(\lambda)}{\int_0^\infty d\lambda\, R_{\rm i}(\lambda)},
\end{equation}
where $R_{\rm i}(\lambda)$ is the response function for the filter $i$. In the numerator, $R_{\rm i}(\lambda)$ it is integrated only over the limits of the D4000 band of interest (as defined in \cref{tab:D4000_wavelengths}), redshifted to the observed frame (hence the redshift of the object, $z$). In the denominator, however, the total area of $R_{\rm i}(\lambda)$ is computed. Thus, this $r_{\rm i}$ factor can be interpreted as the fraction of the NB that is inside the wavelength range of the D4000 band.

Regarding the $\Delta \lambda_{\rm i}$ factor in \cref{eq:D4000_definition}, it must be a term with wavelength units to make the broadest NBs weight more in the calculation of the D4000 bands. The definition we have chosen is simply

\begin{equation}\label{eq:d_lambda_definition}
\Delta \lambda_{\rm i} = \int_0^\infty d\lambda\, R_{\rm i}(\lambda),
\end{equation}

If the response functions $R_{\rm i}(\lambda)$ were ideal top-hat functions with a maximum value of 1, intuitively $\Delta \lambda_{\rm i}$ would be the width of the top-hat, and the product $\Delta \lambda_{\rm i}F_{\rm \nu\, i}$ would simply correspond to the area of the flux integrated by the NB $i$. Consequently, \cref{eq:PAUS_estimator} in this ideal case could be interpreted as a Riemann sum weighted by $r_{\rm i}^2 \sigma_{\rm i}^{-2}$. Hence, \cref{eq:PAUS_estimator} is the generalisation of a weighted Riemann sum to any set of photometric bands with response functions $R_{\rm i}(\lambda)$.

The weighting $r_{\rm i}^2 \sigma_{\rm i}^{-2}$ can be interpreted as the contribution of two different error sources: the error of the NB measurement itself ($\sigma_{\rm i}$), and the part of the NB corresponding to the flux integrated outside of the D4000 band of interest. All flux information coming from outside the D4000 band wavelength range can be regarded as noise; therefore a NB which has half of its area outside of the D4000 band should have half the SNR than a NB which is fully inside. This can be expressed in terms of a net error, $\sigma_{\rm net\, i} = r_{\rm i}^{-1} \sigma_{\rm i}$. Therefore, the weighting is just a standard inverse variance weighting ($\sigma_{\rm net\, i}^{-2}$), but using a $\sigma_{\rm net\, i}$ error that accounts for both the intrinsic error of the observation of each band flux, and the undesired flux information outside of the D4000 rest-frame band. Regarding the error of \cref{eq:PAUS_estimator}, it is simply determined by standard error propagation of the errors of the NB fluxes, $F_{\rm \nu \, i}$

In \cref{fig:D4000_measurement_example} an example of the D4000$_{\rm w}$ measurement for a single object is displayed, both for its VIPERS spectrum and PAUS NBs. The selected object is a galaxy with D4000$_{\rm w} \sim 1.7$, a value high enough to have a spectral break easily distinguishable by eye, and typical for red galaxies. Hence, it can be considered a fairly representative example of a red galaxy in our sample. The apparent magnitude of the object is $i_{\rm AB}=20.71$. The plot is shown in rest frame, and the values of the spectrum mean fluxes measured in the blue and red bands used to compute the D4000 index for VIPERS and PAUS are computed with \cref{eq:D4000_band_integration} and \cref{eq:PAUS_estimator} respectively. Besides, for PAUS the NB response functions are plotted with a faint grey colour for reference. The relevant data of regarding the D4000 measurement of the object shown in \cref{fig:D4000_measurement_example} are displayed in \cref{tab:example_object_data}. It is worth noting that if the PAUS D4000 is computed using the VIPERS spec-z, we find D4000$_{\rm w}=1.50\pm 0.14$, a result consistent with the PAUS value displayed in \cref{tab:example_object_data}, but not so much with its VIPERS counterpart. The reason for this discrepancy may lie in how the noise in PAUS NBs influence the determination of each photo-z, yielding D4000 values that are more self-consistent than these computed with an external redshift measurement. However, as it is shown in \cref{sec:SNR}, the actual D4000 error budget is perfectly accounted for by the errors in PAUS photometry alone.

\begin{table}
\centering
	\caption{Wavelength ranges for the blue and red rest-frame bands of \cref{eq:D4000_definition}, for both the D4000$_{\rm w}$ and D4000$_{\rm n}$ definitions.}
 	\label{tab:D4000_wavelengths}
 	\begin{tabular}{rcc}
 		\hline
 		 & Blue band (\AA) & Red band (\AA)\\
 		\hline
 		D4000$_{\rm w}$  & 3750-3950 & 4050-4250\\
        D4000$_{\rm n}$  & 3850-3950 & 4000-4100\\
		\hline
 	\end{tabular}
 \end{table}

\begin{figure}
 	\includegraphics[width=\columnwidth]{D4000_measurement_example_14342.pdf}
     \caption{Example of measurement of D4000$_{\rm w}$ bands (red and blue areas). PAUS NB fluxes are represented by black points with error bars, while the VIPERS spectrum is shown with a solid purple line; the dotted lines represent their respective D4000$_{\rm w}$ bands. PAUS response functions in rest-frame are plotted in very light-grey for reference (normalised to fit the plot). The VIPERS spectrum has been shifted to the rest frame using its spectroscopic redshift; while the PAUS photo-z has been used for PAUS data.}
     \label{fig:D4000_measurement_example}
\end{figure}

\begin{table}
\centering
	\caption{Redshifts, D4000$_{\rm w}$ measurements and catalogue IDs for the representative object displayed in \cref{fig:D4000_measurement_example}. The error for VIPERS spec-z is the average error specified in \citet{Scodeggio2018}.}
 	\label{tab:example_object_data}
 	\begin{tabular}{rccc}
 		\hline
 		 & ID  & z & D4000$_{\rm w}$ \\
 		\hline
        VIPERS & 117158758 & 0.6995 $\pm$ 0.0013 & 1.73 $\pm$ 0.03 \\
 		PAUS photo-z & 10691571 & 0.66 $\pm$ 0.025 & 1.65 $\pm$ 0.18\\
  		PAUS spec-z & 10691571 & 0.6995 $\pm$ 0.0013 & 1.50 $\pm$ 0.14\\
		\hline
 	\end{tabular}
 \end{table}


\subsubsection{Synthetic PAUS tests}\label{sec:Synthetic PAUS tests}

Before applying it to real PAUS data, the estimator for the D4000 bands defined in \cref{eq:PAUS_estimator} has been tested against synthetic PAUS NBs, in order to evaluate the potential biases stemming from the estimator alone, without the experimental errors in the PAUS photometry or photo-z, as well as other possible unaccounted systematics.

The synthetic PAUS dataset (sPAUS) has been generated by selecting the whole VIPERS sample in W1, and integrating the spectra for all PAUS NBs considered in this work (\cref{fig:PAUS_filters}). These synthetic NBs have been used to determine the D4000 with \cref{eq:PAUS_estimator}, using the respective spectroscopic VIPERS redshifts. Therefore, any deviations from the spectroscopic measurements must be due to our estimation method of the D4000 (which is limited by the spectral resolution of the narrow-band photometry).

A comparison between the VIPERS D4000 and the D4000 determined from sPAUS is shown in \cref{fig:bias_scatter_synth}, both for D4000$_{\rm w}$ and D4000$_{\rm n}$. In both panels, the scatter plot on the left displays the VIPERS D4000 versus the bias of the sPAUS D4000, defined as 

\begin{equation}\label{eq:bias_definition}
\rm{Bias\, (\%)} = 100 \cdot\left( \frac{D4000_{\rm sPAUS}}{D4000_{\rm VIPERS}} - 1 \right),
\end{equation}
together with a linear fit and its error (yellow line). The histogram on the right is a histogram of the bias, with its mean value and $\sigma$ shown in yellow. From these plots, it can be inferred that the D4000$_{\rm w}$ has a slight mean negative bias of the order of $\sim$-1\% that seems fairly constant across all the VIPERS D4000 range (the linear fit shows just a small correlation). On the other hand, the D4000$_{\rm n}$ shows a smaller net bias but also more dispersion, and a clear correlation between bias and D4000 values: D4000$_{\rm n}$ is overestimated for bluer galaxies (D4000$_{\rm n}<1.4$), while it is underestimated for higher values (i.e.,  for redder galaxies). Moreover, in both cases the total bias distribution in the histograms is fairly close to Gaussian. Some numerical results from this comparison are summarised in \cref{tab:bias_results}.

Overall, these results show a significant improvement over the preliminary analysis carried out in \citet{Stothert2018}, where a simple linear interpolation was used to estimate the D4000 over a similar synthetic catalogue (computed from SDSS spectra instead of VIPERS). In Figure 10 of \citet{Stothert2018}, a comparison akin to \cref{fig:bias_scatter_synth} is displayed, but showing only mean biases (without \%) in bins of the VIPERS D4000. While the same trends appear (a clear linear correlation in the D4000$_{\rm n}$), the absolute bias values are significantly lower in this work. This is especially noticeable on the low and high D4000 ends, e.g., at D4000$_{\rm n}\sim 2 $ \citet{Stothert2018} finds a mean bias of $\sim$-7.5\% (dashed line), while in this work the linear fit shows a bias of $\sim$-5\%. A similar improvement appears in the D4000$_{\rm w}$, where they find biases of $\sim$-7.5\% and $\sim$-2.5\% for the low and high D4000 ends, while \cref{fig:bias_scatter_synth} clearly shows smaller mean biases in these regions. Besides, their mean bias of $\sim$-2\% for the D4000$_{\rm w}$ found in \citet{Stothert2018} is reduced by a factor of two.

The reason for this improvement is the integration of the D4000 bands using an estimator that properly weights the flux fraction in each NB that is relevant to the rest-frame band (\cref{eq:PAUS_estimator}), as well as the observational error. With linear interpolation, NBs mostly outside the rest-frame band can still affect the slope of the interpolated SED (if they are adjacent to NBs "fully" inside the rest-frame band), and thus affect significantly the value of the integrated flux (\cref{fig:D4000_measurement_example} may help visualising this effect).

\begin{table}
\centering
	\caption{Mean and $\sigma$ of the bias for the D4000$_{\rm w}$ and D4000$_{\rm n}$ in the synthetic PAUS catalogue, together with the percentage of objects below absolute bias thresholds of 1\%, 2.5\% and 5\%.}
 	\label{tab:bias_results}
 	\begin{tabular}{rccccc}
 		\hline
 		 & & & \multicolumn{3}{c}{\% with absolute bias}\\
 		 & Mean bias (\%)  & $\sigma$ bias (\%) & $<$1\% & $<$2.5\% & $<$5\%\\
 		\hline
 		D4000$_{\rm w}$ & -1.03 & 2.59 & 41.06 & 77.21 & 95.11 \\
 		D4000$_{\rm n}$ & -0.23 & 3.19 & 32.07 & 67.44 & 92.62 \\
		\hline
    \end{tabular}
\end{table}

\begin{figure*}
 	\includegraphics[width=\columnwidth]{scatter_wide.png}
 	\includegraphics[width=\columnwidth]{scatter_narrow.png}
     \caption{The bias of the D4000 measured in the synthetic PAUS NB, vs VIPERS D4000 values. A linear fit with its error and the mean bias and its $\sigma$ in the histograms are marked with yellow lines and areas, respectively. \textit{Left:} D4000$_{\rm w}$. \textit{Right:} D4000$_{\rm n}$.}
     \label{fig:bias_scatter_synth}
\end{figure*}

In addition to the dependency of the bias with the VIPERS D4000, we investigate its correlation with redshift. Given that the D4000 bands are defined in rest frame, the $r_{\rm i}$ factor in \cref{eq:r_definition} and thus the NBs used in the D4000 calculation will be a function of $z$. Therefore, one could expect the redshift regions where the NBs better match the D4000 bands to be less biased and vice-versa (i.e., when the D4000 bands are covered solely by NBs fully inside the band, the measurement should be more accurate). As a consequence, the bias as a function of redshift should exhibit an oscillatory pattern as redshift increases and the D4000 bands shift to redder wavelengths in observed frame (since there will be an alternation of "good" and "bad" NB matches to the D4000 bands).

It is worth noting that this redshift dependency is just an effect of the relative position of the NBs with respect to the redshifted D4000 bands; any possible effect derived from galaxy evolution or observational systematics dependent on redshift is not considered. Since we are working with synthetic NBs integrated from VIPERS spectra, we can shift the wavelength of the spectra with the following change of variable before NB integration,

\begin{equation}\label{eq:apparent_redshift}
    \lambda' = \frac{1+z_{\rm apparent}}{1+z}\lambda,
\end{equation}
where $z$ is the actual redshift of the object, and $z_{\rm apparent}$ is the the redshift we want the NBs to "observe" the object with. This transformation is akin to shifting the object to the rest frame and then moving it to a different observed frame defined by $z_{\rm apparent}$. Hence, we can evaluate the redshift bias of any object not only at its real redshift $z$, but at any $z_{\rm apparent}$, as long as the D4000 can still be measured in the new observed frame.

Consequently, we have evaluated the redshift bias for all objects in the VIPERS W1 sample by computing their NBs in a fine $z_{\rm apparent}$ grid. The results are shown in \cref{fig:redshift_bias}. The bias appears as a continuous function because of the small grid size. At each point, the displayed bias and its error are respectively the mean bias and its $\sigma$ of all the objects of the VIPERS W1 sample where the D4000 could be measured after applying \cref{eq:apparent_redshift}.

\begin{figure}
 	 \includegraphics[width=\columnwidth]{bias_zt.pdf}
     \caption{Bias versus $z_{\rm apparent}$ for the D4000$_{\rm w}$ (upper panel) and D4000$_{\rm n}$ (lower panel). Grey line and shaded area represent the mean bias and its $\sigma$ for each $z_{\rm apparent}$, while the yellow line and its shaded area are the mean bias and $\sigma$ for the whole $z_{\rm apparent}$ range.}
     \label{fig:redshift_bias}
\end{figure}

For the D4000$_{\rm w}$, this redshift bias oscillates $<$2\% around the mean bias, while in D4000$_{\rm n}$ the oscillations reach well above 2\%. In both cases, the oscillations become significantly smaller as redshift increases, because the larger the redshift, the wider the D4000 bands in observed frame, and the smaller the error induced by NBs partially outside the D4000 band ($0<r_{\rm i}<1$). Moreover, the oscillations seem fairly stable around the mean bias (yellow lines); hence we can consider the redshift oscillations independent of the D4000 bias (see \cref{fig:bias_scatter_synth}).

After these tests, we can state that our estimator for NB photometry has a mean bias of $\sim-1.03\pm2.59$\% and $\sim-0.23\pm3.19$\% for D4000$_{\rm w}$ and D4000$_{\rm n}$ respectively (see \cref{tab:bias_results}), plus an oscillatory redshift bias due to the relative position of the NBs to the D4000 bands in observed frame. This oscillatory bias  adds an extra $\sim$2\% to the D4000$_{\rm w}$ in the worst cases (yielding a much smaller effect in most of the redshift range), while this increase is also larger for the D4000$_{\rm n}$. Besides, for D4000$_{\rm n}$ there is a clear decreasing linear correlation between bias and D4000 value, while for D4000$_{\rm w}$ this correlation is much weaker. In any case, a significant fraction of the sample shows sub-percent bias (41\% and 31\% for D4000$_{\rm w}$ and D4000$_{\rm n}$ respectively), and the large majority has an absolute bias below 5\% (95\% and 93\% respectively, see \cref{tab:bias_results}). Given these results, no bias corrections have been applied to the D4000 measurements, since the errors of the bias are larger than the biases themselves.

Overall, the estimation of the D4000$_{\rm w}$ through this method seems more reliable, but given the preponderance in the literature of the D4000$_{\rm n}$, we will consider both for scientific use. Considering that these results are for a synthetic dataset generated from spectroscopic data, without the larger photometric and redshift errors from narrow-band photometry, it is safe to assume that the biases of the estimator are negligible, or at least completely subdominant, when compared to the observational errors that we can expect.

\subsection{CIGALE estimation}\label{sec:CIGALE estimation}

In addition to the direct measurement over PAUS NBs, we have used the SED fitting algorithm Code Investigating GALaxy Emission \citep[CIGALE;][]{Noll2009, Boquien2019} to derive D4000 estimations from photometric observations. CIGALE is a physically-motivated state-of-the-art Python code for SED fitting based on the principles of the energetic balance between dust-absorbed stellar emission and its re-emission in the infrared (IR). The capabilities of this SED fitting tool have already been verified on PAUS observations \citep{Johnston2021, Tortorelli2021}. For this work, we have used a delayed star formation history, \citet{Bruzual2003} single stellar population models with the initial mass function (IMF) given by \citet{Chabrier2003}, a \citet{Charlot2000} attenuation law and the dust emission models of \citet{Dale2014} to built a grid of models. A detailed description of each module can be found in \citet{Malek2018} and \citet{Boquien2019}.

The adopted parameters employed for the SED fitting are listed in \cref{tab:cigale}.
Thanks to the use of only one free parameter in the \citet{Dale2014} model (i.e., the $\alpha$ slope in $dM_{\rm dust} \propto U^{-\alpha}dU$, where $M_{\rm dust}$ and $U$ are dust mass and radiation-field intensity, respectively), the SED-fitting procedure reduces the number of parameters to constrain without far infrared measurements. Those models are then fitted to the galaxy SEDs with the use of a Bayesian-like analysis. The quality of the fit is expressed by the reduced $\chi^2$, $\chi_{\rm r}^2$ (i.e., the $\chi^2$ divided by the number of data points). We have applied a quality cut to these fits by removing all objects with a $\chi_{\rm r}^2$ larger than ${\rm median}(\chi_{\rm r}^2)+3$ (in all CIGALE runs considered). This results in 802 objects being removed from the selected sample described in \cref{sec:Sample selection}, before the redshift cuts for D4000$_{\rm w}$/D4000$_{\rm n}$ measurement (the galaxy numbers displayed for these redshift ranges already take into account this quality cut).

For this work, SEDs were fitted to galaxies using: i) PAUS redshift and its corresponding NB photometry (hereafter \textit{PAUS CIGALE}), and ii) CFHTLS redshift \citep{Ilbert2006, Coupon2009} and its broad-band photometry (hereafter \textit{CFHTLS CIGALE}). These two datasets allow us to explore the improvement of D4000 measurement accuracy with narrow-band photometry. As one may expect more improvement fitting both NBs and broad bands, we also run CIGALE with both PAUS NBs and CFHTLS broad-band photometry, but the results were more discrepant with VIPERS spectroscopy than PAUS NBs alone. By adjusting the $\chi^2$  computation procedure \citep{Eriksen2019}, the combination of PAUS and CFHTLS photometry should yield better results than PAUS alone; however, any modifications to CIGALE are left as future work.

\begin{table*}
\centering
	\caption{The input parameters used for SED fitting with CIGALE.}
	\begin{tabular}{l | l}
\hline
Parameter & Values\\
\hline
\multicolumn{2}{c}{Delayed star formation history}\\
\hline
e-folding time of the main stellar population model [Myr] & 100, 300, 500, 1000, 2000, 5000\\
Age [Myr] & 300, 500, 1000, 1500,2500, 4500, 6000\\
\hline 
\multicolumn{2}{c}{Single stellar population \citep{Bruzual2003}}\\
\hline
Initial mass function & \citet{Chabrier2003}\\
Metallicity [$Z_{\odot}$] & 0.02\\
Age of separation between young and old stellar populations [Myr]  & 10\\
\hline
\multicolumn{2}{c}{Dust attenuation law \citep{Charlot2000}}\\
\hline
V-band attenuation ($A_{\rm V}$) in the interstellar medium (ISM) & 0.01, 0.1, 0.4, 0.7, 1.0, 1.5, 2.0, 2.5\\
Power law slopes of the attenuation in the birth clouds (BC) and ISM & -0.7\\
$A_{\rm V}$ ISM / ($A_{\rm V}$ BC +$A_{\rm V}$ ISM) & 0.8\\
\hline
\multicolumn{2}{c}{Dust emission \citep{Dale2014}}\\
\hline
AGN fraction & 0.0, 0.1, 0.3\\
Power law slope dU/dM ($U^{\rm \alpha }$)  & 2.0\\
\hline
\multicolumn{2}{c}{Nebular emission model}\\
\hline
Ionisation parameter & $10^{-2}$\\
Escape fraction of Lyman continuum photons & 0.0\\
Absorption fraction of Lyman continuum photons & 0.0\\
\hline
\end{tabular}
\label{tab:cigale}
\end{table*}	


\section{Accuracy and distribution of D4000 estimations with PAUS and CFHTLS data}\label{sec:Accuracy and distribution of D4000 estimations with PAUS and CFHTLS data}

Here, the different methods of D4000 measurement presented in the previous section are compared against each other. The D4000 determination from PAUS NB photometry (\cref{sec:Direct estimator}) will simply be referred to as \textit{PAUS direct}, while the D4000 measurements with CIGALE (\cref{sec:CIGALE estimation}) will be referred to as explained in the previous subsection.

\subsection{SNR}\label{sec:SNR}

We have computed both D4000$_{\rm w}$ and D4000$_{\rm n}$ for the sample specified in \cref{sec:Sample selection}, and examined the signal-to-noise ratio (SNR) for each method. \Cref{fig:snr_histogram} displays the SNR distribution for the D4000 measurements with each method (PAUS direct, CIGALE runs and VIPERS spectroscopy), together with the detection threshold we have imposed at $\rm SNR > 3$. This SNR limit has been chosen because it is commonly used in astrophysics as a threshold for source detection in imaging or spectral features, whether it is in the visible spectrum \citep[e.g,][]{Cutri2003, Sanchez2012}, X-ray \citep[e.g.,][]{Bulbul2014} or infrared wavelength range \citep[e.g.,][]{Labbe2013}. The distribution of VIPERS SNR appears as a dashed line; throughout this paper we will use the convention of representing photometric redshifts with solid lines and spectroscopic redshift data with dashed lines.

As shown in \cref{fig:snr_histogram}, the SNR from CIGALE measurements is significantly larger than the one from PAUS direct. The D4000 values from both CIGALE runs have a mean SNR of $\sim$20, being slightly larger for the CFHTLS case. In both CIGALE runs, all objects in the selected sample are well above the detection threshold, while in the PAUS direct case only 85.01\% (65.87\%) of D4000$_{\rm w}$ (D4000$_{\rm n}$) measurements have $\rm SNR > 3$. The mean SNR from the direct method is $\sim$5 for the D4000$_{\rm w}$ and $\sim$4 for the D4000$_{\rm n}$. Regarding the spectroscopic VIPERS D4000, we find a mean SNR of $\sim$35 for the D4000$_{\rm w}$ and $\sim$20 for the D4000$_{\rm n}$. The larger SNR in the D4000$_{\rm w}$ for both methods is simply due to the larger wavelength range of the D4000 bands for the D4000$_{\rm w}$ definition: if flux is integrated over a larger span, higher SNR is to be expected. The CIGALE D4000, however, seems insensitive to this effect, given that it uses all available flux information to fit a model that predicts a D4000 value. This results in a SNR that is closer to spectroscopy for D4000$_{\rm n}$.

It is reasonable to expect a higher SNR from SED fitting than PAUS direct, given that the spectral information provided to CIGALE spans a much larger wavelength window. CIGALE uses all reference broad-bands or PAUS NBs, while in the PAUS direct measurement just the NBs that may contain part of the D4000 bands are taken into account. Moreover, the SED fitting relies on underlying galaxies models, which already places constraints on the possible values of the spectral features, thus constraining the potential dispersion of D4000 values. Nevertheless, these factors alone cannot account for the extreme SNR boost in CIGALE measurements. It is worth noting that CIGALE only uses the observational errors as weights for the $\chi^2$ computation, without propagating them directly into the error budget; the error of the output values (in this case, the D4000) is the standard deviation of the PDF derived from the SED fit \citep{Noll2009}. In other words, the noise levels of the photometric fluxes will determine how much these fluxes are weighted in the fit relative to each other, but do not have a direct relationship to the error of the parameter estimated with CIGALE. Therefore, if the PDF of the fit is concentrated in a small probability volume (either because the models do not properly reproduce the diversity of the sample, or because the $\chi^2$ computation tends over-weight specific input data), the error of the output values will be low, even if the input data is noisy. This may result in an error underestimation, and thus explain the high SNR values; the possibility of an error underestimation due to a limited model grid or unaccounted photometric errors is largely discussed in \citet{Noll2009}. However, any modifications or improvements to the SED-fitting code are out of the scope of this work.

\begin{figure}
 	 \includegraphics[width=\columnwidth]{snr_hist.pdf}
     \caption{SNR distribution for PAUS direct, PAUS CIGALE, CFHTLS CIGALE, and VIPERS spectroscopy. The black vertical line displays the detection threshold of $\rm SNR > 3$. \textit{Upper panel}: D4000$_{\rm w}$. \textit{Lower panel:} D4000$_{\rm n}$.}
     \label{fig:snr_histogram}
\end{figure}

Given the significant percentage of objects with $\rm SNR<3$ in PAUS direct, we have evaluated up to which magnitude PAUS direct allows an individual D4000 measurement of all galaxies above the established SNR threshold ($\rm SNR>3$). In \cref{fig:snr_vs_magnitude}, the percentage of objects with $\rm SNR > 3$ in apparent magnitude bins is shown. Both D4000$_{\rm w}$ and D4000$_{\rm n}$ have $\rm SNR>3$ for almost all objects up to $i_{\rm AB}<21$ (99.88\% and 98.97\% for D4000$_{\rm w}$ and D4000$_{\rm n}$ respectively), with the percentage of objects with measurable D4000 decreasing above this threshold. Consequently, we define a $\rm SNR>3$ D4000 subsample by applying an additional $i_{\rm AB}<21$ cut to the sample defined in \cref{sec:Sample selection}; this leaves a total of 2,534 galaxies. We will refer to this $i_{\rm AB<21}$ sample as \textit{bright sample} henceforth, while the original sample defined in \cref{sec:Sample selection} will be referred to as \textit{full sample}. The advantage of this bright sample is that it preserves PAUS magnitude completeness (which large spectroscopic surveys do not achieve, due to target selection) while ensuring that the PAUS direct individual measurements have high enough SNR. For the bright sample, the average PAUS direct SNR is 11.42 for D4000$_{\rm w}$ and 8.63 for D4000$_{\rm n}$. At $i_{\rm AB}=23$, the magnitude limit for the PAUS catalogue, only $\sim$30\% of the objects have a detectable D4000$_{\rm w}$, while for D4000$_{\rm n}$ this percentage decreases to just $\sim$12\%. Hence, with the narrow-band configuration of PAUS we can achieve D4000 individual measurements with $\rm SNR > 3$ for a magnitude-completeness threshold two magnitudes brighter than the magnitude limit of the full catalogue. It is reasonable to expect similar performance with comparable narrow-band surveys, such as J-PAS \citep{Benitez2014} or S-PLUS \citep{DeOliveira2019}.

\begin{figure}
 	 \includegraphics[width=\columnwidth]{snr_vs_imag.pdf}
     \caption{Percentage of objects with the D4000 directly measurable with PAUS ($\rm SNR > 3$), in bins of apparent magnitude. Solid line represents D4000$_{\rm w}$, dash-dotted line D4000$_{\rm n}$.}
     \label{fig:snr_vs_magnitude}
\end{figure}


The Gaussianity of the errors associated to these D4000 estimations is evaluated in \cref{fig:error_gaussianity} and \cref{tab:error_fits}. There, we display the distribution of the difference between the D4000 estimations and the true value (i.e., VIPERS measurements), divided by the estimated error. If the errors are properly estimated, these histograms should follow Gaussian distributions of $\mu=0$ and $\sigma=1$. Errors from PAUS direct are realistic, as their histograms in \cref{fig:error_gaussianity} have $\sigma\sim1$ (underestimated by $\sim$10\% for D4000$_{\rm w}$ and overestimated by $\sim$5\% for D4000$_{\rm n}$, see \cref{tab:error_fits}). Both CIGALE methods show clear error underestimations, with $\sigma \sim 1.75$ for CFHTLS CIGALE, and $\sigma \sim 1.5$ for PAUS CIGALE, which is akin to a error underestimation of 75\% and 50\% respectively. Hence, the SNR values derived from the CIGALE measurements in \cref{fig:snr_histogram} should be divided at least by a factor equal to their $\sigma$ in \cref{tab:error_fits} to be considered realistic.

Most of the D4000 estimations show negative $\mu$ (see \cref{fig:error_gaussianity} and \cref{tab:error_fits}), which hint to a negative bias in the D4000 measurements. We will explore the bias of the different D4000 measurement methods in more detail later in \cref{fig:scatter_bias}, as these offsets do $\mu$ not necessarily imply a wrong estimation of the error. For now, we can say that these negative $\mu$ values are mostly consistent both with the bias estimation of \cref{sec:Synthetic PAUS tests} and the results shown later in \cref{fig:scatter_bias}. It is worth noting also that the $\mu$ offsets are not direct measurements of the bias, as they may also depend on other of aspects of the error distribution and the Gaussian fit (e.g., the noticeable skewness in the distribution of PAUS direct errors).

\begin{figure}
 	 \includegraphics[width=\columnwidth]{error_gaussianity.pdf}
     \caption{Distribution of the difference between D4000 measurements and VIPERS D4000 values, divided by the estimated error. All distributions are accompanied of their respective Gaussian fit; the solid black line shows a reference Gaussian with $\mu=0$ and $\sigma=1$. \textit{Upper panel}: D4000$_{\rm w}$. \textit{Lower panel:} D4000$_{\rm n}$.}
     \label{fig:error_gaussianity}
\end{figure}

\begin{table}
\centering
	\caption{Parameters of the Gaussian fits to all error distributions displayed in \cref{fig:error_gaussianity}.}
 	\label{tab:error_fits}
 	\begin{tabular}{rrcc}
 		\hline
 		 & & $\mu$ & $\sigma$\\
 		\hline
 		\multirow{2}{*}{PAUS direct} & D4000$_{\rm w}$ & $-0.10\pm0.03$ & $1.10\pm0.02$ \\
 	    & D4000$_{\rm n}$ & $0.06\pm0.02$ & $0.96\pm0.02$\\
 	    \hline   		
 	    \multirow{2}{*}{PAUS CIGALE} & D4000$_{\rm w}$ & $0.38\pm0.02$ & $1.51\pm0.02$ \\
 	    & D4000$_{\rm n}$ & $0.27\pm0.02$ & $1.53\pm0.02$\\
		\hline
  		\multirow{2}{*}{CFHTLS CIGALE} & D4000$_{\rm w}$ & $-0.44\pm0.02$ & $1.72\pm0.02$ \\
 	    & D4000$_{\rm n}$ & $-0.57\pm0.02$ & $1.77\pm0.02$\\
 	    \hline
    \end{tabular}
\end{table}

\subsection{Distribution and bias}\label{sec:Distribution and bias}

Once we have examined the SNR and error of the D4000 estimation methods, we study the distribution of the D4000 values themselves. \Cref{fig:D4000_hist} shows a histogram of D4000 values for each method, and for both the bright and full samples. In addition to this, we have also generated test datasets for PAUS direct, PAUS CIGALE and CFHTLS CIGALE D4000 by taking the VIPERS D4000 values for each object, and adding to them a value drawn from a Gaussian distribution of mean zero and $\sigma$ equal to the error of its respective non-spectroscopic measurement. If the D4000 measurements from these non-spectroscopic methods are unbiased and with an error estimation that behaves like a Gaussian, the D4000 distribution from the test dataset generated by adding these artificial errors to VIPERS D4000 should be the same as the D4000 distribution from its respective non-spectroscopic method. We know from \cref{fig:error_gaussianity} that the error in PAUS direct is reasonably close to Gaussian, and that for the CIGALE methods it is clearly underestimated; these test datasets allow us to check if the differences between the VIPERS D4000 distribution and the non-spectroscopic D4000 distributions can be accounted for solely by the non-spectroscopic error. The test datasets are represented by dashed black lines.

\begin{figure*}
 	 \includegraphics[width=\textwidth]{D4000_hist_both.pdf}
     \caption{Histogram of the D4000$_{\rm w}$ (even rows) and the D4000$_{\rm n}$ (odd rows) for the PAUS direct measurement (left column), PAUS CIGALE (middle column), and CFHTLS CIGALE (right column). The two upper rows correspond to the bright sample, while the two lower rows display the full sample. All panels include the distribution of the VIPERS D4000 (purple dashed line), as well as the distribution of the test dataset generated by adding a Gaussian value of mean zero and $\sigma$ equal to its respective non-spectroscopic error to the VIPERS D4000 values (black dashed line).}
     \label{fig:D4000_hist}
\end{figure*}

The spectroscopic D4000 distributions in \cref{fig:D4000_hist} exhibit a weak bimodality, with a peak centred on the blue cloud around 1.3 and 1.2 for D4000$_{\rm w}$ and D4000$_{\rm n}$, respectively. This blue peak is far stronger for the full sample: as blue galaxies are fainter on average, by imposing the $i_{\rm AB}<21$ cut most of the removed galaxies belong to the blue cloud (the correlation between D4000 and stellar mass will be explored in \cref{sec:D4000 versus stellar mass and SFR}). On the other hand, the red sequence appears as a plateau in the much longer tail of the high D4000 end; a result consistent with the D4000 thresholds used in the literature to separate blue/red galaxies. For example, in \citet{Kauffmann2003b} and \citet{Haines2017} a D4000$_{\rm n}=1.55$ cut is adopted for VIPERS data in $0.5<z<1.0$, and in \citet{Johnston2015} a threshold of D4000$_{\rm n}=1.3$ is used for galaxies at $z\sim3$. Moreover, this bimodality, not only in D4000 distribution \citep[][]{Kauffmann2003a} but also in most of the galaxy parameters, has been extensively demonstrated in the literature \citep[e.g.,][]{Mignoli2008, Davidzon2013, Siudek2017}, and in the case of the D4000 index, it has been shown to become less pronounced as redshift increases \citep[e.g.,][fig. 1]{Haines2017}. Therefore, the weak bimodality in our sample at $z>0.5$ is to be expected.
 
In order to quantify the agreement between the D4000 distribution of the different methods and the VIPERS D4000, we have performed the Epps-Singleton (ES) test \citep{Epps1986} on all cases displayed in \cref{fig:D4000_hist}, comparing the D4000 distributions against the noiseless VIPERS (the original D4000 measurements) and the VIPERS test datasets generated with the non-spectroscopic noise (black lines in \cref{fig:D4000_hist}). The ES test has been chosen instead of other popular alternatives such as the Kolmogorov-Smirnov \citep{Massey1951}, Cramer-von Mises \citep{Anderson1962} or Anderson-Darling \citep{Anderson1952} tests because it was the least dependant on the D4000 range where the empirical distribution function (EDF) was determined. This result is expected, given that the ES test has been specifically developed to provide enough power under a great variability of EDF parameters, such as location, scale or even family of distributions \citep[see][]{Epps1986}, and in our case the tails of the D4000 distribution greatly vary between D4000 methods. For PAUS direct, the tails are significantly larger than VIPERS due the lower SNR, and for both CIGALE estimations the tails end abruptly given the limitations of the SED models (see \cref{fig:D4000_hist}).

The D4000 EDF has been computed in all cases with a uniform binning between $\rm D4000=0.7$ and $\rm D4000=2.5$, with a bin width $\rm \Delta D4000 = 0.02$; this is the same binning of the histograms displayed in \cref{fig:D4000_hist}. The \textit{p}-values of the ES tests are shown in \cref{tab:ES_test_results}; these are the probabilities of the estimated D4000 values coming from the same distribution as the noiseless VIPERS D4000 (or VIPERS D4000 with non-spectroscopic noise, in parentheses).

\begin{table}
\centering
	\caption{\textit{p}-values of the ES test performed for all the D4000 distributions displayed in \cref{fig:D4000_hist}. For each case, the \textit{p}-values from the comparison of the respective D4000 distribution to VIPERS D4000 are shown first. The \textit{p}-values of the comparison to VIPERS D4000 with the respective non-spectroscopic Gaussian noise (black lines in \cref{fig:D4000_hist}) are displayed in parentheses.}
 	\label{tab:ES_test_results}
 	\begin{tabular}{rccc}
 		\hline
 		
   		 & PAUS direct  & PAUS CIGALE & CFHTLS CIGALE\\
 		\hline
 		\multicolumn{4}{l}{Bright sample ($i_{\rm AB}<21$)}\\
 		\hline
        D4000$_{\rm w}$ & 0.50 (0.93) & 0.81 (0.60) & 0.25 (0.09)\\
        D4000$_{\rm n}$ & 0.19 (0.88) & 0.71 (0.35) & 0.10 (0.03)\\
        \hline
 		\multicolumn{4}{l}{Full sample ($i_{\rm AB}<23$)}\\
 		\hline
        D4000$_{\rm w}$ & 0.02 (0.98) & 0.84 (0.58) & 0.55 (0.38)\\
        D4000$_{\rm n}$ & 0.00 (0.99) & 0.52 (0.20) & 0.17 (0.09)\\ 		
        \hline
 	\end{tabular}
\end{table}
 
The distribution of the PAUS direct D4000 (left column in \cref{fig:D4000_hist}) shows the weakest bimodality of all the non-spectroscopic methods, with a much smaller peak in the blue cloud, and a less pronounced difference between the high and low D4000 tails. This effect is caused by the noise in the D4000 measurements, and is far more noticeable for the full sample due to the much lower average SNR. In fact, the \textit{p}-values for the bright sample when compared to VIPERS are far from negligible (up to 0.5 in D4000$_{\rm w}$) while for the full sample they tend to zero. However, for PAUS direct the black line representing the VIPERS D4000 with PAUS direct Gaussian errors shows an excellent agreement (\textit{p}-$\rm value \sim0.9$ and \textit{p}-$\rm value \sim1$ for the bright and full samples respectively), with the only noticeable difference being a shift of the distribution peak of $\sim$0.1 towards lower values. This is consistent to a certain extent with the negative bias of the PAUS direct estimator shown in \cref{sec:Synthetic PAUS tests}. Nevertheless, this similarity between distributions is a clear indicator that the error in PAUS direct is close to Gaussian.

On the other hand, the bimodality displayed by the CIGALE D4000 distributions (centre and right columns in \cref{fig:D4000_hist}) is actually stronger than VIPERS D4000, which may be caused by the model-based methodology limitations. This is especially pronounced in the CFHTLS CIGALE case and for the D4000$_{\rm n}$, with a very sharp maximum at $\sim$1.2, and several smaller peaks at $\rm D4000 > 1.4$. Regarding PAUS CIGALE, this artificial bimodality is much less significant, to the point of having the closest D4000 distribution to noiseless VIPERS in all cases (higher \textit{p}-values, see \cref{tab:ES_test_results}), despite having slightly sharper blue and red peaks. The better behaviour of D4000$_{\rm w}$ with CIGALE may be due to the smaller difference in D4000 values between SED templates due to the larger continuum range, or the larger dependency on dust extinction smoothing this difference. When compared to PAUS direct, the ES test results in only PAUS CIGALE outclassing PAUS direct in the bright sample (\textit{p}-$\rm value \sim 0.75$ vs \textit{p}-$\rm value \sim 0.3$, see \cref{tab:ES_test_results}), but also CFHTLS CIGALE clearly outperforming PAUS direct in the full sample (with a \textit{p}-value up to 0.55 for D4000$_{\rm w}$), due to the low SNR heavily distorting PAUS direct D4000 distribution. However, we note that the \textit{p}-values change significantly when considering non-spectroscopic errors. In this case (black lines in \cref{fig:D4000_hist}), the match between CIGALE D4000 distributions worsens significantly (\textit{p}-$value \sim 0.4$, see \cref{tab:ES_test_results}). If the error in the CIGALE measurements behaved like a Gaussian, it should result in a smoothing of the D4000 distribution, decreasing the observed bimodality (even if the CIGALE error is underestimated, as shown in \cref{tab:error_fits}). Since the bimodality is artificially enhanced by CIGALE, adding the Gaussian errors to VIPERS results in a larger disagreement between distributions. Consequently, when the respective non-spectroscopic errors are added to the VIPERS D4000 distribution, PAUS direct shows the best agreement (\textit{p}-$\rm value \sim 0.95$). Despite the PAUS direct D4000 providing a realistic error estimate consistent with a Gaussian behaviour, and the CIGALE D4000 overestimating its SNR, it is worth noting that CIGALE still provides less dispersion, and will always yield a reasonable D4000 value, regardless of how faint the observed object is. We display the bias of these D4000 estimation methods for the bright sample in \cref{fig:scatter_bias}. This figure is an observational counterpart of \cref{fig:bias_scatter_synth}: each panel displays a scatter plot with the VIPERS D4000 value in the x-axis, and the bias of the respective D4000 estimation method in the y-axis, determined also with \cref{eq:bias_definition}; but this time with the D4000 computed from actual PAUS observations.

\begin{figure*}
 	 \includegraphics[width=\textwidth]{D4000_scatter_bias.pdf}
     \caption{Bias in the D4000 measurements for all objects in the bright sample ($i_{\rm AB}<21$), versus their respective VIPERS D4000 values. Results for PAUS direct in the left column, PAUS CIGALE in the centre column, and CFHTLS CIGALE in the right column. Results for D4000$_{\rm w}$ in the upper row, and D4000$_{\rm n}$ in the lower row. In each panel, the x-axis values are the VIPERS counterpart of the respective D4000 definition. In all panels, the dotted black line represents the median bias of the sample. Legends show the value of this median bias, as well as the parameters of the linear fit.}
     \label{fig:scatter_bias}
\end{figure*}

It is remarkable that all three estimators display similar average trends: a mean negative bias of the order of few percent (except for the PAUS CIGALE D4000$_{\rm w}$), with the linear fit showing a mild negative correlation between the D4000 value and bias. The reason for this negative correlation between D4000 value and bias comes from the low spectral resolution of the photometric data used. Since PAUS NBs have a FWHM of the same order of magnitude as the D4000 bands, the red D4000 band may contain some flux information from the slope of the spectral break itself, which would bias its measured flux towards higher values. The opposite may happen with the blue D4000 band, where including flux from the slope of the spectral break will decrease the measured flux (\cref{fig:D4000_measurement_example} may help better visualising this effect). The result of these two effects is an underestimation of the D4000 that becomes more pronounced as the D4000 value increases (see \cref{eq:D4000_definition}), a trend consistent with the linear fit to the bias displayed in \cref{fig:scatter_bias}. While showing the smaller absolute median bias, PAUS CIGALE has one of the most pronounced slopes for this linear tendency, with CFHTLS CIGALE and specially PAUS direct D4000$_{\rm w}$ showing weaker dependencies between bias and true D4000.

The overall scatter of the bias is much larger than the one presented in \cref{fig:bias_scatter_synth}, mostly due to the observational errors. The PAUS direct D4000 values show the largest scatter by far, e.g., for the D4000$_{\rm w}$, 15.82\% of objects have an absolute bias above 20\%, while for PAUS CIGALE this percentage drops to 2.33\% (and 4.06\% for CFHTLS CIGALE). These percentages of objects with >20\% bias increase by a factor of ~1.5 for D4000$_{\rm n}$. It is worth noting that for PAUS direct these biases are consistent with the error of the D4000 measurement. Regarding the CIGALE D4000 panels, albeit the scatter is much smaller, there is a stronger clustering of data points in a stripe pattern (especially for CFHTLS only), due to the tendency of the SED-fitting methodology to infer specific D4000 values. One possible explanation for these stripes is the finite number of SED templates in the SED-fitting code, with D4000 measurements tending to cluster around the most representative SEDs for red and blue galaxies (explaining also the stronger bimodality).


\section{D4000 and galaxy properties}\label{sec:D4000 and galaxy properties}

Here, we examine how the D4000 measurements vary across different observational parameters. For all the results displayed in this section, we have applied additional cuts to our galaxy sample: all objects with $\rm SNR<3$ in the VIPERS D4000 (either D4000$_{\rm w}$ or D4000$_{\rm n}$) have been removed, as well as spectroscopic outliers. We have considered outliers all objects outside of the range $0.7<\rm VIPERS\, D4000<2.5$, again, for both D4000 definitions. These cuts removed an extra 46 objects from the sample defined in \cref{sec:Sample selection}, resulting in 17,195 galaxies. The same cuts have been applied to the GSWLC-2 low-redshift sample (\cref{sec:GSWLC-2}), resulting in a total of 172,300 galaxies.

\subsection{D4000 versus redshift}\label{sec:D4000 versus redshift}

The first parameter we have considered is redshift: \cref{fig:D4000_vs_z} displays scatter plots of the different D4000 measurements versus redshift, for the full sample. PAUS data (PAUS direct and PAUS CIGALE) have PAUS photo-z in the x-axis; CFHTLS CIGALE uses the CFHTLS photo-z from broad-band data only, and for VIPERS D4000 its respective spec-z is used. In the panels using PAUS photo-z a sharp stripe of data points appears around $z\sim0.7$, but is absent from VIPERS spec-z. This is due to the large horizontal stripes in \cref{fig:z_comparison} around that same redshift. While this is an artefact of the current photo-z computations, it does not affect the average D4000 properties, as it is seen throughout this section. Moreover, such artefacts should be mitigated in future data releases.


\begin{figure*}
 	 \includegraphics[width=\textwidth]{D4000_vs_z_scatter_final.png}
     \caption{D4000$_{\rm w}$ (upper row) and D4000$_{\rm n}$ (lower row) versus redshift for PAUS direct measurement (first column), PAUS CIGALE (second column), CFHTLS CIGALE (third column) and VIPERS D4000 (fourth column). PAUS photo-z used in first and second columns, CFHTLS photo-z in the third column, and VIPERS spec-z in the fourth. The linear fit to each dataset is displayed as a grey or yellow line, depending on the weighting used for the fit (SNR$^{-2}$ or no weighting, respectively). The numerical values of the fit are shown in the legend of each plot. The dot with errorbars in the lower-right corner of each plot represents the median error in the respective D4000 measurement.}
     \label{fig:D4000_vs_z}
\end{figure*}



We have performed linear fits to all datasets to evaluate the average evolution of the D4000 versus redshift; all fits are unweighted except PAUS direct, where a SNR$^{-2}$ weighting has been applied. The reason for this weighting is that the high noise of the PAUS direct D4000 resulted in a linear fit with large error regions, which provided close to no meaningful information about the D4000 evolution. A SNR$^{-2}$ weighting has been chosen instead of $\sigma^{-2}$ to mitigate the dependence of the error with the D4000 value: when weighting objects with different D4000, the SNR is a more accurate estimator of the amount of information per measurement. We have tested this weighting by repeating the SNR$^{-2}$-weighted linear fit on the VIPERS D4000, but using PAUS direct SNR: the resulting linear fit was compatible with its unweighted counterpart (the error regions of the fits fully overlapped). Hence, we can affirm that the SNR$^{-2}$ weighting does not significantly distort the true D4000 evolution vs redshift. It is worth noting that such weighting can not be performed with CIGALE errors, as there is a far more significant dependence of errors vs D4000 (almost an order of magnitude, with errors increasing with D4000 value, reaching a maximum around $\rm D4000\sim1.8$). This error-D4000 correlation in CIGALE D4000 distorts the trend found in the unweighted linear fit.

For all cases, we find a decreasing trend of the D4000 with redshift: for CFHTLS CIGALE (both D4000 definitions) and PAUS direct (D4000$_{\rm w}$ only), these trends are in agreement within 1$\sigma$ with spectroscopy. PAUS direct D4000$_{\rm n}$ is also close to $\sim$1$\sigma$ to the results found in VIPERS, while for PAUS CIGALE the slope of the linear fit is approximately twice as steep as its spectroscopic counterpart (despite PAUS CIGALE mimicking much better the true VIPERS D4000 distribution). The reason for this exaggerated trend in PAUS CIGALE might lie in the smaller wavelength range of PAUS NBs compared to CFHTLS broad bands: at a given redshift, the wavelenght window to perform the SED fitting is smaller, even if the spectral resolution is higher. This may result especially problematic in the edges of our redshift range, where the D4000 bands are close to the wavelenght limits. Moreover, undesired biases at these redshift limits would affect more the slope of the linear fit than at intermediate redshift values.

At higher redshift stellar populations are younger, and thus a decrease of the average D4000 is to be expected, given that it is a proxy for stellar ages. This decreasing trend is widely documented in the literature. In fact, with the same data VIPERS used in this work \citep{Scodeggio2018}, a decreasing trend of D4000$_{\rm w}$ versus redshift can be seen in \citet{Siudek2017}, fig. 7, and \citet{Haines2017}, table 1. Far more examples can be find in the literature: e.g., \citet{Moresco2012} displays the decreasing D4000 dependency on physical parameters vs redshift for early-type galaxies from different surveys in $0.15<z<1.35$ (separated in stellar mass bins), while \citet{Joshi2019} and \citet{Borghi2021} find the same trend in a redshift range similar to this work, for passive galaxies only and for a high-quality sample without any specific galaxy property cuts, respectively. This consistent decreasing trend is a consequence of the D4000 increasing with stellar age, and is noticeable in \cref{fig:D4000_vs_z} despite the selection effects at different redshifts of a magnitude-limited sample.

\subsection{D4000 versus stellar mass and SFR}\label{sec:D4000 versus stellar mass and SFR}

Moreover, we also explore the dependency of the D4000 versus two of the most important galaxy physical properties for the full sample: stellar mass and SFR. For the D4000-stellar mass relation, we have also added as a comparison the low-redshift D4000$_{\rm n}$ spectroscopic data from \citep[][see Sect.~\ref{sec:GSWLC-2}]{Turner2021}. For this analysis, we have separated both our PAUS-VIPERS sample and the GSWLC-2 sample into blue and red galaxies by applying D4000$_{\rm n}=1.55$ cut, with galaxies below and above the cut being blue and red respectively \citep{Kauffmann2003b}. The same criterion is employed in \citet{Haines2017} in the same VIPERS data release \citep{Scodeggio2018}. In \cref{fig:D4000_mdn_vs_sm} the median D4000 values in stellar mass bins are displayed, together with linear fits to the full sample for the VIPERS D4000$_{\rm n}$ and the GSWLC-2 spectroscopic D4000$_{\rm n}$. \cref{fig:D4000_mdn_vs_sfr} displays the D4000-SFR relation in an analogous way, only for our PAUS-VIPERS full sample and without linear fits nor a red/blue separation.

The errorbars of \cref{fig:D4000_mdn_vs_sm,,fig:D4000_mdn_vs_sfr} are the median absolute deviation (MAD) of the D4000 for all objects in its respective bin (delimited by grey vertical lines). The MAD has been multiplied by its respective factor ($\sim$1.4826) so it is comparable to the standard deviation, and has not been divided by the square root of the number of objects per bin, so it accounts for the intrinsic variance of D4000 values inside a bin (therefore, it should remain constant for a number of objects large enough). We have used the median and the MAD to evaluate the dependence of the D4000 due to its insensitivity to outliers; this allows us to evaluate the full selected sample without introducing any cuts that might result in any additional selection effects. The current sample described in \cref{sec:Sample selection} is only limited by the magnitude cut of VIPERS and a colour selection that is negligible at $z>0.6$ \citep{Scodeggio2018}. Introducing a SNR cut to remove the noisiest objects in the PAUS direct D4000 measurements removes mostly blue galaxies and heavily skews the sample towards high D4000 values, given the positive correlation between the D4000 and stellar mass (\cref{fig:D4000_mdn_vs_sm}). Only three measurement methods from our full sample \cref{sec:Sample selection} have been considered: PAUS direct, PAUS CIGALE and VIPERS (following the colour convention of previous figures). CFHTLS CIGALE is not displayed for two reasons: its results are very similar to PAUS CIGALE, and for all the other methods the stellar masses and SFRs used for binning come from the PAUS CIGALE run. We have also generated a test dataset by adding artificial errors drawn from a Gaussian distribution to the VIPERS D4000, as described in \cref{sec:SNR}; however, we have only used as $\sigma$ the errors from PAUS direct measurements.

\begin{figure*}
 	 \includegraphics[width=\textwidth]{D4000_avg_vs_sm_final.pdf}
     \caption{Median D4000 in uniform bins of log $\rm M_{*}$, for PAUS direct measurement (orange errorbars), PAUS CIGALE (cyan) and VIPERS (purple). The low-redshift dataset from GWSLC-2 is also displayed in faint yellow in the lower panel, together with linear fits to the VIPERS and GWSLC-2 D4000$_{\rm n}$ (slopes and average spec-z displayed in the respective legend). The errorbars represent the MAD of the D4000 of sample. The black dotted errorbars in VIPERS show the MAD of the sample after adding to each object a Gaussian error with the same $\sigma$ as its respective PAUS direct measurement (as in \cref{fig:D4000_hist}). The errorbars for each measurement method have been offset in the x-axis for clarity, but in all cases the same binning has been used (as indicated by the grey vertical lines). Upper and lower rows are for D4000$_{\rm w}$ and D4000$_{\rm n}$ respectively, while left and right columns are for blue (spectroscopic D4000$_{\rm n}<1.55$) and red (spectroscopic D4000$_{\rm n}>1.55$) galaxies respectively, according to the criterion specified in \citet{Kauffmann2003b}.}
     \label{fig:D4000_mdn_vs_sm}
\end{figure*}

In the D4000-stellar mass relation (\cref{fig:D4000_mdn_vs_sm}), all our measurement methods show a remarkable agreement for the blue cloud, well within the errorbars of VIPERS D4000 for all stellar mass bins (at even less than $\sim$0.5$\sigma$ for most of them). On the other hand, the PAUS direct (and PAUS CIGALE to a lesser extent) D4000 show a far larger disagreement with VIPERS for the red sequence, with a very significant underestimation of the D4000 for the low-stellar mass bins (yet still within the large errorbars of the test dataset). This significant D4000 underestimation is due to the confluence of several factors: the relatively few red galaxies in the low-mass bins, the mean D4000 bias that starts being negative around $\rm D4000\sim1.5$ for all estimation methods (see \cref{fig:scatter_bias}), and above all, the effect of the D4000$_{\rm n}=1.55$ cut on the D4000 distributions. For red galaxies, this cut significantly affects the D4000 distribution on the low-mass bins (as it is close to the median of the distribution); the error in the D4000 estimation for PAUS direct and PAUS CIGALE "blurs" the cut, thus shifting the median towards lower values. This is less pronounced for high-mass bins as the cut is further away from the median D4000. For blue galaxies, this effect would result in an underestimation of the mean D4000 for high-mass bins, however, even in the higher mass bins the D4000$_{\rm n}$ cut is significantly farther away from the median (and the D4000 distribution is closer to Gaussian), which makes the effect of "blurring" the D4000 cut for PAUS direct and PAUS CIGALE negligible. The MAD of the test dataset (VIPERS with PAUS direct $\sigma$) in \cref{fig:D4000_mdn_vs_sm} is also very similar to the MAD of PAUS direct D4000 for the blue cloud, which reinforces that PAUS direct dispersion is fairly coherent with a Gaussian realisation of the error. 

For red galaxies, however, the PAUS direct D4000 in the lowest-mass bins shows a significantly smaller MAD than the VIPERS test dataset, which is a possible indication of some noise correlation or non-Gaussianity in the error of PAUS direct measurements; this may also partially be the cause of the D4000 underestimation discussed above. On the other hand, the CIGALE D4000 shows in the high-mass end of the red sample a smaller MAD than the VIPERS D4000 by a factor of $\sim$3 on average; a clear sign that, despite correctly determining the average spectral features of a given population, the SED templates may not fully reproduce the actual diversity of the sample. This smaller MAD of PAUS CIGALE is also present, albeit to a smaller extent, in the lower-mass bins of the blue cloud, which may be a sign of the SED-fitting templates not properly reproducing the diversity in the most "extreme" regimes: the bluest and smallest star-forming galaxies, and the largest and most quenched red galaxies.
 
Regarding the dependence of the median D4000 value versus stellar mass, the trend found in \cref{fig:D4000_mdn_vs_sm} is fully consistent with previous results in the literature. The main explanation for  is the downsizing scenario \citep{Cowie1996}, widely tested in the literature: more massive galaxies are assembled first, and thus on average will be older, and thus with higher D4000 values. If we compare the PAUS-VIPERS D4000$_{\rm n}$ with the low-redshift sample, we see that low-redshift galaxies have moved to higher D4000 values at a fixed stellar mass when compared to their higher redshift counterparts. The increase in D4000$_{\rm n}$ at log $\rm M_* / M_\odot\sim10.5$ (D4000$_{\rm n}\sim$0.1) for the blue cloud and the red sequence is similar to the results found in \citet{Haines2017} and \citet{Siudek2017} for blue star-forming and for red passive galaxies respectively. This change with redshift may be caused by the ageing of the stellar populations over 7 Gyr and the downsizing, the steady decline in the specific SFRs of the star-forming main sequence as time passes \citep{Noeske2007, Behroozi2013, Lee2015}.

The D4000-mass relations for both the blue cloud and red sequence in \cref{fig:D4000_mdn_vs_sm} are further evaluated with linear fits for the spectroscopic D4000$_{\rm n}$ of VIPERS and GSWLC-2. For blue galaxies, we find a slope of $\sim$0.155 approximately invariant with redshift, close to the invariant slope of 0.12-0.14 reported in  \citet{Haines2017}. These similar values are especially remarkable, given the different methodologies: we perform a liner fit directly to all our data points, while \citet{Haines2017} fit a Gaussian to the D4000 distribution in each stellar mass bin, and fit a line to the mean values of these Gaussians. This consistency between results proves that narrow-band photometry is an accurate proxy to study downsizing and evolution of blue population through D4000. For red galaxies, however, \citet{Haines2017} finds a slope of $\sim$0.23 for VIPERS; we note that most of this discrepancy comes from the different methodology (as they fit Gaussians to the stellar mass bins, and the red population has a significantly less Gaussian D4000$_{\rm n}$ distribution). Other factors that may account for this disagreement are the additional stellar mass cuts in the low-mass regime of the red population in \citet{Haines2017} (replicating them increases our slope by $\sim$0.02), as well as the narrower redshift range of our selected sample.

Hence, we compare our results in the red sample with \citet{Siudek2017}, which was focused on the evolution of the red passive population from $z\sim1$ to the present day, and computes the linear fit with the same methodology as this work. The D4000$_{\rm n}$-mass relation appears linear with a slope $\sim$0.08 and $\sim$0.12, for VIPERS and GSWLC-2 respectively, while \citet{Siudek2017} finds a slope of $\sim$0.16 for VIPERS at $0.4<z<1$, and $\sim$0.14 for a SDSS sample at $0.15<z<0.25$. This flattening of the slope with time is the opposite trend of what we find here, and is not a consequence of sample selection, since the PAUS galaxy population is a representative sample of the VIPERS galaxy population. The reason for this disagreement in red slopes is the different criteria used to determine red galaxies: in this work we use a D4000$_{\rm n}=1.55$ cut, while in \citet{Siudek2017} a redshift-dependent $U-V$ colour cut \citep{Fritz2014} is employed. In fact, the criterion used to select red passive galaxies may alter significantly the properties of the sample \citep[e.g.,][]{Moresco2012, Trager2000}. For this particular case, if we repeat the linear fit in \cref{fig:D4000_mdn_vs_sm} with the machine-learning classification from \citet{Siudek2018} used in \cref{sec:Galaxy classification}, we obtain a slope of $\sim$0.3 for the VIPERS sample of red galaxies, indicating that machine-learning classification methods may be more suitable than a simple D4000 cut. Therefore, in order to study the properties of the red sequence with narrow-band photometry the high sensitivity of the galaxy properties to the selection criterion must be taken into account, as well as the significant underestimation of the D4000 in the low-mass end.

Regarding the D4000-SFR dependency displayed in \cref{fig:D4000_mdn_vs_sfr}, we find an agreement with spectroscopy within 1$\sigma$, and a the MAD of the test dataset (VIPERS D4000 with PAUS direct noise) is again similar to that of PAUS direct. The only significant caveat that arises is the underestimation of the MAD for PAUS CIGALE D4000 when compared to VIPERS D4000, especially for the very low and highest SFR bins. This is consistent with \cref{fig:D4000_mdn_vs_sm}, and again shows that the SED templates do not properly reproduce the true galaxy diversity in the most quenched and star-forming regimes. Overall, this agreement within estimation methods and the D4000-SFR trend in \cref{fig:D4000_mdn_vs_sfr} is to be expected, as the D4000 itself is a sensitive indicator of the presence (or absence) of young stellar population \citep[e.g.,][]{Kauffmann2003a, Brinchmann2004}, and although a degeneracy with metallicity exists, the negative D4000-SFR relationship is widely documented \citep[e.g.,][]{Brinchmann2004, Salim2007}.

\begin{figure}
 	 \includegraphics[width=\columnwidth]{D4000_avg_vs_sfr.pdf}
     \caption{Median uniform bins of log SFR instead of log $\rm M_{*}$, following the colour code of \cref{fig:D4000_mdn_vs_sm}, but without the GWSLC-2 data nor red/blue classification. Upper panel shows a density histogram in logarithmic scale.}
     \label{fig:D4000_mdn_vs_sfr}
\end{figure}

With the dependency of D4000 with galaxies properties shown in this subsection, and its overall agreement with the literature, we see that narrow-bands surveys show potential to break the incompleteness issue of flux-limited and target-based spectroscopy, especially to study the evolution of the number density of massive blue star-forming galaxies \citep{Haines2017}, although they may also be used for analyzing passive red galaxies if the caveats presented here are taken into account. Moreover, the study of environmental dependence on the statistical significance so far not achievable by spectroscopic surveys (Siudek et al. in prep) could also be performed with narrow-band data. The synergy of wide coverage with accurate measurements of spectral features may open a new insight in the nature vs nurture dilemma \citep[e.g.,][]{DeLucia2012, Davidzon2015}.


\subsection{Galaxy classification}\label{sec:Galaxy classification}

The classification of galaxies into different categories has been one of the main topics of galaxy study ever since the very beginnings of observational cosmology, with the first example being the morphological classification into \textit{early-type} (elliptical) and \textit{late-type} (spiral) galaxies \citep{Hubble1926, DeVaucouleurs1959}. More sophisticated morphological classifications have been developed \citep[e.g.,][]{Strateva2001, Driver2006}, as well as classifications based on other observables: spectral features \citep[e.g.,][]{Kauffmann2003a}, colours \citep[e.g.,][]{Arnouts2013, Taylor2015}, or a combination of them \citep[e.g.,][]{Mignoli2008, Krywult2017}, including the D4000. One defining feature of most of these is the bimodality of their parameters, as it is the case for the D4000 distribution in this work (\cref{fig:D4000_hist}).

It is natural for the simplest classification models to separate galaxies into two different types that mimic the aforementioned bimodality in galaxy parameters. In this subsection, we will evaluate how well a D4000-based classification with the accuracy of the different methods can separate the blue and red galaxy populations, as defined by a fiducial classification. Given that the D4000 has already been used as a classification parameter in the literature \citep[e.g.,][]{Kauffmann2003a, Mignoli2008, Kim2018}, this analysis will assess how well the D4000 determined with PAUS data, either by direct measurement or SED fitting, fares against spectroscopy when classifying galaxies.

The fiducial classification used in this work is presented in \citet{Siudek2018}; it has been carried out over the entire VIPERS data release \citep{Scodeggio2018} with a Fisher Expectation-Maximisation unsupervised algorithm, using as entry parameters 12 different rest-frame magnitudes and spectroscopic redshift. The algorithm distinguishes between 11 different galaxy classes among the data, with an extra class for broad-line AGNs that has been omitted for this work. These classes are defined in order: 1 corresponds to the earliest-type galaxy (reddest), and 11 to the latest type (bluest). For the binary red/blue classification used in this work, we have considered all objects of class 6 and below to be red, and 7 and above to be blue.

This separation between red/blue galaxies is directly tied to their SFRs, with red galaxies being mostly quenched, and blue galaxies having active star-forming regions. Another methodology that allows to evaluate the SFRs of a given galaxy sample is the use of colour diagrams; hence the position in a colour diagram will be related to the galaxy type. In our case, we employ the $NUV-r$ vs $r-K$ diagram \citep[$NUVrK$][]{Arnouts2013}. The $NUV-r$ colour traces specific SFR, given that the flux in the $NUV$ band increases in star-forming regions, and the $r$ band is correlated to old stellar populations \citep{Salim2004}. This colour, however, depends significantly on dust attenuation, so another colour, $r-K$, is used to break this degeneracy \citep{Williams2008}. The result is a diagram where the passive red galaxies tend to cluster on the upper part, and an approximately diagonal cut separates these quiescent galaxies from the star-forming ones on the lower regions of the diagram \citep[e.g.,][]{Arnouts2013, Moutard2018}. In \cref{fig:scatter_classes}, we show the $NUVrK$ colour diagram for the bright sample ($i_{\rm AB}<21$), with the data points colour-coded with their PAUS direct D4000$_{\rm w}$ values, and the $NUV-r$ and $r-K$ colours being extracted from the PAUS CIGALE run. The average positions in the diagram of red and blue galaxies, according to our fiducial classification, is also displayed. The placement of the objects is coherent with the aforementioned references, as well as with the average positions of galaxy classes in the $NUVrK$ colour diagrams in fig. 1 of \citet{Siudek2018}.

\begin{figure}
 	 \includegraphics[width=\columnwidth]{scatter_red-blue.pdf}
     \caption{$NUVrK$ colour diagram for the bright sample, colour-coded with the PAUS direct D4000$_{\rm w}$ (with colour scale limited by the outlier cuts defined for VIPERS D4000). The average positions of the red/blue galaxies from our fiducial classification are also displayed, with their errorbars being their standard deviations.}
     \label{fig:scatter_classes}
\end{figure}

This fiducial galaxy classification is used to test the performance of a single D4000 cut (hereafter D4000$_{\rm cut}$) in order to distinguish between red and blue galaxies, with a galaxy being blue if $\rm D4000 < D4000_{\rm cut}$, and red otherwise. For each one of the four D4000 measurement methods considered (PAUS direct, PAUS CIGALE, CFHTLS CIGALE and VIPERS spectroscopy), we have tested D4000$_{\rm cut}$ values in a physically meaningful range that comprises all but the reddest/bluest galaxies ($1.1<{\rm D4000}_{\rm cut}<1.9$), in order to remove the tails of the distribution, and determined the percentage of galaxies correctly classified as red/blue with each given cut. The results are displayed in \cref{fig:D4000_threshold}. In addition to this figure, \cref{tab:D4000_cut_results} compiles the D4000$_{\rm cut}$ value that maximises the percentage of correctly classified objects for each case, together with its respective percentage of correctly classified objects (in parentheses). In order to check the consistency of these results with the literature, we also evaluate the percentage of correctly classified galaxies using the same cut used in \cref{sec:D4000 versus stellar mass and SFR} of D4000$_{\rm cut}=1.55$ from  \citet{Kauffmann2003b}. This is a value significantly higher than the D4000$_{\rm cut\, n}=1.4$ we find for VIPERS data in the full sample, but still lower than its counterpart for the wide definition, D4000$_{\rm cut\, w}=1.57$. This discrepancy may simply arise from the different classification criteria adopted, but it is remarkable that the difference in D4000$_{\rm cut}$ between classifications is still smaller than the difference we have found in this work between D4000 definitions (i.e., D4000$_{\rm cut\, w}$ and D4000$_{\rm cut\, n}$).


\begin{figure}
 	 \includegraphics[width=\columnwidth]{D4000_threshold.pdf}
     \caption{Percentage of correctly classified objects in the red/blue galaxy sample determined with a given D4000$_{\rm cut}$, using as a fiducial galaxy classification the results of \citet{Siudek2018}. Vertical lines represent the D4000 threshold for maximum percentage for each D4000 measurement method (orange for PAUS direct, cyan for PAUS CIGALE, green for CFHTLS CIGALE, and purple for VIPERS). The standard D4000$_{\rm cut}=1.55$ is also shown as a vertical grey line. Left column shows results for D4000$_{\rm w}$, right column for D4000$_{\rm n}$. Upper row displays the results only for the bright sample ($i_{\rm AB}<21$), while lower row for the full sample.}
     \label{fig:D4000_threshold}
\end{figure}

\begin{table*}
\centering
	\caption{D4000$_{\rm cut}$ that ensures the maximum percentage of correctly classified red/blue galaxies, for all cases represented in \cref{fig:D4000_threshold}. The percentage of correctly classified galaxies with this optimal D4000$_{\rm cut}$ is displayed in parentheses, while the same percentage for the standard D4000$_{\rm cut}=1.55$ is shown in brackets.}
 	\label{tab:D4000_cut_results}
 	\begin{tabular}{rcccc}
 		\hline
 		 & PAUS direct  & PAUS CIGALE & CFHTLS CIGALE & VIPERS\\
 		\hline
 		\multicolumn{5}{l}{Bright sample ($i_{\rm AB}<21$)}\\
 		\hline
 		D4000$_{\rm cut\, w}$ & 1.54 (81.45\%) [80.96\%] & 1.57 (89.86\%) [89.21\%]& 1.45 (92.90\%) [90.68\%] & 1.57 (85.36\%) [84.83\%]\\
 		D4000$_{\rm cut\, n}$ & 1.39 (76.36\%) [70.05\%] & 1.38 (88.99\%) [79.61\%] & 1.24 (92.27\%) [80.09\%] & 1.42 (84.10\%) [78.90\%]\\
  		\hline
 		\multicolumn{5}{l}{Full sample ($i_{\rm AB}<23$)}\\
 		\hline
  		D4000$_{\rm cut\, w}$ & 1.65 (75.67\%) [74.26\%] & 1.58 (90.61\%) [90.13\%] & 1.44 (93.43\%) [91.57\%] & 1.57 (87.20\%) [86.98\%]\\
 		D4000$_{\rm cut\, n}$ & 1.53 (69.13\%) [69.03\%] & 1.38 (89.98\%) [84.75\%] & 1.24 (92.74\%) [82.90\%] & 1.40 (85.13\%) [81.33\%]\\
		\hline
 	\end{tabular}
\end{table*}

In all cases, the PAUS direct D4000 measurement achieves the lowest percentage of correct classification due to its scatter, with at most only 81\% of objects correctly classified (for the bright sample using the D4000$_{\rm w}$). This is also the instance where its effectiveness at classifying becomes closest to VIPERS D4000 (85\%). Using the full sample significantly degrades the percentage of correct classification of the PAUS direct cut, given that there is a significant fraction of objects with $\rm SNR < 3$. This also translates in a flattening of the curve in \cref{fig:D4000_threshold}; in fact, for the D4000$_{\rm n}$ this curve is almost horizontal after the optimal D4000$_{\rm cut}$ value, which shows that varying D4000$_{\rm cut}$ barely has any effect on the reliability of the classification, and thus the correlation between galaxy type and D4000 value is weak.

Regarding the classification results with the CIGALE D4000, both the PAUS and the CFHTLS runs outperform the spectroscopic measurement for VIPERS in their respective optimal D4000$_{\rm cut}$ (at least 90\% and 93\% maximum percentage of correct classification, respectively). This is reasonable, given that the model-driven bimodality/clustering that appears in the CIGALE D4000 values of SED templates (\cref{fig:D4000_hist}). Despite this similar percentage, there is a considerable difference between both CIGALE runs: with CFHTLS only, the optimal D4000 threshold is always the furthest away from the VIPERS optimal cut (and also has the lowest absolute value), while for PAUS, the CIGALE D4000 threshold is always the closest to its spectroscopic counterpart (except for a very slight advantage of PAUS direct for D4000$_{\rm n}$, $i_{\rm AB}<21$). Therefore, using PAUS NBs instead of broad-bands results in much more realistic D4000 estimation for the objects in the intermediate D4000 range, since these are the ones that will determine the optimal red/blue cut.

It is worth noting that, for the case of D4000$_{\rm cut}=1.55$, the difference in the percentage of correctly classified galaxies between the VIPERS D4000 and the CIGALE D4000 measurements is significantly smaller for D4000$_{\rm n}$, which is the D4000 definition used in \citet{Kauffmann2003b} for this specific cut. In the case of the bright sample, the difference in performance between VIPERS and the best CIGALE result (PAUS CIGALE) is just less than 2\% (see \cref{tab:D4000_cut_results}). This result is reasonable: if we use a D4000 cut already defined in the literature for spectroscopic D4000 measurements, the SED-fitting approach of CIGALE does not outperform the VIPERS D4000 nearly as much.

In order to check if these results were consistent with a different criterion for red/blue galaxy classification, we have recomputed the optimal D4000 threshold and its percentage of correctly classified objects, as in \cref{fig:D4000_threshold}, but using as a fiducial classification the spectroscopic VIPERS D4000$_{\rm cut}$ shown in \cref{tab:D4000_cut_results} for the bright sample. The results are largely the same (similar maximum percentage and optimal D4000 thresholds), and thus we can state that the performance of the D4000 estimations for galaxy classification is not largely dependent on the fiducial classification itself.


\section{Conclusions}\label{sec:Conclusions}

In this work, we have carried out the first in-depth study of the direct measurement of the D4000 with narrow-band photometry, using the observational data of PAUS cross-matched with VIPERS \citep{Scodeggio2018} in the CFHTLS W1 field. The results of the D4000 measurement have been compared to its spectroscopic counterpart, as well as the results of the SED-fitting code CIGALE run over the same cross-match, both with broad-band data from CFHTLS and PAUS narrow-band photometry. Both the original definition of the spectral break from \citet{Bruzual1983}: D4000$_{\rm w}$, and the narrower definition from \citet{Balogh1999}: D4000$_{\rm n}$, have been taken into account.

First, we have developed a general estimator for narrow-band photometry, and we have tested it by measuring the D4000 in a synthetic catalogue of PAUS NBs created by integrating the observed VIPERS spectra over the narrow-band response functions. In this noiseless case, we find that over 95\% (92\%) of objects have an absolute bias below 5\% when comparing the D4000$_{\rm w}$ (D4000$_{\rm n}$). We also find similar trends between bias and D4000 value to the preliminary work of \citet{Stothert2018}, but with a significant improvement (e.g., the average bias from the D4000$_{\rm w}$ is reduced by a factor of $\sim$2). When applying this estimator to the real PAUS narrow-band observations, only 85.01\% (D4000$_{\rm w}$) and 65.87\% (D4000$_{\rm n}$) have $\rm SNR > 3$. Moreover, for both D4000 definitions a magnitude cut at $i_{\rm AB}<21$ results in a bright sample where virtually all of the objects have a D4000 measurement with $\rm SNR > 3$. Hence, the PAUS catalogue achieves "D4000-completeness" two magnitudes below the actual magnitude limit. The D4000 results with CIGALE present much higher SNR than the direct PAUS measurements, however, we show that the error that the SED-fitting code returns is underestimated by 50\% for PAUS CIGALE, and 75\% for CFHTLS CIGALE. The bias of these D4000 estimation methods has been evaluated in the bright sample: all of them show a similar trend of a median negative bias of few \%, with PAUS CIGALE having the smallest absolute values. In all cases there is a negative correlation between bias and true D4000 value. For all cases, this linear trend is kept within a range of <10\% for a reasonable D4000 range ($1 < \rm D4000 < 2$).

The D4000 distributions of the different methods have been compared to the VIPERS D4000 using the Epps-Singleton test \citep{Epps1986}, both for the bright sample and the full sample. For all cases, we find better agreement in the D4000$_{\rm w}$ distributions than the D4000$_{\rm n}$. In principle, PAUS CIGALE shows the best agreement (\textit{p}-$\rm value > 0.8$ and \textit{p}-$\rm value > 0.5$ for D4000$_{\rm w}$ and D4000$_{\rm n}$, respectively), while CFHTLS CIGALE has much poorer agreement due to the artificial bimodality. PAUS direct has \textit{p}-$\rm value \sim 0$ for the full sample due to the low SNR, but for the bright sample the D4000 distribution is much closer to VIPERS, especially for D4000$_{\rm w}$ (\textit{p}-$\rm value = 0.5$). However, when we account for the effect of the non-spectroscopic noise in the distributions by adding it to the VIPERS D4000 as Gaussian values, PAUS direct has the best match by far (\textit{p}-$\rm value \sim 0.9$ and \textit{p}-$\rm value \sim 1$ for the bright and full samples, respectively).

The dependency of the D4000 versus redshift, stellar mass and SFR has also been evaluated. For the former, we have computed linear fits to the full sample, and find that the average D4000 decreases as redshift increases \citep[as largely demonstrated in the literature, e.g.,][]{Moresco2012, Joshi2019, Borghi2021}. Despite the low SNR, the linear fit to PAUS direct is fully compatible with the trend found in VIPERS D4000. This is also the case for CFHTLS CIGALE, while PAUS CIGALE overestimates the slope by a factor of $\sim$2. For the D4000-stellar mass relation, we have taken the results of the PAUS CIGALE run to classify all objects in uniform bins, and determined the median and MAD of the D4000 for all the measurement methods. This has been done separately for blue and red galaxies, classified by a cut in D4000$_{\rm n}=1.55$ \citep[][]{Kauffmann2003b}, also with a low-redshift sample with $\langle z \rangle = 0.058$ \citep[GSWLC-2][]{Turner2021}. We find that the D4000 evolution with time at a given stellar mass bin is of the same order of previous results in the literature \citep[][]{Haines2017, Siudek2017}. The agreement between VIPERS and PAUS direct D4000 is excellent for blue star-forming galaxies, while for red passive galaxies the D4000 is consistently underestimated at the low-star mass end. The PAUS CIGALE D4000, although it shows a similar level of agreement with VIPERS, underestimates the sample diversity for low-mass blue galaxies and high-mass red galaxies. Regarding the D4000-SFR dependence, we find an excellent agreement between all measurement methods.

Finally, we have examined the potential of these D4000 measurements for galaxy classification by evaluating how well a given D4000$_{\rm cut}$ value can separate blue/red galaxies, taking as a fiducial classification the results of \citet{Siudek2018}, and determining the D4000$_{\rm cut}$ values which maximise the percentage of correctly classified objects. The D4000 determined by CIGALE outperform even VIPERS spectroscopy in this regard (>90\% of correctly classified objects vs >85\%), while the PAUS direct measurements perform poorly due to the larger scatter (81\% maximum percentage of correct classification for the D4000$_{\rm w}$ and the bright sample). Using PAUS data in the CIGALE run does not improve the classification percentage, but results in a more realistic D4000 red/blue threshold value, much closer to the VIPERS D4000$_{\rm cut}$.

In conclusion, this work shows that narrow-band photometry with PAUS-like spectral resolution ($R\sim65$) can be used to directly measure the D4000 in a model-independent way, and almost all objects two magnitudes below the magnitude limit of the narrow-band catalogue can be reliably measured. For fainter magnitudes, an increasing fraction of objects have too low SNR, but stacking low SNR measurements yields results consistent with spectroscopy. When compared against the results of the SED-fitting code CIGALE, the direct D4000 measurement shows much lower SNR, but a distribution and sample variance consistent with spectroscopic measurements plus a Gaussian error, while the SED-fitting results underestimate the error. Besides, if CFHTLS broad-band photometry instead of PAUS NBs are used for SED-fitting, clear artefacts on the distribution appear, stemming from the SED templates.

This direct measurement of the D4000 opens up several possibilities for narrow-band photometry that may not be available to conventional spectroscopy, such as the study of the radial dependence of this spectral feature by comparing the D4000 measurements at different apertures. In addition to the radial D4000 measurement, more conventional studies can be carried out with PAUS D4000 measurements, such as exploring the star formation history of galaxies in the PAUS catalogue by constraining their stellar ages and redshift of formation. The wealth of narrow-band photometric data from PAUS may also be used to further study the relationship between morphology and D4000/galaxy quenching \citep[e.g., see][and the references therein]{Kim2018}, or to analyse the role of the environment in these processes, and thus disentangle the influence of nature vs nurture in galaxy evolution \citep[e.g.,][]{DeLucia2012, Davidzon2015}. SED-fitting techniques can be complementary to these studies, as they reproduce with good accuracy the dependency of the D4000 on other physical parameters (e.g., redshift, stellar mass, or SFR) and provide reasonable estimates even for the fainter objects, but ultimately are not able to reflect the true complexity of the galaxy zoo.


\section*{Acknowledgements}

The PAU Survey is partially supported by MINECO under grants CSD2007-00060, AYA2015-71825,  ESP2017-89838, PGC2018-094773, PGC2018-102021, SEV-2016-0588, SEV-2016-0597, MDM-2015-0509 and Juan de la Cierva fellowship and LACEGAL and EWC Marie Sklodowska-Curie grant No 734374 and no.776247 with ERDF funds from the EU  Horizon 2020 Programme, some of which include ERDF funds from the European Union. IEEC and IFAE are partially funded by the CERCA and Beatriu de Pinos program of the Generalitat de Catalunya. Funding for PAUS has also been provided by Durham University (via the ERC StG DEGAS-259586), ETH Zurich, Leiden University (via ERC StG ADULT-279396 and Netherlands Organisation for Scientific Research (NWO) Vici grant 639.043.512), University College London and from the European Union's Horizon 2020 research and innovation programme under the grant agreement No 776247 EWC. The PAU data center is hosted by the Port d'Informaci\'o Cient\'ifica (PIC), maintained through a collaboration of CIEMAT and IFAE, with additional support from Universitat Aut\`onoma de Barcelona and ERDF. We acknowledge the PIC services department team for their support and fruitful discussions. P.R. and Z.C. are supported by  National Science Foundation of China (grant No. 12073014). The results published have been funded by the European Union's  Horizon 2020 research and innovation programme under the Maria Skłodowska-Curie (grant agreement No 754510), the National Science Centre of Poland (grant UMO-2016/23/N/ST9/02963) and by the Spanish Ministry of Science and Innovation through Juan de la Cierva-formacion program (reference FJC2018-038792-I). AHW is supported by an European Research Council Consolidator Grant (No. 770935).


\section*{Data Availability}

 
The data underlying this article will be shared on reasonable request to the corresponding author.





\bibliographystyle{mnras}
