Optimized cutting off transit algorithm to study stellar rotation from PLATO mission light curves

Measuring the stellar rotation of one of the components in eclipsing binaries (EBs) or planetary systems is a challenge task. The difficulty is mainly due to the complexity of analyzing, in the same light curve, the signal from the stellar rotation mixed with the transit signal of a stellar or substellar companion, like a brown dwarf or planet. There are many methods to correct the long-term trend of the light curve. However, the correction often erases the signal of the stellar rotation from spots crossing the visible stellar disk and other weaker signals like planets. In this work, we present the DiffeRencial flUx Method of cuTting Off biNariES (DRUM TONES) to identify the signal of the binary transits and disentangle it from stellar rotation planet signals. We present our technique with applications to EBs from CoRoT, Kepler, Kepler K2 and TESS missions. We also applied our method to simulated synthetic EB from the PLATO mission. Our method shows good agreement in the determination of stellar rotation periods for few observed targets from last space missions, as well it is naturally useful for future European mission, such as PLAnetary Transits and Oscillations of stars (PLATO).


Introduction
Disentangle the transit signal of a binary or a planet from the stellar signal, for example, is essential to the study of stellar rotation and to better understanding the stellar variability. In this context, especially the rotation of binaries has an impact in many branches of astronomy and, as described by Duchêne and Kraus (2013), is a major point, because at least half of stars are binary systems. A number of studies involving eclipsing binaries (EBs) have been focused on tidal circularization (e.g. Koch and Hrivnak (1981); Duquennoy and Mayor (1991); Meibom and Mathieu (2005); van Eylen et al. (2016)), and deal with the relations between the rotation period and orbital period. Most of the studies involving photometric observations of EBs allow a relative direct measurement of the system's orbital period, and also can be used to characterize the relative radius and luminosity ratios of the pair of stars. While the measurement of the orbital period of EB is relatively easy, the determination of the rotation period of one of the components is a challenge task. This is due to the difficulty to distinguish the transit signals and general trends of the light curve from the signal of spots modulation from the star. These general trends are the sum of instrumental artifacts and systematic trends that are characteristic of each instrument and can cause false positive modulations on the light curve, and an automatic pipeline can interpret this as planet transit or modulation due to spots. For cool stars with external convective zones and spots across the stellar disks, the analysis of the spot modulation present on the light curve can give us the possibility to measure the rotation period of the star Meibom et al., 2011;do Nascimento et al., 2014). However, to access this information we carefully need to manipulate the light curves where all signals components are mixed.
Indeed, despite some advances, there are difficulties inherent to studying rotational modulation in eclipsing binaries and planetary systems. During the last 15 years, we have seen a complete change in the quality and quantity of photometric time-series data and we are facing to a revolution of big data in this field. The satellites MOST (Walker et al., 2003), CoRoT , Kepler (Borucki et al., 2010) and TESS (Ricker et al., 2014) have been dedicated to photometric time-series observations from space and delivered hundreds of thousands public light curves with cadence as low as 1 minute. We went from ∼ 8300 signal-to-noise per 1 minute integration on a m V Sun-like star (∼ 120 ppm for MOST satellite) to ∼ 40 ppm for a m V = 7 Sun-like star (Kepler) with 1 minute exposure (Van Cleve and Caldwell, 2016). TESS is observing the entire sky and plan to deliver 200,000 light curves of bright stars. The PLAnetary Transits and Oscillations of stars (PLATO) (Rauer et al., 2014) will deliver light curves with 25 seconds cadence of an extremely wide field (∼2232 deg 2 ). Accurate use and manipulate this huge quantity of light curves and measure observables could be difficult. The majority of the pipelines used for these missions are based on transit signal cut by modelization of the light curve via Markov chain Monte Carlo (MCMC) (Dey et al., 2015;Prša et al., 2016) and use all the possible combinations of eccentricity, inclination, luminosity ratio and other physical parameters that influence the overall aspect of the light curve. In many cases, as the modelization uses all the light curve signal, the spot modulation sometimes, is suppressed within the removal of the transits from the light curves. Other possibility to subtract the eclipsing binary transit is to detect lower level signals from planets. This refines the orbital period of the binary to better erase the trend of the light curve (Klagyivik et al., 2017), and in this process, rotational modulation signal can also be erased. The characterization of the physical parameters presented in most codes to analyze binary system use an approach that does not enable the separation between spot modulation signal and the signal from the binary transiting system.
The differential method we propose here consists to identifying variations greater than a cutoff threshold in the time computed derivative of the entire light curve (LC). Thus, from that signal with high variations identified we have a new time series that represents the net variation of the curve. This method makes it possible to disentangle the signal from the transits from other generic signals, and to make a separate analysis of both stellar rotation and transit signal components. This method will be beneficial, for example, to PLATO mission (Rauer et al., 2014). This is a space mission from the European Space Agency (ESA) whose science objective is to discover and characterize new extrasolar planets and their host stars. PLATO is Expected to be launched by the end 2026. This mission will focus on finding photometric transit signatures of Earth-like planets orbiting the habitable zone of mainsequence Sun-like stars, however, besides the exoplanetary transits, thousand of eclipsing binaries will be also observed. Thus, this is a preparatory study to measure stellar rotation for stars with companions and to be applied to light curves from CoRoT, Kepler, TESS as well to the PLATO mission (ESA).

