{'fraction_non_alphanumeric': 0.03750306899091579, 'fraction_numerical': 0.038607905720599064, 'mean_word_length': 4.44188376753507, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
M33 Cepheids from CFHT/MegaCAM survey

In this paper we analyze Sloan g,r,i archival imaging data of M33 taken by Hartman et al. (2006) using Megacam at the Canada-France-Hawaii Telescope. To determine the distance to the M33 galaxy, we performed several analytical steps to identify its Cepheid population. We used the Lomb-Scargle algorithm to find periodicity and visually identified 1989 periodic variable stars. Since Cepheids occupy a specific region of the color-magnitude diagram, to differentiate Cepheids from other variables we used the expected position of the Cepheid instability strip to down-select Cepheids in M33 from other variables. This led to our sample of 1622 variables, the largest Cepheid sample known in M33 to date. We further classified these Cepheids into different subclasses, and used the fundamental mode Cepheids to estimate distance moduli for M33 in different filters: {\mu}= 25.044+/-0.083 mag in the g filter, {\mu}= 24.886+/-0.074 mag in the r filter, and {\mu}= 24.785+/-0.068 mag for the i filter. These results are in agreement with previous results.


INTRODUCTION
In the era of precision cosmology, an instrumental approach to test cosmological models is to compare the Hubble constant determined from different methods, especially from locally and at the early Universe. There has been efforts on both fronts, for example, from the distance ladder methods (Riess et al. (2021) using Cepheids, andFreedman (2021) using TRGB stars), the strong lensing time-delays (Wong et al. 2020), and results from CMB experiments such as Planck (Planck Collaboration et al. 2020). There are various discrepancies among the results, pointing to possible underestimated systematics in the methods themselves or hinting of new physics.
As one of the closest spiral galaxies in the Local Group, M33 provides tremendous leverage to study its stellar content. Its proximity allows us to resolve brighter variable star populations with groundbased telescopes. With a simple geometry and as a face-on galaxy, we can treat all the M33 stars as at the same distance. In addition, M33 is a metal rich environment compared to the Magellanic Clouds and other dwarf galaxies, and can be used to study metallicity influence on the properties of variables (see e.g. Scowcroft et al. 2009).
Previous experiments have revealed tens to hundreds of Cepheids in M33 and used them to derive the distance to M33. Sandage & Carlson (1983) derived a apparent blue distance modulus of 25.35 mag by analyzing blue light curves and periods between 37 and 3 days for 13 Cepheids. Freedman et al. (1991) derived a distance modulus of 24.64 ± 0.09 mag based on BVRI CCD photometry. The DIRECT project used the 1m FLWO telescope and presented 251 Cepheids in M33 (Macri et al. 2001). The Araucaria project ) have presented detailed infrared observations of 26 Cepheids discovered by the DIRECT project with VLT and inferred a distance modulus of 24.62 ± 0.07 mag. Pellerin & Macri (2011) have augmented the DIRECT project with longer time-span with WIYN/ODI observations and presented a sample of 564 Cepheids. Using this sample, they derived a distance modulus of 24.76 ± 0.02 mag after quantifying biases in the photometry due to the crowding effect. In addition, Beaulieu et al. (2006) used archival M33 data from CFHT/MegaCAM and presented a sample of beat Cepheids to study the metallicity gradient of M33. However, the Cepheid distance to M33 remains controversial and provided a smaller distance estimate when compared to other methods. In this work, we perform a detailed study of the Cepheid population in M33 with archival CFHT/MegaCAM data Hartman et al. (2006), and present the largest Cepheid sample up-to-date. This paper is organized as follows: in section 2 we briefly summarize the CFHT/MegaCAM M33 data-set. In section 3 we provide details of our analysis method to identify and classify Cepheids. We compare our sample with previous results in section 4, followed by a conclusion in section 5.

DATA
To investigate the Cepheids in M33, we utilized the archival time-series observations with CFHT by Hartman et al. (2006). An 1-deg 2 region centered at M33 was monitored repeatedly with the wide-imager MegaCAM. Data was taken on 27 nights between 2003 -2005 in three optical filters g, r, and i. Each exposure was ∼ 500 seconds in g and ∼ 600 seconds in r and i, with a median seeing of 0.95",0.85",0.77" in g, r, and i, respectively.
The raw data were reduced with the Elexir pipeline to correct for bias, dark, flat-field, and fringing. Since M33 is a very crowded field, Hartman et al. (2006) deployed the image subtraction method devised by Alard & Lupton (2000) to find variable sources down to the limiting magnitude of individual images. This led to a catalog of more than 36000 point sources with variability within the time-span of the CFHT M33 monitoring program. However, Hartman et al. (2006) did not present further classification or periodicity of these variable sources, so we conduct our own analysis shown in the following section.

