Type Ia supernovae SNe Ia constitute an historical probe to derive cosmological parameters through the fit of the HubbleLematre diagram i.e. SN Ia distance modulus versus their redshift. In the era of precision cosmology realistic simulation of SNe Ia for any survey entering in an HubbleLematre diagram is a key tool to address observational systematics like Malmquist bias. As the distance modulus of SNe Ia is derived from the fit of their lightcurves a robust simulation framework is required. In this paper we present the performances of the simulation framework skysurvey to reproduce the the Zwicky Transient Facility ZTF SN Ia DR2 covering the first phase of ZTF running from April 2018 up to December 2020. The ZTF SN Ia DR2 sample correspond to almost 3000 classified SNe Ia of cosmological quality. First a targeted simulation of the ZTF SN Ia DR2 was carried on to check the validity of the framework after some fine tuning of the observing conditions and instrument performance. Then a realistic simulation has been run using observing ZTF logs and ZTF SN Ia DR2 selection criteria on simulated lightcurves to demonstrate the ability of the simulation framework to match the ZTF SN Ia DR2 sample. Furthermore a redshift dependency of SALT2 lightcurve parameters stretch and colour was conducted to deduce a volume limited sample i.e. an unbiased SNe Ia sample characterized with zlim leq 0.06. This volume limited sample of about 1000 SNe Ia is unique to carry on new analysis on standardization procedure with a precision never reached those analysis are presented in companion papers.
['Astrophysics - Cosmology and Nongalactic Astrophysics']
ZTF SN Ia DR2 Simulations and volume limited sample
{'ZTF SN Ia DR2: Simulations and volume limited sample': "M. Amenouche 1 ⋆ , M. Smith 2 ⋆⋆ , P. Rosnet 3 ⋆⋆⋆ , M. Rigault 4 , M. Aubert 3 , C. Barjou-Delayre 3 , U. Burgaz 5 , B. Carreres 6 , 7 , G. Dimitriadis 5 , F. Feinstein 6 , L. Galbany 8 , 9 , M. Ginolin 4 , A. Goobar 10 , L. Harvey 5 , Y.-L. Kim 2 , K. Maguire 5 , T.E. Müller-Bravo 8 , 9 , J. Nordin 11 , P. Nugent 12 , 13 , B. Racine 6 , D. Rosselli 6 , N. Regnault 14 , J. Sollerman 12 , J.H. Terwel 5 , A. Townsend 11 , S.L. Groom 16 , S.R. Kulkarni 15 , M. Kasliwal 15 , R.R. Laher 16 , and J. Purdum 16  \n- 1 National Research Council of Canada, Herzberg Astronomy & Astrophysics Research Centre, 5071 West Saanich Road, Victoria, BC V9E 2E7, Canada\n- 2 Department of Physics, Lancaster University, Lancaster, UK, LA14YW\n- 3 Université Clermont Auvergne, CNRS / IN2P3, LPCA, F-63000 Clermont-Ferrand, France\n- 4 Univ Lyon, Univ Claude Bernard Lyon 1, CNRS, IP2I Lyon / IN2P3, UMR 5822, F-69622 Villeurbanne, France\n- 5 School of Physics, Trinity College Dublin, College Green, Dublin 2, Ireland\n- 6 Aix Marseille Université, CNRS / IN2P3, CPPM, Marseille, France\n- 7 Department of Physics, Duke University Durham, NC 27708, USA\n- 8 Institute of Space Sciences (ICE-CSIC), Campus UAB, Carrer de Can Magrans, s / n, E-08193 Barcelona, Spain\n- 9 Institut d'Estudis Espacials de Catalunya (IEEC), 08860 Castelldefels (Barcelona), Spain\n- 10 The Oskar Klein Centre, Department of Physics, AlbaNova, Stockholm University, SE-106 91 Stockholm, Sweden\n- 11 Institut für Physik, Humboldt-Universität zu Berlin, Newtonstr. 15, 12489 Berlin, Germany\n- 12 The Oskar Klein Centre, Department of Astronomy, AlbaNova, Stockholm University, SE-106 91 Stockholm, Sweden Lawrence Berkeley National Laboratory, 1 Cyclotron Road MS 50B-4206, Berkeley, CA, 94720, USA\n- 13 Department of Astronomy, University of California, Berkeley, 501 Campbell Hall, Berkeley, CA 94720, USA\n- 14 LPNHE, CNRS / IN2P3, Sorbonne Université, Université Paris-Cité, Laboratoire de Physique Nucléaire et de Hautes Énergies, 75005 Paris, France\n- 15 Division of Physics, Mathematics, and Astronomy, California Institute of Technology, Pasadena, CA 91125, USA\n- 16 IPAC, California Institute of Technology, 1200 E. California Blvd, Pasadena, CA 91125, USA Caltech Optical Observatories, California Institute of Technology, Pasadena, CA 91125, USA", 'ABSTRACT': 'Type Ia supernovae (SNe Ia) constitute an historical probe to derive cosmological parameters through the fit of the Hubble-Lemaître diagram, i.e. SN Ia distance modulus versus their redshift. In the era of precision cosmology, realistic simulation of SNe Ia for any survey entering in an Hubble-Lemaître diagram is a key tool to address observational systematics, like Malmquist bias. As the distance modulus of SNe Ia is derived from the fit of their light-curves, a robust simulation framework is required. In this paper, we present the performances of the simulation framework skysurvey to reproduce the the Zwicky Transient Facility (ZTF) SN Ia DR2 covering the first phase of ZTF running from April 2018 up to December 2020. The ZTF SN Ia DR2 sample correspond to almost 3000 classified SNe Ia of cosmological quality. First, a targeted simulation of the ZTF SN Ia DR2 was carried on to check the validity of the framework after some fine tuning of the observing conditions and instrument performance. Then, a realistic simulation has been run using observing ZTF logs and ZTF SN Ia DR2 selection criteria on simulated light-curves to demonstrate the ability of the simulation framework to match the ZTF SN Ia DR2 sample. Furthermore a redshift dependency of SALT2 light-curve parameters (stretch and colour) was conducted to deduce a volume limited sample, i.e. an unbiased SNe Ia sample, characterized with zlim ≤ 0 . 06. This volume limited sample of about 1000 SNe Ia is unique to carry on new analysis on standardization procedure with a precision never reached (those analysis are presented in companion papers).  \nKey words. ZTF ; Cosmology ; Type Ia Supernovae ; Simulation', '1. Introduction': 'In the past two decades, Type Ia supernovae (SNe Ia) have been used to probe the Universe on cosmological scales, typically up to a redshift z ∼ 1. Early measurements discovered the acceleration of the expansion of the Universe, while the recent stateof-the-art analysis allows to measure the mass density parameter ( Ω m ) within the Λ CDM model with an uncertainty better than  \ntwo percent (Brout et al. 2022). This kind of analysis is based on the cosmological fit of the Hubble-Lemaître diagram, the SN Ia luminosity distance as a function of their redshift.  \nIn current analysis, the SN Ia luminosity distance is determined from the fit of their light-curves in di ff erent photometric bands with a phenomenological model tuned on SN Ia Spectral Energy Distributions (SED). The most common used model is SALT2 (Guy et al. 2007). But for precision cosmology, for instance to reach the two percent level precision in the cosmological parameters, the distance luminosity must be determined with  \na typical accuracy of 0.15 mag, i.e. with a photometric precision of typically 1%.  \nSuch precise measurements can be achieved only by correcting for any instrumental e ff ects, but also for any systematic effect like the Malmquist bias, but not only as discussed in DES cosmological analysis paper (Vincenzi et al. 2024). The way to quantify any bias is to use realistic simulation, i.e. able to reproduce typical light-curves observed by the survey. With a robust simulation framework, high-statistic simulations can be generated to estimate any systematic e ff ect starting from the SNe Ia light-curves that can a ff ect the cosmological results.  \nAt low redshift ( z < 0 . 1) the DES Collaboration has shown that the bias on the SNe Ia distance modulus is limited to 0.05 mag, while at high redshift ( z > 0 . 1) it can reach 0.4 mag (Kessler et al. 2019). To overcome the right distance modulus, in their simulation framework (SNANA software package, Kessler et al. 2009), they include observational e ff ects (sky-noise, zeropoint...) and also detection e ffi ciency determined from fake SNe Ia introduced in real images. This example illustrates how critical it is to accurately determine such bias for cosmological analysis.  \nThe Zwicky Transient Facility (ZTF) is a low redshift survey (Bellm et al. 2019). The necessity to measure with the best precision SN Ia peculiar velocity for bulk-flow analysis or for the measurement of f σ 8 is crucial (Carreres et al. 2023). Beyond pure low redshift analysis, the combination of the unique ZTF SNe Ia sample with high redshift surveys, especially the coming one like LSST (Gris et al. 2023), will also help in constraining better the cosmological parameters in the Hubble fit.  \nThis paper highlights the tools developed by the ZTF Collaboration to simulate SN Ia light-curves in a realistic way by taking into account both the observing strategy and the instrumental limitations. In Sect. 2, the ZTF instrument is introduced as well as the ZTF Cosmology Data Release 2 of SNe Ia (ZTF SN Ia DR2) corresponding to the three first years of observations. Then the simulation framework is described in section 3, while section 4 outlined the methodology developed to test the simulation pipeline. The test of the simulation framework based on the ZTF SN Ia DR2 sample is discussed in section 5, before to conclude.', '2. Data: The Zwicky Transient Facility': 'The Zwicky Transient Facility (ZTF) is a wide field optical survey covering the visible northern sky (Bellm et al. 2019), using the Samuel Oschin 48-inch (1.2-m) Schmidt Telescope at the Palomar observatory (Graham et al. 2019). The ZTF camera, consisting in a mosaic of 16 CCDs, has a field-of-view of 47deg 2 (Dekany et al. 2020), 13.3% of which is lost due to chip gaps and vignetting. The first phase of ZTF, called ZTF-1, with an average nightly cadence of every 2.5 nights in g and r -band, and 5 σ limiting depths of 20.5 mag, started observations in March 2018. All data obtained are processed, using di ff erence imaging techniques by the Infrared Processing and Analysis Center (IPAC, Masci et al. 2019) to estimate observing conditions (e.g. limiting magnitude, atmospheric distortion and zero-point) and detect candidates. This information is then disseminated to the community through alert packets (Patterson et al. 2019). From March 2018 to December 2020, ZTF-1 discovered and classified 4156 supernovæ. A full description of the ZTF-1 observing pattern can be found in Rigault et al. (a).', '2.1. Spectroscopic Follow-up': 'Spectroscopic follow-up for ZTF-1 was lead by the Bright Transient Survey (BTS, Perley et al. 2020; Fremling et al. 2020). This project aimed to produce a magnitude-limited census of extra-galactic transients by classifying all ZTF discoveries with m peak < 18 . 5. Classifications were predominately obtained using the low resolution integral field unit, SEDm (Blagorodnova et al. 2018; Rigault et al. 2019; Kim et al. 2022) with additional time allocated on large facilities (see Fremling et al. 2020 for details) to classify missed or rapidly fading events. From ZTF-1, this project classified 3597 transients 1 , with completeness fractions estimated to 97%, 93% and 75% for objects brighter than 18 mag, 18.5 mag and 19 mag, respectively (see Perley et al. 2020 for selection requirements and details).', '2.2. ZTF SN Ia DR2': 'ZTF-1 has discovered and classified 3628 SNe Ia. This second SNe Ia data release (ZTF SN Ia DR2 detailed in Rigault et al. (a) and Smith et al., called DR2 Throughout in the text), following ZTF SN Ia DR1 presented in Dhawan et al. (2022), includes events discovered and classified from March 2018 to December 2020. About 80% of events in this sample were classified by the BTS survey, with the remaining classifications obtained from public surveys (e.g. Smartt et al. 2015) and individual spectra reported to the Transient Name Server (TNS 2 ). Photometry for this sample is determined using forced-photometry extracted from di ff erence images, created, as part of the IPAC pipeline, by subtracting each science image from a stack of ZTF images taken during survey operations. A full description of the sample, and its photometric characterisation is given in Smith et al., with companion papers on host galaxy properties and standardisation (Ginolin et al. 2024b,a; Popovic et al. 2024) with largescale structure correlations (Ruppin et al. 2024; Aubert et al. 2024), light-curves properties (Rigault et al. 2024; Deckers et al. 2024), spectral properties Johansson et al. and diversity (Burgaz et al. 2024), Dimitriadis et al. with astrophysics Burgaz et al. and cosmological (Carreres et al. 2024; Dhawan et al. 2024) impacts.  \nIn this work, we aim to estimate the completeness for the DR2 in term of redshift defining a volume limited sample.', '3. Simulation Framework': 'To simulate the DR2 sample, we randomly generate samples of SNe Ia, drawn from a realistic model, each with a given redshift (drawn from a model describing the volumetric evolution of the rate of SNe Ia events), and sky position. Each simulated SN Ia is then matched to the true ZTF observing cadence and observing conditions to predict the flux and the associated uncertainty (from which we can deduce the signal-to-noise ratio) that ZTF would have observed at each epoch, and produce simulated light-curves. By applying the selection criteria (accounting for photometric detection, light-curve characterisation and spectroscopic selection) used to define the DR2 sample, we predict the distribution of events in the DR2 sample.  \nTo do this we use a new python package skysurvey 3 (Rigault & Others 2024) developed for any transient survey, but described here for the purpose of ZTF. This  \nues  \nnew simulation framework is an improved (from computing point-of-view) version of simsurvey (Feindt et al. 2019) build in a modular way ( simsurvey has already been applied to model the ZTF survey De et al. 2020; Sagués Carracedo et al. 2021; Magee et al. 2022). It allows to simulate thousands of astronomical targets as they would be observed by a survey. The main scheme is the same as for simsurvey : a targeted transient described by its model convoluted with an instrument cadence characterised by its sky deepness and its transmission filters produce light-curves. A schematic representation of this workflow is given in Fig. 1. The main characteristics of skysurvey are: (i) the coding which fasten the transient generation by about a factor thousand compared to simsurvey and (ii) a modular setup allowing to build any transient model by taking into account all astrophysical inputs as the environmental e ff ects. This approach is consistent with the approach taken by SNANA (Kessler et al. 2009) framework commonly used in most SN cosmology analyses.  \nThis new framework was used to study the DR2 selection and its potential biases. To this end skysurvey can be used to simulate the typical SNe Ia sample observed by ZTF during its first phase by using its observed log file, i.e. between 2018 1 st April to 2020 December 31 st in g, r and i-bands.', '3.1. SN Ia model': 'To simulate an individual object, we first draw a redshift and sky position. To do this, we randomly pick-up a redshift from a non-evolving volumetric rate in the range 0 < z < 0 . 2, based on Planck 2018 (Planck Collaboration et al. 2020a) fiducial cosmology (flat Λ CDM with H 0 = 67 . 66 kms -1 Mpc -1 and Ω m = 0 . 30966), and a sky position (RA, Dec) within the ZTF footprint (Dekany et al. 2020). Skysurvey can be run in two way: (i) by using a defined rate, by the default SN Ia rate is 2 . 35 × 10 -4 Gpc -3 yr -1 (Perley et al. 2020), or (ii) by specifying a number of SNe Ia to simulate.  \nTo generate a SN Ia light-curve, we use the SALT2 timedependent spectral energy distribution model (Guy et al. 2007, 2010). This template parameterizes SNe Ia light curves by three parameters: t 0, the epoch of maximum brightness in B -band, x 1, the light-curve width, and c , the rest-frame colour. To ensure that our light-curves are representative of the overall SNe Ia population, for each event we draw x 1 from the distribution defined in Nicolas et al. (2021) using the parameters determined in Ginolin et al. (2024b) and c from that of Scolnic & Kessler (2016). t 0 is drawn randomly within the ZTF-1 observing time range. To set the apparent peak luminosity in B -band, mB , we generate a peak absolute magnitude of -19 . 3, scattered using a colour independent intrinsic dispersion of σ int = 0 . 1-mag and correct for the luminosity-decline rate and luminosity-colour relations with the nuisance parameters α = 0 . 14 and β = 3 . 15 from (Betoule et al. 2014), via a Tripp relation (Tripp 1998). For each simulated event, we use the sncosmo framework (Barbary et al. 2016), to generate observer-frame light-curves given the above information, and include the e ff ect of the Milky Way (MW) dust by using the extinction maps from Schlegel et al. (1998).', '3.2. Observing Logs': 'To match our generated model with the ZTF-1 survey, we compiled the observing conditions for every ZTF observation by  \nquerying the IPAC database. In particular, for every observation, we retrieve 4 :  \n- -date: mjdobs ,\n- -sky location (observed field within ZTF grid): fieldid ,\n- -ZTF-filter, CCD and readout-channel: fid , ccdid and qid ,\n- -processing status: infobits ,\n- -zero-point magnitude of the observation: magzp ,\n- -5 σ limiting magnitudes of the science image: scimaglim ,\n- -readout channel gain: gain .  \nWe convert the measured limiting magnitude to an e ff ective sky brightness (hereafter referred to as skynoise) using  \nsb = 10 0 . 4 × ( magzp -scimaglim ) 5 . (1)  \nOur logs cover all observations from April, 2018 to December, 2020. A total of 431k exposures are retrieved, of which (37.1%, 55.5%, 7.4%) are in (g, r, i)-band, respectively.', '3.3. Signal-to-Noise Ratio': 'Flux uncertainties on each simulated event have three contributions:  \nσ f = s s 2 b + | f | gain + ( f × σ calib ) 2 , (2)  \nwhere sb is the sky brightness (defined in Eq. (1)), f is the simulated flux, gain ≈ 6 . 2 is the CCD gain and σ calib is the photometric calibration precision (Masci et al. 2019).  \nBefore applying this framework to free simulation, it was first tested on the DR2 targeted SNe Ia to check its validity to reproduce measured light-curves. In order to estimate the accuracy of the simulations, we compare the simulated quantities of the DR2 light-curves to the measured ones. The key quantity used for this purpose is the Signal-to-Noise Ratio (SNR) defined as following:  \nSNR = f σ f , (3)  \nwhere f and σ f are respectively fluxes and their associated uncertainties from Eq. (2). We compute the SNR of every DR2 object at each epoch of its measured and simulated light-curve for each band ( g , r , i ).', '4. Testing the simulation framework': 'In this section, we describe our work to validate the accuracy of skysurvey in reproducing the DR2 light-curves. By taking into account the real-time observing conditions and cadence of ZTF and the observed properties of the objects gathered from the data, we aim to replicate individual objects from the DR2 sample and compare the simulated and measured light-curves. In 4.1, we describe the methodology we followed, in 4.2 we show the comparison of a simulated and measured light-curve for one object of the sample, then in 4.3 we discuss the comparison of the fluxes, their uncertainties and their SNR for the whole sample.  \nFig. 1. Schematic representation of our simulation pipeline. Left: model light-curves are generated and combined with the true ZTF observing conditions to produce simulated light-curves. Selection criteria, matching those used to generate the ZTF SN Ia DR2 sample are then applied to produce a mock ZTF SN Ia DR2 dataset. Right: Comparing our predicted dataset to the ZTF SN Ia DR2 sample, we can estimate completeness and biases.  \n<!-- image -->', '4.1. Methodology': 'To simulate the DR2 sample, we use the observed properties of the sample, i.e the SALT2 (Guy et al. 2007, 2010) fitted parameters of the measured light-curves as skysurvey inputs. The SALT2 parameters of the sample are presented in Rigault et al. (2024). We use t 0, x 1, c and z of every individual object in skysurvey combined to ZTF observing logs to simulate every SN Ia. In order to evaluate the accuracy of our simulations, we compare the fluxes, flux uncertainties and SNR of the simulated and measured light-curves at all epochs for all DR2 objects. Furthermore, to avoid statistical fluctuations, each SN Ia is simulated 10 times, meaning that for the whole DR2 sample, we generated about 30,000 SNe Ia.', '4.2. One example': 'As an example, Fig. 2 shows the measured and simulated lightcurve of ZTF19abgppki, in g (left), r (middle) and i -band (right). The top part of each plot shows a good agreement between the simulated and measured fluxes in every three bands at all epochs. We compute the SNR values of the simulated and measured light-curves and their ratios. The bottom part of each plot in Fig. 2 shows the evolution of the SNR ratios (SNR sim / SNR data ) as a function of time (in mjd ) for the three bands. The crosses represent the median SNR values per observation. We can observe that the SNR ratios stand above 1, especially for low-fluxes at the starting point and in the tail of the light-curves, indicating that the simulated light-curves display higher SNR than the DR2 ones. And as the fluxes seem to match in the upper part of the plots of Fig. 2, it indicates that the simulated uncertainties are not  \nreproducing the measured ones. To get a quantitative idea of the discrepancy, and then the correction to apply in our simulations, a statistical analysis over the full DR2 objects is necessary.', '4.3. Statistical test of skysurvey': 'From the 3628 SNe Ia of the full DR2 sample, we apply the following set of basic cuts on the DR2 light-curves properties from Rigault et al. (a)  \n- -| x 1 | < 3,\n- -c ∈ [ -0 . 2 , 0 . 8],\n- -δ t 0 ≤ 1,\n- -δ x 1 ≤ 1,\n- -δ c ≤ 0 . 1.\n- -probfit > 10 -7 ,\n- -we require data points with a phase ( Φ ) ∈ [ -10 , 40].  \nWe apply additional cuts of good sampling, they can be found in Rigault et al. (a). The phase cut is dictated by the study of DR2 light-curve residuals led by Rigault et al. (2024). The final sample counts 2662 SNe Ia. For the purpose of our study, we will use this sample as our baseline.  \nSo, we simulate 10 times those 2662 SNe Ia with their SALT2 parameters and their redshift as inputs to skysurvey .', '4.3.1. Light-curves comparison': 'To ensure an accurate comparison between the measured and simulated quantities, for every SN Ia we match its measured and simulated light-curve along with the associated observing logs.  \nFig. 2. Top: Simulated (10 times) and measured ZTF19abgppki ( z = 0 . 06096) light-curves in g (left), r (middle) and i (right) bands. Bottom: evolution of the SNR ratio of the simulated light-curves w.r.t. measured data points as a function of time (in mjd ). The crosses show the median of the 10 simulations for the SNR ratio for each observation date.  \n<!-- image -->  \nThe DR2 fluxes and associated uncertainties are extracted from the di ff erence images, based on reference images, as discussed in the Smith et al. companion paper. So, we computed the flux uncertainties following Eq. (2) using skynoise derived from the di ff erence image limiting magnitudes or from the science image limiting magnitudes. The ratio of the simulated uncertainties and the DR2 associated ones ( σ sim /σ data ) are shown in Fig. 3 for g (top), r (middle) and i (bottom) bands: as grey curves for the di ff erence image limiting magnitudes ( di f f maglim ) and as blue curves for the science image limiting magnitudes ( scimaglim ).  \nAt low flux (typically f < 10 4 ), where the skynoise contribution (Eq. (2)) is dominant, we can see that the ratios of the simulated uncertainties computed with skynoise from the di ff erence image limiting magnitude and the DR2 one are systematically above 1, while the ratios of the uncertainties computed from the science limiting magnitude are systematically below 1. Furthermore, departure from 1 is more pronounced with the di ff erence image limiting magnitude, that the limiting magnitude associated to the di ff erence image is not correctly estimated. In the case where the skynoise is estimated using the science image limiting magnitude, the simulated flux uncertainties are under estimated compared to the measured ones, which is expected because the di ff erence image processing add some background noise, but the resulting values are closer. It is a clear indication for the need of a new estimated skynoise in the simulations, in order to accurately replicate the DR2 light-curves. To estimate the new skynoise, we use data points which are at low flux ( f < 5000). We compute the median of the measured and simulated flux uncertainties per flux ranges. By computing the median of the binned measured and simulated uncertainties we obtain the corrective factor for the skynoise. We find that a corrective factor of 1 . 23 for gband, 1 . 17 for r-band and 1 . 20 for i-band are needed to solve the discrepancy between the simulated and measured uncertainties. This means that we need to increase the skynoise level associated to science image to account for the forced photometry output which is applied to the di ff erence images. To obtain the values of the new skynoise, we multiply the skynoise obtained from the science limiting magnitude by the corrective factors we estimated for each of both bands.  \nIn addition, an error-floor uncertainty of 2 . 5%, 3 . 5% and 6% flux level, in respectively g , r and i -bands, is added to the DR2 flux uncertainties Rigault et al. (2024). In order to accurately  \ncompare the DR2 flux uncertainties to the simulated ones, we need to account for this error-floor in the simulation framework.  \nWe simulate back our sample with the correct prescription for the skynoise and the error-floor. The ratio of the newly simulated uncertainties and the measured ones for the sample are shown in the same figure (Fig 3). We compute the median values for the ratios per flux range, they are represented in the same figure by the bigger points. We can notice the data points are scattered around 1, with a bigger scatter at low-flux due to the skynoise dominance in the flux uncertainties. We can also notice that the binned data points are between the ratio of uncertainties computed with the science and di ff erence images limiting magnitudes. The binned ones are compatible with 1 along with their evolution with the flux, indicating that the newly simulated flux uncertainties and the measured ones are in good agreement.  \nAs discussed in Rigault et al. (2024), an error-floor is necessary to account for the Gaussian distribution of light-curve data points w.r.t. SALT2 model along the full fitted phase range [10, 40]. The simulated fluxes were compared to the measured ones by computing the pull = ( fsim -fdata ) /σ data for every points of the 10 simulated light-curves of the full DR2. Fig. 4 shows the pull distribution for the three bands. The full histograms correspond to the pull computed by adding the error-floor, while the open dashed histograms are the pull computed without the error-floor. As light-curve data points are distributed following a 1-sigma Gaussian centered on zero w.r.t. their SALT2 fitted model (see Fig. 1 of Rigault et al. (2024) where σ data -pull = 1) and as the simulated light-curves are generated following a random Gaussian distribution w.r.t. to the SALT2 model (i.e. such as σ sim -pull = 1), we expect for the pull of Fig. 4 a Gaussian distribution centered on zero with a sigma equal to σ pull =  \nq σ 2 data -pull + σ 2 sim -pull = √ 2. This prediction is represented by the solid grey curves on Fig. 4. The comparison between the expected pull and the computed one are in good agreement when taking into account the error-floor (full histograms), while the computed pull distributions are wider when the error-floor is omitted. This result shows that the amount of error-floor of 2 . 5%, 3 . 5% and 6%, respectively in g , r , and i -bands, are necessary for a good matching between simulations and the DR2 data.  \n<!-- image -->  \nFig. 3. Ratio of simulated and DR2 flux uncertainties ( σ sim /σ data ) as a function of data flux in g ( top ), r ( middle ) and i ( bottom ) bands. Small points are comparison between every simulated and observed objects at every phase, while the bigger points are the associated median binned values, both after skynoise correction (see text for details). The blue curves ( scimaglim ) are the binned values obtained from the scienceimage, while the grey curves ( di f f maglim ) are the binned values obtained from the di ff erence-image limiting magnitudes.  \n<!-- image -->', '4.3.2. Signal-to-Noise Ratio comparison': 'We use the newly simulated light-curves, with the prescriptions, from 4.3.1, for the skynoise computed from the science limiting magnitudes with the correcting factors and the error-floor needed in the flux uncertainties. We compute the SNR of the simulated and observed data points at all epochs, following Eq (3). We represent the ratio of the SNR from the simulation and the DR2 as a function of the DR2 one in Fig. 5 for g (top), r (middle) and i (bottom) bands. We compute the median of the SNR ratios per SNR data range, they are represented in the same figure with bigger points. One can notice that the data points display a wide scatter especially at low SNR, due to the skynoise fluctuations, knowing its dominance in the flux uncertainties budget at these SNR values. The scatter is reduced at higher SNR. The binned SNR ratios are consistent with 1 in the three bands for SNR > 5. For the low-SNR ( < 5), the data points are below the detection limit and the SNR ratio is a ff ected by negative fluxes, so the SNR ratio ( sim / data ) = 1 is no more valid. It shows that the simulations framework replicates the fluxes and associated uncertainties of the measured DR2 light-curves at all epochs, across ZTF redshift range.', '4.4. Summary': 'We aimed to simulate the most realistic DR2 SN Ia sample, with all our knowledge of ZTF observations and SN Ia modelling. We use the ZTF true observing strategy and state-of-the-art SN Ia models in skysurvey to replicate the whole DR2 sample. We simulated 2662 SNe Ia, passing the good sampling and the basic cuts and tested multiple configurations of the simulation framework. We replicate the DR2 fluxes, associated uncertainties and  \nFig. 4. Light-curve pulls = (flux sim - flux data ) / σ data for g ( top ), r ( middle ) and i ( bottom ) bands. The full (open dashed) histograms show the pulls with (without) error-floor, while the grey curves correspond to a Gaussian centered on zero and with a sigma equal to √ 2.Fig. 5. SNR ratio of simulated and DR2 as a function of DR2 SNR in g ( top ), r ( middle ) and i ( bottom ) bands. Small points are comparison between every simulated and observed objects at every phase, the bigger points are the associated median binned values.  \n<!-- image -->  \nSNR by using the skynoise computed from the science limiting magnitudes with a corrective factor of 1 . 23 for g-band, 1 . 17 for r-band and 1 . 20 for the i-band. In addition, we account for an error-floor of 2 . 5%, 3 . 5%and 6% of the flux level in respectively g , r and i -band. With these prescriptions, we can accurately sim-  \nulate the ZTF DR2 SNIa light-curves at all epoch for every band ( g , r , i ) up to the redshift limit of the survey z ≈ 0 . 15.', '5. Simulating the ZTF SN Ia DR2 sample': 'Simulations are crucial for correcting biases in the analysis of SNe Ia to infer cosmological quantities. In this section, we present our work on the DR2 selection sample with simulations.', '5.1. ZTF SN Ia DR2 simulation': 'To study selection e ff ects on DR2 sample a high-statistic simulation has been carried on. To avoid limited sample at very low redshift, this simulation was partitioned in redshift bins of 0.005 starting from 0 to 0.15, i.e. by generating 25k SNe Ia in 30 redshift bins. Then a weighting procedure is applied to retrieve the natural power law redshift evolution. SALT2 model is used for generation with a color parameters c drawn from an asymmetric distribution following the model from Scolnic & Kessler (2016) and a stretch parameters x 1 drawn from a bimodal distribution from Nicolas, N. et al. (2021).  \nAll selection cuts applied to the DR2 sample are reproduced to the simulated light-curves. First, the BTS sampling cuts (see section 2.3 of Perley et al. 2020) with the selection function (see Fig. 4 of Perley et al. 2020) are applied to the generated lightcurve data points. Second, the basic DR2 cuts (see table 2 of Rigault et al. (a)) are applied to the fitted light-curves.  \nAll together, the selections cuts allow to reproduce the DR2 redshift distributions as shown in Fig. 6. The natural redshift power law is well decreased by all selection cuts to be able to reproduce DR2 redshift distribution. The matching is not perfect but in very good agreement. Indeed the high-redshift part ( z > 0 . 07) reproduces the drastic reduction due mainly to the selection function up to a factor 100 at z = 0 . 15. In the lowredshift regime, a small bump is seen in DR2 data compared to the smooth simulation especially in the range 0 . 03 < z < 0 . 04. The origin of this bump has not been identified, but it might arise from the "local" large-scale structure of the Universe within the ZTF footprint or an unmodelled population of underluminous SNeIa.  \nSimulated light-curves fitting is conducted as for real data using the SALT2 model. A comparison of the main outputs from SALT2 parameters is shown in Fig. 7: without redshift cut (grey data points and light-blue histogram for simulation) and for z ≤ 0 . 06 (smaller black data points and blue histogram for simulation). The three SALT2 output parameters are, at first order, well reproduced by the simulation, especially for the lowredshift selection z ≤ 0 . 06. We observed clearly the Malmquist bias for faint SNe Ia in the mb = -2 . 5 log 10( x 0) + 10 . 635 distribution (Fig. 7, upper plot): compared to the low-redshift sample ( z ≤ 0 . 06), the full sample shows a steeper distribution at high mb illustrating the selection e ff ect for higher redshift. On the other side, the shape of the stretch ( x 1, Fig. 7, middle plot) and the colour ( c , Fig. 7, lower plot) distributions look the same (at first order) for the full sample and the low-redshift selection. A deeper analysis of the redshift dependence of these distribution is discussed in the next section.  \nTo quantify the ability of the simulation to reproduce DR2 distributions, we computed a sort of chi-square per degree-offreedom defined as  \nχ 2 / nd f = 1 Nbin Nbin X i = 1 ( Ndata , i -Nsim , i ) 2 Ndata , i (4)  \nFig. 6. Comparison of DR2 redshift distribution (black points) with skysurvey simulation in log scale (upper plot) and linear scale (lower plot) from generated SNe Ia distribution (black dotted line) to selected ones (full blue histograms). All simulated distributions (before and after selection cuts) are normalized to the data sample.  \n<!-- image -->  \nTable 1. χ 2 / nd f (with an estimation of its uncertainty) between DR2 and simulation distributions of SALT2 parameters ( mb , x 1 and c ) for the full sample (no z cut) and for the volume limited sample ( z ≤ 0 . 06).  \nwhere Nbin is the number of bins in the compared histograms which plays the role of degree-of-freedom. In this definition, we assume a Gaussian uncertainty for the data counting per bin ( σ data , i = p Ndata , i ) and we neglect the statistical fluctuation of the simulation (the number of simulated SNe Ia passing all selection cuts is 47 times the DR2 dataset). The limits of the histograms are defined by cutting the 0 . 5%of the DR2 left and right tails using the quantile method, i.e. keeping 99% of the bulk of the distributions. For the robustness of the analysis, we varied Nbin from 80 to 100 by step of 1 bin (i.e. 20 χ 2 / nd f calculations for each distribution comparison) and then we computed the mean χ 2 / nd f and evaluated an uncertainty on the mean value.  \nThe results are presented in Table 1 for the three SALT2 parameters ( mb , x 1 and c ) for the full DR2 sample (no z cut) and the lower redshifts part ( z ≤ 0 . 06). For the full data sample, the chi-square per degree-of-freedom ( χ 2 / nd f ) is between 1.4 and 1.7, depending on the SALT2 parameter, meaning that the simulations are not reproducing perfectly the full data-set. The worst agreement is observed for the B-band magnitude ( mB ) parameter. When comparing DR2 and simulated distributions for the lower redshift part ( z ≤ 0 . 06, which corresponds to what we call the volume limited sample, see Sect. 5.2) we observe a small improvement for the mB distribution, a much better matching for the stretch ( x 1) distributions, and a consequent improvement for the colour distribution ( c ) for which the χ 2 / nd f is decreased by 25%. This quantitative comparison shows that the simulation is close to reproduce the main properties of our SN Ia data sample when considering the volume limited sample ( z ≤ 0 . 06) which is described in more detail in the next section.  \nFig. 7. Comparison of DR2 SALT2 parameters (points with error bars) -mb (upper plot), x 1 (middle plot) and c (lower plot) - with skysurvey SNe Ia simulation after light-curves fit (histograms): without redshift cut (grey points and light-blue histogram) and for z ≤ 0 . 06 (smaller black points and blue histogram).  \n<!-- image -->', '5.2. Volume limited sample': 'An analysis of SALT2 parameters as a function of the redshift is necessary to estimate the limited redshift for which SNe Ia are not biased. Fig. 8 shows a comparison between the input stretch (left plot) and colour (right plot) distributions before (grey filled histograms) and after selection cuts (open histograms), as for the ZTF-DR2-Cosmos data, for cumulative redshift ranges sampling the bulk of the full ZTF redshift interval. From those plots it appears that input distributions are well reproduced at very low redshift and start to be distorted when redshift increased beyond 0.05.  \nA volume limited sample can be defined as a data sample for which the input SALT2 distributions are not significantly distorted, meaning that there is no bias in the selected SNe Ia. To quantify the redshift limit of the volume limited sample a Kolmogorov-Smirnov (KS) test has been performed between the input distributions used for generation and the distributions retrieved after all selection cuts applied to simulated sample, as for real data, and as a function of redshift limit ( z < zlim ). The result  \nFig. 8. Comparison of stretch (left plot) and colour (right plot) input distributions before (grey filled histograms) and after all selection cuts (open histogram) for lower redshifts ( z ≤ 0 . 06, open blue histogram) and higher redshifts ( z > 0 . 06, open red histogram).  \n<!-- image -->  \nof the KS test of both stretch and colour parameters is shown in Fig. 9 and compared to the probability limits at 1, 2 and 3 σ . This comparison allows to estimate the redshift limit zlim ≈ 0 . 07 (vertical black dashed line) of a SNe Ia sample with model parameters (here SALT2 stretch and colour) compatible with input model distributions within 3 σ . Indeed, up to this redshift limit the stretch distribution of selected SNe Ia matchs almost perfectly the input distribution, while the colour distribution starts to diverge from the input distribution for a redshift z > 0 . 05.  \nFurthermore, we observe that the KS test behaviour for low redshift (typically z < 0 . 08) is similar when comparing the parameter distributions after selection to the generated input distributions, as well as for true parameter (full lines) than for fitted parameter with SALT2 (dotted lines). This result reinforces the confidence in the fact that the volume limited sample as define before is not biased. We can also note that for higher redshitfs ( z > 0 . 08) the KS test p-value increases for fitted parameters compared to generated ones. This e ff ect can be interpreted by a spreading of stretch and colour distributions with fitted parameters due to the fact that SNe Ia are fainter and then the uncertainty in the estimation of SALT2 parameters in the fitting of light-curves becomes more important. This spreading dilutes the distortion of the distributions after selection w.r.t. to the input ones.  \nThis redshift dependency analysis of the input SALT2 parameters after selection explains the very small and the more consequent disagreement of the stretch and colour distributions, respectively, compared to the ZTF-DR2-Cosmo data integrated in the full redshift range ( z < 0 . 15) as seen in Fig. 7.  \nIn conclusion, the redshift limit zlim ≤ 0 . 06 constitutes a robust estimation to define the volume limited sample of the DR2 dataset, i.e. a sample without any bias when the light-curves are fitted using the SALT2 model.', '6. Toward cosmological analysis': "The simulation framework was tested up to the Hubble-Lemaître diagram. To this end, the distance modulus of the fitted SNe Ia of the high-statistic simulation were computed by assuming the fiducial input parameters for the standardization: µ i = mb , i -( Mb -α x 1 , i + β ci ) for every ( i ) SN Ia with Mb = -19 . 3, α = 0 . 14 and β = 3 . 15. Then the residuals to the fiducial input cosmology (Planck 2018 Planck Collaboration et al. 2020b) were deduced: ∆ µ i = µ i -µ ( zi ), where µ ( zi ) is the theoretical result of the fiducial cosmology for every SN Ia redshift zi .  \nFig. 9. KS test p-value for stretch (orange curve) and colour (red curve) as a function of the redshift limit: full lines show the comparison between generated distributions after w.r.t. before selection, while dashed lines compare distributions of fitted SALT2 parameters after selection w.r.t. to generated distributions before selection.  \n<!-- image -->  \nFig. 10. Hubble-Lemaître diagram residual distribution, assuming no environmental steps, for the DR2 (black points) and the simulation with fitted SALT2 parameters (full histogram) and the generated ones (open histogram).  \n<!-- image -->  \nThe residual distribution is presented in Fig. 10 with a comparison between DR2 data (2624 SNeIa) and simulation with fitted SALT2 parameters (full histogram) as well as generated parameters (open histogram). Firstly, the dispersion of the fitted residual distribution is close to the generated one, indicating that the residual is mainly driven by intrinsic dispersion ( σ int ). Secondly, the fitted simulation reproduces overall the distribution measured from the DR2 dataset ( χ 2 / nd f = 2 . 00), with small discrepancies that we will tackle in the upcoming DR2.5 cosmological data release. The robust agreement between our simulated samples and the DR2 dataset for the volume-limited sample, with χ 2 / nd f = 1 . 81 , 1 . 61 , 1 . 26 , 1 . 23 , 1 . 63 when considering the distribution of z , mB , x 1 , c , ∆ µ respectively, indicates that both the underlying distribution of parameters and selection of events are well understood, laying the foundations for a cosmological analysis.  \nThe DR2 dataset (and other literature samples) have observed significant correlations between the residual luminosity, standardisation parameters and measures of the local environment (Ginolin et al. 2024b,a, e.g.). To ensure that our estimates of the cosmological parameters are unbiased, these must be included in our simulation framework, which must also be updated to match the reprocessed 'scene-model photometry'SMP Lacroix et al. and benchmarked against the widely used software, e.g. SNANA . This work will be released as part of the DR2.5 cosmological analysis, due for release in late 2025.", '7. Conclusion': "In this paper we presented the performance of the simulation framework skysurvey and its advanced version skysurvey - developed for the Zwicky Transient Facility (ZTF) survey. The targeted simulation of the first phase of ZTF, from April 2018 and December 2020, was used to validated the full pipeline. The confrontation to the ZTF SN Ia DR2 sample has shown that neither the science nor the di ff erence images magnitude limit are able to reproduce the measured flux uncertainties. A tuning of the sky-noise with an increasing factor of 1.23, 1.17 and 1.20 for g, r and i-bands, respectively, has been derived to match flux uncertainties when using science image magnitude limit with an additional calibration error of 2.5%, 3.5% and 6% for g, r and ibands. The simulation using realistic SALT2 stretch and colour distribution has shown the ability of the skysurvey package to reproduce the ZTF SN Ia DR2 sample. Finally, a redshift study of SALT2 parameters allowed to identify a volume limited sample, z ≤ 0 . 06, i.e. an unbiased sample of about 1000 SNe Ia. This volume limited sample is unique to perform new studies on SNe Ia and especially analysis to improve their standardization procedure for future cosmological analysis.  \nAcknowledgements. Based on observations obtained with the Samuel Oschin Telescope 48-inch and the 60-inch Telescope at the Palomar Observatory as part of the Zwicky Transient Facility project. ZTF is supported by the National Science Foundation under Grant No. AST-1440341 and a collaboration including Caltech, IPAC, the Weizmann Institute of Science, the Oskar Klein Center at Stockholm University, the University of Maryland, the University of Washington, Deutsches Elektronen-Synchrotron and Humboldt University, Los Alamos National Laboratories, the TANGO Consortium of Taiwan, the University of Wisconsin at Milwaukee, and Lawrence Berkeley National Laboratories. Operations are conducted by COO, IPAC, and UW. The ZTF forced-photometry service was funded under the Heising-Simons Foundation grant #12540303 (PI: Graham). SED Machine is based upon work supported by the National Science Foundation under Grant No. 1106171 This work was supported by the GROWTH project (Kasliwal et al. 2019) funded by the National Science Foundation under Grant No 1545949. This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement n 759194 - USNAC). P.R. acknowledges the support received from the Agence Nationale de la Recherche of the French government through the program ANR21-CE31-0016-03. UB is supported by the H2020 European Research Council grant no. 758638 GD is supported by the H2020 European Research Council grant no. 758638 L.G. acknowledges financial support from AGAUR, CSIC, MCIN and AEI 10.13039 / 501100011033 under projects PID2020-115253GAI00, PIE 20215AT016, CEX2020-001058-M, and 2021-SGR-01270. This work has been supported by the research project grant 'Understanding the Dynamic Universe' funded by the Knut and Alice Wallenberg Foundation under Dnr KAW 2018.0067 and the Vetenskapsrådet, the Swedish Research Council, project 2020-03444 LH is funded by the Irish Research Council under grant number GOIPG / 2020 / 1387 Y.-L.K. has received funding from the Science and Technology Facilities Council [grant number ST / V000713 / 1] KM is supported by the H2020 European Research Council grant no. 758638. T.E.M.B. acknowledges financial support from the Spanish Ministerio de Ciencia e Innovación (MCIN) and the Agencia Estatal de Investigación (AEI) 10.13039 / 501100011033 under the PID2020-115253GA-I00 HOSTFLOWS project, and from Centro Superior de Investigaciones Científicas (CSIC) under the PIE project 20215AT016 and the program Unidad de Excelencia María de Maeztu CEX2020-001058-M. JHT is supported by the H2020 European Research Council grant no. 758638.", 'References': 'Aubert, M., Rosnet, P., Popovic, B., et al. 2024, ZTF SN Ia DR2: Exploring SN Ia properties in the vicinity of under-dense environments  \nBarbary, K., Barclay, T., Biswas, R., et al. 2016, SNCosmo: Python library for supernova cosmology, Astrophysics Source Code Library, record ascl:1611.017  \nBellm, E. C., Kulkarni, S. R., Graham, M. J., et al. 2019, PASP, 131, 018002 Betoule, M., Kessler, R., Guy, J., et al. 2014, Astronomy & Astrophysics, 568, A22  \nBlagorodnova, N., Neill, J. D., Walters, R., et al. 2018, PASP, 130, 035003 Brout, D. et al. 2022, Astrophys. J., 938, 110'}