{'fraction_non_alphanumeric': 0.025826808460909196, 'fraction_numerical': 0.0120369288301975, 'mean_word_length': 4.407582938388626, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 1, '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}}
Timing analysis in microlensing

Timing analysis is a powerful tool used to determine periodic features of physical phenomena. Here we review two applications of timing analysis to gravitational microlensing events. The first one, in particular cases, allows the estimation of the orbital period of binary lenses, which in turn enables the breaking of degeneracies. The second one is a method to measure the rotation period of the lensed star by observing signatures due to stellar spots on its surface.


Introduction
The timing analysis is the study of a repetitive feature of a phenomenon in order to investigate its dynamic properties and infer its period. Timing analysis has always been a key tool for the search and the study of exoplanets. For example, the radial velocity method is based on timing analysis of the velocity profile along the line of sight of the parent star. The transit method relies on the periodic repetition of a same feature, the dimming of the light of a star produced by the passing of a planet over the star's disk. Furthermore, cold and hotspots are generally present on the star surface, and if a starspot is observed in different transits, it is possible to assess the rotation period and velocity of the star, the sky-projected orbital obliquity of the planetary system, and, in some cases, the true orbital obliquity. 1 Small variations from a perfectly periodic behavior give often hints about the presence of perturbations that can reveal new phenomena. For example, the first exoplanets, around the pulsar PSR B1257+12, were discovered through the detection of anomalies in the spin period of the neutron star. 2 It has been proposed [3][4][5] to perform timing analysis of transit times in order to find deviations from the linear ephemeris (TTV, Timing Transit Variations), likely due to the presence of an unknown body, as a moon or a planet. 6 This method has been used, for example, to confirm and characterize the planet Kepler-9 d. 7 Gravitational microlensing is an inefficient method to find new planets with respect to transit and radial velocity methods, as a consequence of its low optical depth, of the order of 10 −7 in the most favorable situations. Yet, this technique, which is in some sense complementary to the other methods, is the only able to detect very distant exoplanets in the Galactic Bulge or outer galaxies 8,9 and leads to a complete characterization of the these systems. Its use brought important discoveries in the field of exoplanets, like the facts that cold Neptunes, 10 free-floating planets, 11 and terrestrial planets in low-mass binaries 12 are more common than previously expected. Differently from most of the other methods to detect exoplanets, microlensing offers generally a single non-repeatable event (except for self-lensing events, like KOI-3278 13 ). Nonetheless, periodic deviations from the standard microlensing amplification curves may give some information on the lensing system or the source star.
We consider here two applications of timing analysis in the context of gravitational microlensing. The first one, discussed in Section 2, allows us to estimate, with some caveats, the orbital period of the binary lens. 14 The second application, outlined in Section 3, is about the determination of rotating period of the source star thanks to the presence of stellar spots on its surface. 15

Rotating Binaries
The discovery of exoplanets by microlensing is made possible by the fact that the presence of a companion of the main lensing object induces deviations from the standard Paczyński curve which characterizes a single lens event. 16 In order to fit the amplification curve due to a binary lens system a number of parameters has to be taken into account. Four parameters are those used to model a single lens event: u 0 , the distance of closest approach between the lens and the source projected in the sky; the time t 0 of closest approach; the Einstein time t E ; the angle θ of the source's trajectory in the plane of the lens. Further parameters are the projected separation s between the lenses, and their mass ratio q = m 2 /m 1 , being m 1 and m 2 the masses of the two lenses. If the background source is not point-like, finite size effects should be taken into account by considering the source radius ρ * as well. Furthermore, if the orbital motion of the lenses is not negligible, six additional parameters are required to model the event: the semi-major axis a (that is related to the lenses sepration s), the orbital eccentricity e, the time of passage at periapsis t p , the inclination angle i between the normal to the lens orbital plane and the line of sight, the orientation ϕ of the orbital plane in the sky, and the orbiting versus (either clockwise or counterclockwise). This is only one of the possible sets of parameters that can be used to describe such events. Furthermore, there are some degeneracies that may add complexity to this scheme. For example, under certain circumstances the caustics resulting from two lenses separated by a projected distance s or 1/s have the same structure, implying that the observed light curves will appear the same. This is the so called close-wide degeneracy that may occur in lensing systems with q ≪ 1, like in planetary systems. 17 The modeling of a microlensing event by binary lenses can be a daunting task, due to the large parameter space to be explored, and could take several CPU hours. One of the most delicate aspects of a fitting procedure, that can speed up the convergence to the best solution, is the choice of good starting values, as close as possible to the true ones. Most of the parameters of a Paczyński curve are often easy to estimate by eye looking to the amplification curve: t E is the timescale of the event, the half-width of the curve is roughly t E ; t 0 is the position of the main peak of the curve; the asymptotic behavior of the amplification A for small values of the distance of closest approach is 18 A ∼ 1/u 0 , so that u 0 can be readily guessed by measuring the amplification of the main peak. It has been argued 19 that also other parameters of a binary lens event can be estimated by eye in some cases, but not all.
We also mention that also the source may be in a binary system, even if binary sources have been seldom recognized in photometric microlensing observations. In this respect, a more efficient method for the detection of their orbital motion is given by astrometric microlensing. 18

Estimating the orbital period
The orbital period P of a binary lensing system is related to its semi-major axis a by the Kepler's third law: Thus, measuring the orbital period P of the lensing system by means of timing analysis, independently from a fit to the microlensing amplification curve, could give a quantity that is important by itself and help in better constraining some of the free parameters of the full fit of the amplification curve. The method we first proposed in Ref. 14 consists in searching for the amplification curve by a single lens that fits best the amplification curve by the binary lens under examination, which shows non-negligible effects of the lens orbital motion. Of course, this method can be applied only when the shape of this curve closely resembles that of a Paczyński curve. The residuals between the two curves present periodic features that allow the estimation of the orbital period of the binary lensing system by using timing analysis. This procedure removes the underlying trend and lets the periodic features of the curve emerge. This is a simple task to perform because the parameters of a Paczyński curve can be easily guessed, as discussed above. Another limitation is that, in order to be able to apply the timing analysis, the orbital period of the lenses should be shorter than the Einstein time of the event, or we must have a long observational window so that the lenses complete at least two orbits during the observations. In addition, care must be used when analyzing the results, because this procedure may give half of the true period, even though the order of magnitude is correctly retrieved.

Simulations of binary lens events
We tested this method by performing simulations of microlensing events involving binary lenses with relevant orbital motion during the event. There are different techniques to calculate the amplification by binary lenses, each one with its advantages and drawbacks. Some of these techniques are: This method is fast, is designed for extended sources, works with any lens configuration and takes into account the limbdarkening effect as well, but can be applied far enough from the caustic (but generally closer than the Witt & Mao method). • Inverse ray shooting: 23, 24 it consists in "shooting" a large number of "photons" from the observer towards the source star and apply the lens equation 16 to compute the deflection by the lenses. This method is accurate and works with extended source and any lens configuration, even when the source crosses the caustic, the locus of the points in the lens plane where the amplification diverges to infinity. On the other hand, this technique is also computationally costly, especially in the case of lens orbital motion.
We adopted a hybrid approach, using all techniques but each one only where necessary, in order to take the best of all methods and speed up calculations. In particular, we decided to use the inverse ray shooting method when the source is close to the caustics, and the hexadecapole method combined with the Witt & Mao amplification a when the source is far enough from the caustic. We address the reader to Ref. 14 for details. Here we present a new simulation of a microlensing with rotating binary lenses. We adopted dimensionless quantities, with lengths expressed in units of the Einstein radius R E and times in units of the Einstein time t E . 14 The source star has radius ρ * = 0.03, limb-darkening coefficient Γ = 0.5, and its projected distance of closest approach to the center of mass of the lenses is u 0 = 0.2. The lenses have mass ratio q = 0.9, their orbit has semi-major axis a = 0.2, eccentricity e = 0, and period P = 0.4. Inclination angle i and rotation φ are both set to 0. The geometry of the system and the results of the simulations are shown in Fig. 1.  Fig. 1. We adopted the standard normalization, suggested by Refs. 26, 27, for which the Lomb-Scargle power p(P ) is in the range [0, 1], standing p(P ) = 0 for no periodicity in the data with period P , and p(P ) = 1 for a "perfect" periodicity with period P .
We then applied the generalized Lomb-Scargle periodogram 27 to the relative residuals shown in Fig. 1, using the LombScargle.jl package b written in Julia language. We found that spurious peaks in the residuals appears within the central part of the event, 14 so we had to remove a small region around t = 0 before actually performing the periodogram. The result of this timing analysis is shown in Fig. 2. The period with the highest peak is P = 0.203, which is half of the simulated orbital period P = 0.4 of the lenses, because the caustic is symmetric 14 (see inset of Fig. 1). In Ref. 14 are presented cases where the caustic is not symmetric and the correct period is found.

Starspots on Rotating Source Star
Many authors suggested to exploit microlensing events in order to study irregularities on the surface of the source star, like cold-and hotspots, either with photometric [28][29][30][31] or polarimetric microlensing observations. 32 This effect is particularly important since the presence of stellar spots on the source may fake planetary features in events that are actually due to a single lens, as occurred in the case of MOA-2010-BLG-523. 33 However, none of the above mentioned works took into account the possibility for the source star and/or the binary lens system to rotate. b The LombScargle.jl package is free and open source, more information about its installation and use can be found at https://github.com/giordano/LombScargle.jl .
We filled this gap in Ref. 15 and showed that also in this case timing analysis could be a powerful tool to get more information on the considered system.

Application of timing analysis
In a manner similar to the one described in Section 2.1, we will show that by applying timing analysis to the residuals of a fit of a "static" curve to an intrinsically periodic curve we can retrieve the rotating period of the lensed star.
In Ref. 15 we performed simulations of microlensing events with single and binary lenses, involving a rotating source and/or rotating lenses. The amplification A s of the spotted star has been calculated as the weighted average of the amplification A( r) over the star disc S, using as weight the surface brightness f ( r) The amplification A( r) is the amplification of a point-like source by either a single or a binary lens, depending on the event. Also in this work we employed a hybrid approach for calculating the amplification by a binary lens, like the one discussed in Section 2.2, using inverse ray shooting when the source is close to the caustic, and Witt & Mao method far enough from the caustic. The surface brightness profile f ( r) is defined as where l( r) is the brightness of the unspotted star, and c is the contrast parameter, that is the ratio between the brightness of the spot and the unspotted surface. The case c > 1 corresponds to hotspots, c < 1 is for coldspots.
Here we present a new simulation of a microlensing event of a rotating star by a static binary lens. The lens system is constituted by two equal mass objects, so their mass ratio is q = 1, and they are at a projected separation of b = 1. The ratio D l /D s between the observer-lens distance D l and observer-source distance D s is equal to 0.5. The source star has rotation period P = 10 d, typical of main-sequence G2 stars observed by Kepler, 34 and its projected radius is ρ * = 0.1. The limb-darkening coefficient adopted in the simulation is Γ = 0.45. We considered both a star with a spot on its surface and a star without any such feature. Starspots can have a variety of sizes, covering up to 22% of the stellar hemisphere. 35 We simulated a coldspot with center on the equator (corresponding to colatitude θ = π/2), contrast c = 0.1, and radius equal to 0.2 ρ * . In Fig. 3 the results of the simulations are shown. We applied the generalized Lomb-Scargle periodogram to the absolute value of the relative residuals shown in Fig. 3, using the fast algorithm 36 provided by the LombScargle.jl package. In Fig. 4 the periodogram is shown. The period with the largest power is P 1 = 10.05 d. Another peak is present at P 2 = 12.97 d, but while the highest peak at P 1 is replicated by a broad peak at the higher harmonic P = 19.44 d, there is no higher harmonic peak for the secondary peak at P 2 , suggesting that the period at P 1 is the real one, which is indeed very close to the rotation period P = 10 d of the source star we used in the simulation. Thus, in this case we showed that the application of the timing analysis to the residuals allows us to measure the rotation period of the source star.

Comments
In this paper we considered two possible applications of timing analysis to gravitational microlensing events. In both cases, the use of this tool enabled us to recover important information about the simulated system. In Section 2 we showed that even applying an inappropriate fitting function to the amplification curve can be useful. We fitted a microlensing event due to a rotating binary with the Paczyński model, with the mere purpose of enhancing the periodic features through a sort of detrending procedure. Using the Lomb-Scargle periodogram with the residuals, we were able to find half of the true orbital period of the binary lensing system with good accuracy. Nevertheless, the knowledge of at least the order of magnitude of the orbital period makes it possible to better constrain some of the free parameters of the real fit to the observed curve.
The presence of spots on the surface of the star induces small deviations from the standard amplification curve. In Section 3 we have been able to get the rotation   Fig. 3. It has the same standard normalization used in for the periodogram in Fig. 2. The simulation spans 64 days, therefore the largest period we consider in the periodogram is 32 days, the half width of the time series. period of the star by measuring the residuals of the amplification of the spotted star relative to the amplification of the unspotted star, and then applying the Lomb-Scargle periodogram on them. The analysis of spot features requires high-precision and high-cadence photometry, because these signatures can last a few hours. The Korean Microlensing Telescope Network (KMTNet) can collect up to 6 data points per hour 37 and could be able to observe starspots features. By using observational parameters of OGLE-III and OGLE-IV campaigns, we estimated in Ref. 15 the number of events with these features to be about 4.7 per year towards the Galactic Bulge.