Eclipsing binaries light curve
Eclipsing binary systems are typically characterized through some basic physical parameters that affect the shape of its light curve. The orbital period of the system can be identified from the time span between the primary eclipsing signal. The relative radius of each star can be inferred from the relative depth of each transit signal in the light curve, and quantities as eccentricity and inclination can be better constrained when we use both light curve and radial velocity analysis. Mass and radius are commonly represented in units of solar mass (M ) and solar radii (R ). It is expected that the spot modulation, presented on cool stars of detached binary systems, follows the same physics as to our Sun. The regions of increased magnetic activity constrain and cool the encapsulated gas, resulting in a region of lower temperature, and thus given a darker region appearance. These regions cause asymmetries in Fig. 1 Black line represents the raw light curve of CoRoT 102681270 extracted from idoccorot.ias.u-psud.fr. Shaded blue line is the time series originated from the DRUM TONES routine and representing the differential variation of the raw light curve. The inside plot is a zoom of one region and showing in detail the differential curve overlapping the transit signal.
the light curve and, depending on the latitude, size, and duration, give us an indication of the stellar surface rotation. The typical eclipsing binary we are interested in is the low cadence detached system. Such a system gives a typical light curve with some standard features as shown by black line in Figure 1.
Typically this system reaches the main sequence with their stars spinning faster than the orbital rate. As they are close, the tidal force acts in the components and the torques can play a major role than the rotational braking due to magnetic coupling with the stellar wind, and the orbital angular momentum can dominate and control the stellar rotation as described by Massarotti et al. (2008). The tidal interaction allows the systems to reach the state of minimum kinetic energy, through the exchange of angular momentum between the stellar rotation of the components of their orbital motion. In this state, the orbit is circular, the rotation of both stars is synchronized with the orbital motion, and their spin axis is perpendicular to the orbital plane, as described by Zahn (2008). In this case, the standard procedure to characterize a binary system is to complete modelization of the system and then an extraction of the modelized light curve from the original one. In most cases, that procedure ends up erasing weak signals that may contain stellar rotation information from spots (Windemuth et al., 2019).

The DRUM TONES algorithm
The DRUM TONES algorithm (DT) was developed to identify as accurately as possible, the transit times, if any exists. The algorithm identifies the beginning and the end of the eclipses in any given light curve. Technically, the DT identifies where happens the greatest variations of flux in a complete light curve. By estimating the differential of the light curve df /dt, we obtain a new time series that represents the abrupt variation of the light curve. On the other hand, we also compute the variation of each flux point with respect to the latter point and the next point. The variation spectra can be generated by using the equation where ∆F is the new time-series that contains the differential fluxes, n is the length of the time-series and f i is the singular flux value in each index i. If we are dealing with a low cadence EB light curve, the greatest variations on the time series will indicate the beginning and the ending of each eclipse as shown in Figure  2. From Figure 1 we can see the spikes in blue matching the eclipses positions. This allow us to identify the beginning, the middle and the ending of each eclipse. The time-series variation will be characterized as the region that contains the two big spikes, with low variation in the middle. That represents the eclipse regions in time. In our analysis, we can also determine the differential time series to show, in the inflection points, the direction of growth of the function, which gives us mathematically the beginning and ending of the eclipse. As this process identifies all points out of a smooth tendency of the time series, we can also apply a threshold to it and construct a mask to identify the largest variations along with the derivative time series. After that, the threshold mask, originally created on the derivative time-series is then applied to the original light curve. This is different from the sigma-clipping method, which consists in clipping all data-points of the light curve that lie more than a fixed σ, which is, most times, the mean observations error.
By applying the threshold mask to all light curve, we eliminate all transits signals, and we keep discontinuities all over the light curve where all the transit signals should be. These 'gaps' generate false positives periods from Lomb-Scargle as showed by Vio et al. (2013) and VanderPlas (2018). At this stage is important to fill these gaps with points along the transit. By fitting the curve gaps, we can bring back a residual time series, that after some adjustments represent the spot modulation of the EB, as shown in the first panel of Figure 4. At the end of this process we,, have the model of the spot modulation (Model) without the transit signals and other discrepant points. By subtracting the model from the original light curve, we get a new curve that contains all the original signal, but without the spot modulation. And finally, by analyzing the light curve without the transit signals from binaries and/or planets, we can measure the stellar rotation period .