ANALYSIS
We started with more than 36000 variable sources from Hartman et al. (2006). To reduce the number of variable sources, we only analyzed sources that showed variability and had light curves in all three filters, reducing the number of variable sources to 23309. To ensure sufficient number of data points in the light curves for a period search, we ruled out the variable sources that had less than 10 data points in each filter, reducing the number of variable sources to 22539. For the variable sources that we did not rule out, we used the fast Lomb-Scargle periodogram algorithm implemented by VanderPlas & Ivezić (2015) to determine the best period in each filter.
With the periods in hand, we then produced phase-folded light curves and visually examined them. We used the shape of the light curve to visually determine whether the variable sources showed reliable periodicity such that we could use them for further analysis. We note there might be a bias to remove noisy light curves with visual inspection, but this approach ensured that all the light curves had reliable periods as vetted by eye. Visual determination led to 1989 variables with periodicity. To determine the best period for each variable source, we calculated the ratio between the periods in the g and r filters, the g and i filters, and the r and i filters. If the ratio was within 20 percent and the period was greater than 1.1, we determined that period was the best period for the corresponding variable source. With the best period, we can start classifying the variable sources as either Cepheids or not.

Fourier Decomposition
Since the CFHT M33 light curves are relatively sparse, a practical way to describe the light curve structure is through Fourier decomposition. A Fourier decomposition of the light curve can be used to characterize the variable source and determine whether it is a Cepheid or other type of variable. The Fourier decomposition can also be used to measure the mean magnitude in each filter, and determine the type of Cepheid. For our Fourier decomposition, we used the equation with x being the modified Julian date divided by the period. We use the Fourier decomposition with N=4 for every variable source and in all three filters. Examples of light curves with Fourier decomposition can be found in Fig. 1.
We can use the coefficients of the Fourier decomposition to determine the mean magnitudes in different filters and calculate the extinction free Wesenheit magnitude as follows.

Wesenheit magnitude
With a given dust extinction law, we can use a combination of magnitudes and colours to derive an extinction free magnitude, so-called the Wesenheit magnitude (see e.g. Madore 1982). We derived the Wesenheit magnitude using the following equation: where m 1 is the mean magnitude a 0 from the Fourier decomposition in one filter, m 2 is the mean magnitude a 0 from another filter, and the color term factor R can be calculated by the equation: With A 1 and A 2 being the reddening factor corresponding with filters m 1 and m 2 . In our case, we used the r and i filters to calculate R. We used the A r and A i values from Schlafly & Finkbeiner (2011). Since the CFHT filters have central wavelength close to DES-r and DES-i, we adopted an A r of 2.176 and A i of 1.595 assuming a Galactic extinction law with R V =3.1. This led to a color term factor of R = 3.75. With the Wesenheit magnitude in hand, we can locate the instability strip region in the color magnitude diagram defined by Wesenheit magnitude from r and i filters vs r-i color. Specifically, we adopted the instability strip region given in Kodric et al. (2013) and adjusted the magnitude boundaries accordingly given the distance  difference between M31 and M33 (see Fig. 2). This led to a sample of 1622 Cepheids. We referenced our cut to the cut used in Kodric et al. (2013). The cut Kodric et al. (2013) used, and so as we did, is relaxed from the Classical Cepheid instability strip so we do not miss Cepheids with poor photometric measurements. In doing so, we were using cuts bluer than the Classical Cepheid instability strip, hence there are type II Cepheids in our sample.