Basic usage
In order to apply the DT code in a controlled experiment of a binary system, we used the 1.6.1 version of the ellc light curve model (Maxted, 2016) to simulate an eclipsing binary light curve with the primary star of the system presenting spots modulation and limb darkening profile. First, we created a spotted star with parameters presented in table 1, then we created the binary Table 1 Physical parameters for M odel synthetic binary system. ldc 1 and ldc 2 are the limb darkening coefficients for a squared law. r1 and r2 are the fraction radius of the primary and secondary star of the synthetic binary system. is the target identification that must be in the same folder as the code time is the array that contains the time of the light curve flux is the array that contains the flux of the light curve err is the array that contains the flux error detrendy is the polynomial degree to be fitted to the residual spot modulation splitfactor is the number of sectors to split the light curve to be processed individually condition1 is the max variation possible at the variation space to be accounted as out of the threshold cadence is the change on the cadence, if this is necessary, 1 means no change, 2 means that the light curve will have now be binned with half of the number of points than before condition2 is the limit on the time-space between discontinuities, (e.g the minimum time to consider a change of quarter of about 90 days) normally is greater than the original cadence system with both stars as spheres and both with the same limb darkening coefficients as a rotating star, also presented in table 1. The final signal is the composition of both light curves. We then applied a typical Gaussian error of about 1 × 10 −3 of the total flux signal. The final simulated light curve is presented in Figure 3. At first glance, we can see that this light curve presents both eclipsing binary and spot modulation signals, however it is not an easy task to disentangle the rotation modulation from the transit signal. The common step from most procedures, starts by the detrend of the spot modulation signal to get out only the binary transit, however, for some applications, it is important to maintaining rotational modulation of the primary component of the binary system. This is the typical example were our algorithm could be applied.
The DT algorithm is not a fully automatic code and needs to be fed with some custom parameters. In order to use it, we need to specify inputs as described in table 2. The DT algorithm is available on the Zenodo Repository 1 (de Almeida et al., 2018) and it is ready to go if the user has installed the Python 3.x and the libraries matplotlib and numpy.

Space Missions applications
Even if our goal was to develop an algorithm to be used along with the PLATO mission, we tested our procedure by analyzing published light curves from the space missions CoRoT, Kepler, Kepler K2, and TESS. These missions produced a rich and large time-series survey with years of time coverage high-quality data. We also generated and used a sample of synthetic light curves for the coming space mission PLATO, simulated with intrinsic noise as described by Samadi et al. (2019). Details about the amplitude of instrumental systematics and accuracy of some used parameters are described in the following sections. The results for the analyzed light curves are presented in table 4. The CoRoT (CNES) mission, launched into a low-Earth polar orbit on 2006 December 27, monitored several thousand stars at once with combined four 2048 x 4096 pixel EEV CCDs. The field of view is a square of 2.8 x 2.8 degrees. CoRoT (Auvergne et al., 2009) was, therefore, the first mission focused on searching for exoplanet transits from space. The CoRoT telescope has a diameter of 27 cm and stored the light curves in 3 bands: red (R), green (G) and blue (B) obtained through the insertion of a low-resolution prism in the light path focus of the telescope. However, these bands do not correspond to the photometric filters and are different for each star (Baudin et al., 2006). When dealing with the CoRoT light curves, we need to specify which color to use or apply the total integration of all colors, defined as white band (W). For each color file or for the white integrated file, a flag corresponding to the quality of the measurement is presented. As the 3 bands are different, we end up with a light curve with a bunch of problems, as for example discontinuities and jumps. CoRoT observed two regions of the sky, one towards the Galactic anticenter (RA2000 =06h50m25s, DEC2000 =-01 42 00) and the other towards the Galactic center (RA2000= 19h23m34s, DEC2000 = 00 27 36 ) (Affer et al., 2012). An eclipsing binary system observed by CoRoT is the star CoRoT 102681270 (2MASS J06431548-0040407). This system has orbital period of 2.987 days, as published Affer et al. (2012). However, probably due to the difficulties described here, these authors have not published the rotation period of the primary component. This object presents a light curve with a strong transit signal and some systematic issues. We applied the DT algorithm in this object, and we were able to disentangle the apparent spot modulation from the transit signature. The top first panel of Figure 5 shows the spot modulation extracted from the original light curve. We can see that, despite this light curve presenting some systematics, the algorithm correctly identified the rotation and the orbital period transit signal. For CoRoT 102681270, the measured rotation period was 7.02 days. As the primary and secondary transits have almost the same depth, aliases in the Lomb-Scargle periodogram get masked and the measure of the orbital period by the peak in the Lomb-Scargle actually reflects half of the real orbital period. CoRoT 102681270 example shows that most likely, despite having done a great job, the authors above mentioned have measured half orbital period aliases for this object and do not reach measurable rotational period value. In Figure 5 we summarize all measurements for CoRoT 102681270. of the light curve. They are SAP (simple aperture photometry) and PDC (pre-search data conditioning). Jenkins et al. (2010) and Fanelli et al. (2011) give an overview of the data processing steps involved in producing both the target pixel files and the light curves. The PDC light curves result from more advanced processing steps designed to remove instrumental artifacts and systematics Stumpe et al., 2012). Thus, the PDC pipeline is primarily ready data for planetary transit searches, as well as to study astrophysical photometric variability from the observed stars. The final version of the Kepler data we used was available directly from the MAST web site and uses the PDC-msMAP pipeline. For a description of systematics, impact and removal process on the Kepler light curves, see e.g., Aigrain et al. (2017). Based on Kepler data Prša et al. (2011) defined these EB systems into five five groups: detached, semi-detached, over-contact, ellipsoidal and uncertain. The catalog provides information about the orbital period, time of the eclipse, classification, galactic longitude and latitude, Kepler magnitude, effective temperature, long and short cadence data. The major problem on the Kepler data was the discontinuity from corrected light curves with the PDC automatic pipeline.