Type Classification
With the Cepheids identified from the color-magnitude diagram in our data set, we further classified Cepheids into different types. To separate the First Overtone type Cepheids from the Fundamental Mode type Cepheids, we visually placed a line short ward in log(Period) from the main PL relation and chose everything above it as being overtones. P < 6.0days and A 21 < −0.498log(P ) + 0.528 We also attempted to use the phase difference as in Kodric et al. (2013) to determine the type II Cepheids but it proved to not be effective for our data set. Since type II Cepheids are known to be less luminous and distribute in a lower luminosity and longer period region on the period-luminosity parameter space, we can visually characterize type II Cepheids using a cut of (see Fig.4): r − band magnitude < −2.29log(P ) + 23.8 With all the Cepheids characterized by type, we have a clean sample of 1,087 FM Cepheids that are suitable for distance estimation. Table 1 shows the methods in each step of our analysis and the numbers of sources in each step.  Hartman et al. (2006); 2. right ascension (J2000) in degrees; 3. declination (J2000) in degrees; 4. period from g-band; 5. period from r-band; 6. period from i-band; 7-9 mean magnitudes in g, r, and i-filters; 10. amplitude ratio from r-band; 11. Wesenheit magnitude from r and i-band; 12. type classification. We only show the first five rows as an example. The full table will be released as online material when the paper is accepted.
Using the FM type Cepheids found in the previous section, we performed a linear fitting and derived the period-luminosity relation in the g, r, i filters and extinction free Wesenheit magnitudes.(see Fig.5). The four slopes and magnitudes obtained from the linear relation can be seen in Table 3 We compared these zero points at period 10 days, where errors in the slope and errors in the zero point are largely decoupled, to the semi-empirical Cepheid period-luminosity relations in Sloan filter systems presented by Ngeow & Kanbur (2007) for the LMC. Ngeow & Kanbur (2007)   a zero points of 14.647±0.045 in g, 14.208±0.034 in r, and in 14.104±0.029 in i. This translates into a difference of 6.551±0.062, 6.393±0.049, 6.292±0.040 mag between our M33 and the LMC zero points in the g, r, and i filters, respectively. Adopting the 2%-level distance estimate of LMC from late-type eclipsing binaries from Pietrzyński et al. (2013), we derived distance moduli µ of 25.044±0.083, 24.886±0.074, and 24.785±0.068 mag in the g, r, and i, respectively from our sample of M33 Cepheids.
With the M33 distance modulus in hand, we compare our results with previous results found by other studies. The first result we compare with is from an eclipsing binary by Bonanos et al. (2006). Bonanos et al. (2006) presented a result of µ= 24.92 ±0.12 mag, using a detached eclipsing binary in M33 to determine the distance modulus. We also compare our results with other methods. For example Liu et al. (2022) used the spectra of blue supergiant stars to determine the distance modulus of M33. They obtained a distance modulus of µ= 24.93 ±0.07 mag. Both of the eclipsing binary and blue supergiant methods are from early type stars and their results of distance estimate are in good agreement. Kim et al. (2002) determined a distance modulus of µ= 24.81 ±0.04 based on the tip of the Red Giant Branch (RGB). The RGB stars are considered from older stellar population and the RGB method also agrees well with results from the early type stars. Ciardullo et al. (2004) used the planetary nebula luminosity function and estimated a distance modulus of µ= 24.86 +0.07 −0.11 .  Yang et al. (2010) obtained a distance modulus of 24.52 ±0.11 using RR Lyrae variables in M33. Kinman et al. (1987) obtained a distance modulus of 24.64 ±0.10 using various types of variable stars. Finally, we compare our results with previous Cepheid studies. Pellerin & Macri (2011) determined a distance modulus of µ= 24.76 ±0.02 mag from a sample of 564 Cepheids. We are in good agreement with the results from Pellerin & Macri (2011). However, our results differ from Gieren et al. (2013), who obtained a distance modulus of 24.62±0.07 mag from 26 Cepheids. Our results also differ from Scowcroft et al. (2009), who derived a distance modulus of 24.53±0.11 from 167 fundamental mode Cepheids with the WIYN telescope. One possible explanation is that both our study and Pellerin & Macri (2011) have engaged a larger sample compared to Scowcroft et al. (2009) and Gieren et al. (2013). This suggest that the result from Scowcroft et al. (2009) and Gieren et al. (2013) might be subject to small number statistics. With our larger Cepheid sample, the Cepheid distance agrees well with other methods with larger distance estimate.
In addition to the distance estimate, we also compare the slope of period-luminosity relation v.s. wavelength of observations, as shown in figure 7. The slopes we acquired agree well with theoretical predictions and the results from other Cepheids in the Milky Way and the Large Magellanic Cloud.  Figure 7. The period-luminosity relation slopes we obtained plotted against the wavelength of the filter that corresponds to the slope (seen in magenta). The other lines are slopes from previous results.

CONCLUSION
We used archived data of M33 variable sources from a CFHT/Megacam survey carried out by Hartman et al. (2006) to study the properties of Cepheids in the M33 galaxy. We started with more than 36,000 variable sources and identified a sample of 1,622 Cepheids from period search, visual classification, and locating the instability strip domain from Wesenheit color cuts. We classified the Cepheids into FM type, FO type, or type II Cepheids using the amplitude ratio and visual classification. With a clean sample of FM type Cepheids, we derived the period-luminosity relations in g, r, i filters, and Wesenheit magnitudes. By comparing with the results from semi-empirical Cepheid period-luminosity relation from LMC in similar filters, we obtain distances to M33 comparable with other distance indicators such as eclipsing binaries, blue super giants, and red giant branch stars. This suggests that discrepancies in distance estimates from previous Cepheid studies might originate from small number statistics.
We thank the reviewer for the insightful comments that improved the manuscript. Samuel Adair is supported by the Akami internship program. This work is supported by JSPS KAKENHI Grant 17K14256.
This work is based on observations obtained with MegaPrime/MegaCam, a joint project of CFHT and CEA/DAPNIA, at the Canada-France-Hawaii Telescope (CFHT) which is operated by the National Research Council (NRC) of Canada, the Institut National des Science de l'Univers of the Centre National de la Recherche Scientifique (CNRS) of France, and the University of Hawaii. The observations at the Canada-France-Hawaii Telescope were performed with care and respect from the summit of Maunakea which is a significant cultural and historic site.