Kepler and K2 Mission
These quarters flux correction add temporal jumps from scheduled observation. Each of these quarters must be considered separately and then appended to create the final composition of the light curve. This is the standard procedure used by Kepler pipeline. Besides that, for statistical reason and complexity, some minor bad features were still left in the public version of the Kepler light curve data set. These unwanted features have to be removed before any analysis, as well as on eclipse signal treatment. Kepler yielded a catalog of eclipsing binary containing 2878 systems mostly identified by the Transit Planet Search (TPS) algorithm . From Kepler catalogue, KIC 6965293 (KOI-6800) is an eclipsing binary of Algol type with orbital period and classification published by Slawson et al. (2011). This object was observed for 18 quarters and presents a strong spot modulation amplitude. We use the long cadence light curve in the second quarter of the PDCsap data product. The top first panel of Figure 6 shows the spot modulation extracted from the original light curve, the second panel shows the binary without the rotation. Panels also show the Lomb-Scargle periodogram and phase diagram results for the rotation and orbital period respectively. The Kepler K2 mission is the extended Kepler mission after one of its wheels fails completely.
Operating the spacecraft in this way made it possible to extend the lifetime of the instrument, however, it produces challenging to reduce light curves due to the spacecraft pointing instability. Nevertheless, Kepler K2 is providing high-quality photometry for bright stars in selected regions of the sky named K2 campaign fields near the ecliptic plane (Howell et al., 2014). Because of the pointing instability of the spacecraft, the resulted light curves are hard to be reduced. This is a perfect experimental situation to use our procedure. There is a variety of algorithm to correct the instrumental noise and recovery the light curve as close to the performance of the original Kepler mission (Luger et al., 2016;Vanderburg and Johnson, 2014). However, most of them also subtract the rotation signal.
EPIC 201408204 (TYC 4930-128-1) is an eclipsing binary with orbital and rotational period published by Maxted and Hutcheon (2018). This is an excellent target to test our algorithm because it has both orbital and rotational periods already determined in the literature. We use the systematic corrected light curve modulation from K2 campaign 1, however the overall light curve still presents some systematic problems. The top first panel of Figure 7 shows the spot modulation extracted from the original light curve, the second panel shows the binary without the rotation modulation. Both panels at the bottom show the Lomb-Scargle and phase results for the rotation and orbital period respectively.

TESS Mission
The Transiting Exoplanet Survey Satellite (TESS) mission (Ricker et al., 2014), launched on April 18, 2018, aboard a SpaceX Falcon 9 rocket, is a 4 camera space telescope with the goal of observing 90% of the sky along two years, and generate light curves for ∼150 million stars with photometric sensitivity of ∼200 ppm (0.02%) for an I C = 10 star (Cousins Iband centered at 786.5 nm). This is enough photometric precision to detect the transits of exoplanets (Huang et al., 2018;Vanderspek et al., 2019;Wang et al., 2019) and enabling stellar astrophysics investigations. TESS light curves will be provided for ∼ 400,000 targets observed at 2 minute cadence. However, for most stars will only be provided as full-frame images (FFI) at 30 minute cadence. The TESS image scale of ∼ 21 "/pix is highly susceptible to crowding, blending, and source confusion. Concerning TESS photometric accuracy, Oelkers and Stassun (2018) show that the pipeline performance does not depend on positions across the field, and only ∼ 2% of stars appear to exhibit residual systematics at the level of ∼ 5ppm. Among many objects observed by TESS CD-64 270 (TIC 349480507) is a published eclipsing binary system (Feinstein et al., 2019) classified as high proper-motion star in SIMBAD astronomical database. It is a relatively bright star with V magnitude of 9.96. As this object is not a primary target in the TESS mission, we extracted from the Full Frame Images (FFIs) and we correct the systematic in the light curve. The top first panel of Figure 8 shows the spot modulation extracted from the original light curve. The second panel shows the binary with the rotation signal removed. The bottom panes show the Lomb-Scargle and phase results for the rotation period of 1.56 day and orbital period of 3.12 days respectively.

PLATO Mission
The accumulated experimental experience with the missions CoRoT, Kepler, Kepler K2, and TESS, gives the motivation to planning a more advanced procedure to be applied for PLATO observations. The PLATO space mission is planned to be launched by 2026/2027 and its goal is to detect and characterize Earth-like exoplanets in the habitable zone (Rauer et al., 2014). Even though the main mission of PLATO is to discover exoplanets, it is also expected to detect 10,000 bright EBs with unprecedented quality. At this preparatory time, until the launch of the mission, we did our implementation based on "The PLATO Solar-like Light-curve Simulator" (Samadi et al., 2019) to generate the systematics of the spacecraft and generate EBs light curves as close as possible to the expected by PLATO. The PLATO mission is far different from CoRoT, Kepler, and TESS in the matter of high-precision photometry. The mission is based on a multi-telescope concept. The 26 cameras compose the instrument, two of them are named âĂĲfastâĂİ cameras and will work at 2.5 seconds of cadence while the remaining 24 are named âĂĲnormalâĂİ cameras and work at 25 seconds of cadence.
To simulate our binary system with PLATO systematics, we use the same procedure as described in subsection 3.1, and described by a Gaussian error. The parameters of the synthetic light curve are presented in table 3. The result light curve is presented in Figure 9. After running the DT algorithm in this simulated PLATO light curve, we were able to retrieve the correct rotational and orbital period of the model and orbital period as shown in Figure 10. All the EBs light curves used in this work are already published and have the orbital period well established. We correctly retrieve all those measured periods. For EPIC 201408204 rotational period, we have measured as published by Maxted and Hutcheon (2018). Table 4 presents all results for the orbital and rotational period for the systems observed with CoRoT, Kepler, Kepler K2 and TESS missions. Table 4 All retrieved quantities from sample EBs. P A orb and P A rot are the orbital and rotational period found in the literature identified as followed: a = Affer et al.

Summary and conclusion
We presented an optimized cutting off transit algorithm to study stellar rotation from space missions (CoRoT, Kepler, TESS and PLATO). We also presented some experiments to show method performance. The DT algorithm was applied in well-know CoRoT, Kepler, Kepler K2, and TESS photometric observed light curves as well as in a synthetic generated light curves expected to PLATO mission (Rauer et al., 2014). We have shown that when we precisely identify the rotation modulation and eliminate it from the light-curve, we better constrain the primary and secondary transit depths and better visually analyze the aliases on the Lomb-Scargle periodogram (see the examples of CoRoT 10268127 and TIC 34948050). From our analysis, we find good agreement with published measurements for the orbital period of four selected systems. We report likely rotational periods modulation for four eclipsing binary systems, where only EPIC 201408204 has been already analyzed by Maxted and Hutcheon (2018). Measure rotation period for eclipsing binary is a relevant task for stellar evolution studies. These stars are fundamental targets to be used as benchmark objects, and allow an unprecedented accuracy in masses and radii of about 2%. Our rotation period measurement for EPIC 201408204 agrees with Maxted and Hutcheon (2018) determination. We validated our algorithm by applying a blind test to controlled synthetic light curves with known parameters. For PLATO, we generated light curves with spots modulation physics as used in ellc and systematic noise as described by Samadi et al. (2019). Our code is easy to be installed and is ready to be used in any machine with Python3.x and with standard libraries. It is an accessible tool to remove binaries transit signals and planets in low cadence observations without detrending the entire light curve.