Stellar Flyby Analysis for Spiral Arm Hosts with Gaia DR3

Scattered light imaging studies have detected nearly two dozen spiral arm systems in circumstellar disks, yet the formation mechanisms for most of them are still under debate. Although existing studies can use motion measurements to distinguish leading mechanisms such as planet-disk interaction and disk self-gravity, close-in stellar flybys can induce short-lived spirals and even excite arm-driving planets into highly eccentric orbits. With unprecedented stellar location and proper motion measurements from Gaia DR3, here we study for known spiral arm systems their flyby history with their stellar neighbours by formulating an analytical on-sky flyby framework. For stellar neighbors currently located within 10 pc from the spiral hosts, we restrict the flyby time to be within the past $10^4$ yr and the flyby distance to be within $10$ times the disk extent in scattered light. Among a total of $12570$ neighbors that are identified in Gaia DR3 for $20$ spiral systems, we do not identify credible flyby candidates for isolated systems. Our analysis suggests that close-in recent flyby is not the dominant formation mechanism for isolated spiral systems in scattered light.


Introduction
Existence of substructures in protoplanetary disks, such as gaps, spirals, and cavities, can reveal ongoing planet-disk interaction (e.g., Zhu et al. 2011;Dong et al. 2015;Zhang et al. 2018;Bae et al. 2019;Long et al. 2022).Among these planet-disk interaction features, spiral arms could be driven by young giant planets that formulate the best targets for direct imaging observation and characterization, in the sense that these planets are massive and located far from their central stars (e.g., Dong et al. 2015;Bae et al. 2016Bae et al. , 2018)).Nevertheless, there have been no confirmed planets that drive spirals (e.g., Brittain et al. 2020), making it a necessity to test known spiral arm formation mechanisms on the co-existence of spirals and planets.
For isolated systems, two leading mechanisms can produce spiral arms (Dong et al. 2018): companion-disk interactions (e.g., stars, brown dwarfs, or giant planets), or gravitational instability in massive disks.Given the distinct rotation patterns under these two scenarios, spiral motion measurements can constrain the locations of companions in the companion-disk interaction scenario (Ren et al. 2018;Safonov et al. 2022), and even distinguish the two mechanisms (Ren et al. 2020;Xie et al. 2021), while assuming circular orbits for companions.Based on spiral motion measurements, reported candidates in a couple of systems have been ruled out as the drivers of the observed spiral arms (e.g., Ren et al. 2018;Boccaletti et al. 2021).
Close-in stellar flybys can also trigger spiral arms (e.g., Cuello et al. 2019;Ménard et al. 2020).Spiral pattern formed in this way, however, dissipates on the order of 1000 years after the periastron passage (e.g., Pfalzner 2003;Cuello et al. 2019).Despite its short time scale, flyby can leave significant observational effects including disk truncation (e.g., Pfalzner & Govind 2021) and exciting planetary objects to far-separation orbits with high eccentricity (e.g., De Rosa & Kalas 2019; Nguyen et al. 2021), complicating the detection of the expected spiral-arm-driving planets.
With the state-of-the-art high precision measurements on the location and proper motion of stars from Gaia DR3 (Gaia Collaboration et al. 2022), here we present an investigation into the close-in flyby history of known spiral arm systems.Using Monte Carlo simulations, De Rosa & Kalas (2019) have studied the stellar flyby history for the HD 106906 circumstellar disk host.They presented a compelling explanation to the large-separation and high-eccentricity of the planet HD 106906 b (Nguyen et al. 2021).In comparison, analytical multivariate statistical approach has been used to determine association memberships (e.g., Gagné et al. 2014;Riedel et al. 2017;Gagné et al. 2018).Here we adopt the latter strategy1 for computational feasibility of ensemble analysis on existing spiral systems.
Gaia DR3 products follow multivariate normal distributions (Gaia Collaboration et al. 2022), which enables us to develop an analytical framework for flyby analysis.We identify the spiral arm hosts and calculate their flyby history in Section 2, discuss the results in Section 3, and summarize the study in Section 4. We present a querying example using Gaia DR3 in Appendix A, and the mathematical framework for the flyby analysis in Appendix B.
We present the stellar-signal-removed Q φ images that reveal primarily disk signals in Figure 1 in decreasing physical extent with a colorbar in log scale.To better reveal the spiral structures, we have processed for Wa Oph 6 by convolving the image with a σ = 2 pixel Gaussian kernel for smoothing, for HD 100546 a high-pass filter by first removing a σ = 2 pixel Gaussian convolution then applying a σ = 1 pixel Gaussian convolution for smoothing, for TWA 7 the disk-removed residual from Ren et al. (2021).
To investigate recent close-in flyby history for each spiral arm host, we query its neighboring stars within 10 pc from the Gaia DR3 database (Gaia Collaboration et al. 2022) for further analysis, see Appendix A for an example.
Given that Gaia DR3 provides only location and proper motion measurements in both right ascension (R.A.) and declination (Decl.)directions, and it does not offer radial velocity measurements for all stars, we do not attempt to perform three dimensional kinematic studies (e.g., De Rosa & Kalas 2019; Ma et al. 2022).However, our framework can be generalized to take into account of new measurements, see Appendix B.

Flyby framework
We briefly describe the key concepts of our flyby framework here, see the mathematical details and corresponding derivation in Appendix B. In this paper, we use N k , where k ∈ N + , to denote a k-dimensional multivariate normal distribution,2 and superscript T for matrix transpose.We develop the analytical flyby framework for spirals (afm-spirals; Shuai & Ren 2022) for this purpose.3

Mathematical construction
For the selected spiral hosts and their neighboring stars, Gaia DR3 products do not have complete radial velocity information for three dimensional motion analysis, we therefore study only two dimensional on-sky location for the selected samples.
For each star, its on-sky location (R.A. and Decl.) and its two dimension proper motion vector, q = (R.A., Decl., pm R.A. , pm Decl. ) T ∈ R 4×1 , can follow a four-dimensional multivariate normal distribution, where µ ∈ R 4×1 and Σ ∈ R 4×4 are the expectation and covariance matrices that can be computed using Gaia DR3.With these information, we can obtain the on-sky location for a star at a given time t ∈ R by left-multiplying q a transformation matrix and reach a bivariate normal distribution where x t = (R.A., Decl.)T ∈ R 2×1 is the on-sky location vector at time t.
For a pair of stars, their relative on-sky position is a subtraction of two bivariate normal distributions, which results into a bivariate normal distribution.Therefore, in the reference frame of a spiral host H, the relative location of a star neighbour N at any given time t, follows (3) where superscripts (H) and (N ) denote the values for the spiral host and a neighboring star, respectively.
At a certain time t, to quantify the statistical significance between spiral host H and its neighboring star N , we should calculate the relative distance and statistical distribution along line ← − → HN .Although this distribution can be obtained by marginalizing the bivariate normal distribution along the perpendicular direction of ← − → HN , we ease this mathematical complexity by instead rotating the relative distribu-tion of N , thus aligning it along the new horizontal axis using a rotation matrix.With this rotation, the distribution along the direction of where subscript denotes the distribution along line ← − → HN .The relative distribution of a star pair at time t is now established, see Appendix B.2 for the derivation and detailed expression.By minimizing the expected separation in Equation (4), we can obtain the closest separation using a frequentist approach.
We obtain the closest approach time using a Bayesian approach4 , as well as the corresponding closest separation, as follows.For a host-neighbor pair, with the one-dimensional relative distribution between the two stars at time t in Equa- tion (4), we can obtain the corresponding probability density function.In order to obtain the posterior distribution of the closest approach time t (B) c.a from a Bayesian approach, we can rewrite the probability density function into a log-likelihood expression, and perform Markov Chain Monte Carlo (MCMC) analysis.To obtain the distribution for the corresponding distance d (B) c.a. , we can draw samples from the posterior distribution of t (B) c.a. and then sample from their corresponding distances, see Appendix B.4 for the detailed procedure.

Framework application
Stellar flyby can excite spiral arms (e.g., Pfalzner 2003;Ménard et al. 2020), however there are three requirements for the spirals to be observable: (1) the flyby should be a relatively recent or even ongoing event, since spirals dissipate after ∼1000 years (e.g., Cuello et al. 2019), (2) the periastron has to be relatively close to the disk, and (3) the flyby needs to occur slow enough to allow gravitational interactions to take place; a parabolic approach is ideal as it induces the greatest angular momentum transfer and the most prominent spiral (Pfalzner 2004;Vincke & Pfalzner 2016;Cuello et al. 2019).
In order to find potential flybys responsible for the spiral arms, we adopt the following procedure.
For a given spiral arm host, we first calculate the closest historical approach for all its surrounding stars within 10 pc.Given the fact that the locations are linearly propagated, with the linear approximation already validated in De Rosa & Kalas (2019), we can analytically solve for the closest approach distance and time since this calculates the intersection of two lines, see Appendix B.3.
If the closest approach distance d (f ) c.a. is within 10 times the disk radius, we inspect the distance of the two stars within the past 10 4 yr.We then explore the uncertainty of the closest approach, if its corresponding closest time t (B) c.a. is within this period.We note that even if the closest approach occurred more than 10 4 years ago, the relative distance of the hostneighbor can still be within 10 times of the disk radius.In our calculation, we have taken into account this scenario.See Figure 2 for a flowchart of the procedure in this study.
In our experiments, we have noticed that uncertainty could grow faster than distance for some pair of stars (e.g., Section 3.1.2),which results into higher mathematical likelihoods for farther separations, since the first term in Equation (5) can increase to nearly 0 in under this scenario.We therefore only apply the MCMC framework to those that can be well-characterized with a maximum likelihood approach.

Framework validation: RW Aur
RW Aur is a binary system in which a ∼600 au long arm trails from the primary in millimeter observations (Cabrit et al. 2006;Rodriguez et al. 2018).By reproducing the observed features using hydrodynamic models, the study by Dai et al. (2015) supported the hypothesis of a tidal encounter between the two stars.Although observations with SPHERE/IRDIS in polarized light from existing ESO programs including 0102.C-0656(A) and 0104.C-0122(A) do not show similar features, it does not preclude the existence of faint structures that are beyond the sensitivity of SPHERE.
To explore the capability of our analytical framework, we investigate the flyby history between RW Aur A and RW Aur B while assuming a linear motion using Gaia DR3 (which could be less accurate than the parabolic flyby study as in Cuello et al. 2020) for demonstration purposes.
Using the location and proper motion measurements from Gaia DR3, we first minimize the expectation for the closest approach distance in Equation (4), see Figure 3a.We obtain a minimum on-sky separation of d −20 au.The flyby between the RW Aur binary has demonstrated the applicability of our framework.In addition, the orbital period of the binary is more than 1500 yr (Bisikalo et al. 2012) and the orbit could be parabolic (Dai et al. 2015), making it likely that the flyby only occurs within a small fraction of the orbit and thus a linear propagation is valid.We note, however, that our flyby distance and time for the flyby of the RW Aur system could be more accurate when more realistic orbits are adopted (e.g., Cuello et al. 2020).
In fact, the Gaia DR3 measurements for RW Aur may suffer from systematics that can lead to incorrect flybys in our study for RW Aur.Specifically, the renormalized unit weight error (RUWE) is 1.50 for RW Aur A, while RUWE = 16.4 for RW Aur B. In comparison with an expected value of 1.0 for the RUWE, the values for the RW Aur binary are higher than 1.4, which suggests unreliable Gaia DR3 solutions (e.g., Fabricius et al. 2021).Given that the closeness of the two stars may lead to inaccurate measurements (e.g., Takami et al. 2020), future high precision measurements with better Gaia solutions for non-isolated systems, as well as radial velocity measurements, could better determine the flyby history for RW Aur.
Out of the 12130 neighbors that are within 30 pc from RW Aur, we additionally identify that Gaia DR3 156431440590447744 has approached d (f ) c.a. = 13.2 ± 2.5 kau from RW Aur at t (f ) c.a. = −5845 yr.With large uncertainties, we do not perform Bayesian analysis for this neighbor using Equation ( 5).However, it is 5σ from zero on-sky distance with RW Aur A and might have flown by statistically.In comparison, it is 7σ for RW Aur B, and the rest of the neighbors are at least 300σ away in their closest approach.

Results and Discussion
We report the closest approach results from the frequentist approach in Table 1 for all spiral hosts.For each host, the flyby information is available for all its neighbors in electronic .csvtables, see Table 2 for an incomplete example for EM* SR 21 A.
For all systems, we discuss the flyby history in three categories: those with credible Gaia DR3 flyby candidates (i.e., passing all criteria in Figure 2) in Section 3.1, those without in Section 3.2 and within the latter the possible binary systems in Section 3.3.We note that those spiral hosts that do not have credible flyby candidates may change when more accurate location and proper motion solutions are available.Columns 5 and 6: expectation and standard deviation for closest on-sky approach distance in the frequentist approach.Column 7: minimum zscore for the closest approaches of all neighbors, which is defined as the expectation of closest approach by its corresponding standard deviation; the resulting value is thus unitless or the meaning of σ in astronomy.Column 8: Renormalised Unit Weight Error (RUWE) of the host star in Gaia DR3. a Closest approach distance and minimum z-score do not have to be the same neighbor.If not, the z-score for the closest approach is higher, which is even less likely to pass through the spiral host.

With credible Gaia DR3 flyby candidates
b The RUWE is expected to be around 1.0 for sources where the singlestar model provides a good fit to the astrometric observations.An RUWE value that is significantly greater than 1.0 (e.g., RUWE >1.4,Fabricius et al. 2021) suggests that the source is non-single or otherwise problematic for the astrometric solution, which would induce biased flyby calculations in our framework.
We have identified credible Gaia DR3 flyby candidates for the following 2 systems, see Figure 4 for corresponding flyby distance.

EM* SR 21 (i.e., EM* SR 21 A)
In scattered light, EM* SR 21 hosts an asymmetric outer ring (∼70 au), two bright spiral arms inside this ring, and an inner ring detected by VLT/SPHERE (Muro-Arena et al. 2020).ALMA observations of thermal dust emission in multiple bands show a cavity which colocates with the spirals (Muro-Arena et al. 2020).In addition to the major spirals, Muro-Arena et al. ( 2020) detect a faint kinked spiral between the bright inner spirals and the outer ring, which is consistent with hydrodynamical models of planet-disk interactions and could constrains the location of a possible planet.Using the pyramid wavefront sensor from Keck/NIRC2 in L band, Uyama et al. (2020a) reported three marginal point sources that coincide with the spirals.
Among the 1432 Gaia DR3 sources within 10 pc from EM* SR 21 (i.e., EM* SR 21 A), 13 sources have their closest on-sky approach within the past 10 4 yr, among which Gaia DR3 6049152203067495808 (i.e., EM* SR 21 B) had an on-sky distance d −132 au, see Figure 4c for the probability density distribution.
In fact, EM* SR 21 A and EM* SR 21 B have been classified as a binary system (Barsony et al. 2003).However, they do not appear to be coeval in Prato et al. (2003), marking them as a false binary from chance alignment based on characterizing their spectral type and luminosity.However, the ages adopted in Prato et al. (2003) can be affected by the fact that EM* SR 21 A is actively accreting (Fang et al. 2017), and late-type stars like EM* SR 21 B can manifest much younger ages in comparison with model-derived ages (Malo et al. 2014).
To further assess whether the two are gravitationally bounded, we assume the same parallax for the two and treat them as a two-body system.Adopting a stellar mass of 1.66M and 0.25M for A and B, respectively, from Herczeg & Hillenbrand (2014), and using Gaia DR3 parallax and proper motion, the two will be gravitationally unbound if their radial velocity differs by ∼1.7 km s −1 .What is more, the bounded orbital period would be ∼3 × 10 4 yr, which makes the closest approach time cover only ∼10% or the orbit and thus suggests that our linear motion approximation is likely valid.Nevertheless, different measurements on spectral types and thus masses of the two (e.g., Suárez et al. 2006;Furlan et al. 2009) could result into different age and bounding results.After all, although our framework identifies EM* SR 21 B as a credible on-sky flyby candidate for EM* SR 21 A, the fact that two are probably bounded suggests the spirals may have formed through companion-disk interaction (e.g., Dong et al. 2016).With Gaia DR3 RUWE measurements being smaller than the 1.4 threshold (i.e., 1.14 and 1.20 for EM* SR 21 A and EM* SR 21 B, respectively), we do not expect our results to deviate significantly from future high accuracy measurements.

HD 34700 (i.e., HD 34700 A)
A large low-density cavity and multiple spiral-arm structures outside the cavity are revealed for HD 34700 using the Gemini Planet Imager in polarized scattered light (Monnier et al. 2019).The structures are also detected using the STIS instrument onboard the Hubble Space Telescope in total intensity (Ygouf et al. 2019), and with SCExAO/CHARIS in multiple bands (Uyama et al. 2020b).The HD 34700 system is comprised of a binary Herbig Ae system (HD 34700AaAb) and two distant companions.Spiral fitting by Uyama et al. (2020b) results in large pitch angles, which might be explained by the flyby of HD 34700 B and/or HD 34700 C.
Among the 367 Gaia DR3 sources within 10 pc from HD 34700 (i.e., HD 34700 A), 7 sources have their closest on-sky approach within the past 10 4 yr, yet 6 of them are at least 145σ away from the spiral host, except Gaia DR3 3237512159787015936 (i.e., HD 34700 C) which has d We cannot establish a statistically well-constrained posterior flyby time for HD 34700 C within the past 10 4 yr, see Figure 4d.This is because the fast uncertainty growth of the relative distance can lead to higher likelihood values for earlier times.Nevertheless, we can identify a more past flyby at t −2.5 × 10 4 yr, which has a large uncertainty and we do not further investigate, since it is beyond the expected 10 4 yr requirement for spirals to persist.In comparison, the Uyama et al. (2020b) flyby calculation for HD 34700 C is prone to systematic offsets between Sterzik et al. (2005) and Gaia DR2 (Gaia Collaboration et al. 2018), when the latter did not include proper motion measurements for HD 34700 C. Future observations with higher precision than Gaia DR3 may better constrain the flyby history for HD 34700 C and resolve the difference between the frequentist and Bayesian approach.

Isolated systems: no credible Gaia DR3 flyby candidates
We have not identified credible Gaia DR3 flyby candidates for 15 systems, see a summary of the information for all 20 systems in Table 1.Nevertheless, the existence of faint and close-in stars including binaries that have not been accessible from Gaia, or those that are accessible but without motion measurements yet in Gaia DR3, could be the de facto flyby candidates.

(Un)known binary systems
We did not identify flybys from neighbouring stars for the following systems, but they are (or could be) binary systems which have been (or should be) confirmed.What is more, the high RUWE measurements for certain systems suggest that the Gaia DR3 values could be biased due to the existence of binary companions.As a result, our linear framework that is fed with biased values cannot accurately trace the historical and future locations for these stars.To finalize flyby history for spiral formation mechanisms with high RUWE values, more reliable solutions from Gaia and a more realistic propagation framework are necessary.

AS 205
AS 205 is a binary system with the northern star AS 205 N hosting a pair of spirals in ALMA in Kurtovic et al. (2018), and the southern target AS 205 S being a spectroscopic binary.Gas emission between AS 205 N and AS 205 S shows tidal interaction between them, and the spirals surrounding AS 205 N could be explained by this (e.g., UX Tau: Ménard et al. 2020).
Among the 793 Gaia DR3 sources within 10 pc from AS 205, 6 sources have their closest on-sky approach within the past 10 4 yr, yet they are at least 86σ away from the spiral host.AS 205 S, however, will have a future closest approach of d

HD 100453
HD 100453 is a binary system with a double spiral pattern in Wagner et al. (2015), with Dong et al. (2016) explaining the two spirals are driven by the companion HD 100453 B. Rosotti et al. (2020) observed CO gas connection to the companion in peak intensity using ALMA, which is consistent with the expectation that the spirals are driven by it.
The companion HD 100453 B is not reported in Gaia DR3.Among the 816 Gaia DR3 sources within   .This number is unitless, yet its meaning in astronomy is σ which shows the significance from zero separation.Column 6: right ascension of the star in Column 1. Column 7: declination of the star in Column 1. Column 8: Gaia DR3 Renormalised Unit Weight Error (RUWE) of each source.
a The table presented here is for explanation and demonstration purposes only, and thus some values are rounded to certain decimal places.
See the accompanying EM SR21 sequence d.csv file for a complete table for EM* SR 21, and other .csvfiles for the other spiral hosts.b Sorted by distance of closest approach in Column 2 to EM* SR 21 in the past 10 4 yr.
c Analytical solutions corresponding to the minimum expectation in Equation ( 4) from a frequentist approach.
d Closest approach in the past (earlier than 10 4 yr ago).The closest approach distance and standard deviation values are calculated for this time stamp from Equation (4), which are not posterior distributions.
e Closest approach in the future.The closest approach distance and standard deviation values are calculated for this time stamp (i.e., the Gaia DR3 epoch).(The data used to create this table are available in the 'anc' folder on arXiv.) 10 pc from HD 100453, 10 sources have their closest on-sky approach within the past 10 4 yr, among which Gaia DR3 5345034027626030848 had an on-sky distance d

V599 Ori
V599 Ori shows a possible spiral in the SPHERE data.Among the 386 Gaia DR3 sources within 10 pc from V599 Ori, 3 sources have their closest on-sky approach within the past 10 4 yr, yet they are at least 5769σ away from the spiral host.We do not identify recent close-in on-sky flyby candidates.
The SPHERE data, however, shows a visually nearby source at 2. 04 to its northeast side.It matches the source Gaia DR3 3016081586083413120.Nevertheless, there is no parallax measurement for this source from Gaia DR3.
Given that Gaia DR3 3016081586083413120 situates along the pointing direction of the possible arm of V599 Ori, we cannot rule out it being a faint object that passed by the V599 Ori system.Future parallax and proper motion measurements is necessary to investigate the flyby relationship of the two sources.Relative distance as a function of past time for systems with recent close-in flyby events in Section 3.1.Top: Gaia DR3 6049152203067495808 (i.e., EM* SR 21 B) seen from EM* SR 21: moderate uncertainty growth in (a) allows for posterior calculation of the time of closest approach in (b), which shares the same vertical axis with the approach distance in (c).Bottom: Gaia DR3 3237512159787015936 (i.e., HD 34700 C) seen from HD 34700: uncertainty expansion in (d) cannot give conclusive answers to nearest approach time in maximum likelihood in (e), in which the MCMC samples drift towards the prior limit of −10 4 yr.Note: negative distances in (c) are physically implausible, yet it is the framework limit when sampling from normal distributions.be comprised of bounded objects, making the spirals instead probably resulting from companion-disk interaction.
For isolated systems that host spirals in scattered light, we have not identified recent and close-in flyby candidates from Gaia DR3 for them.This suggests that such flybys could not be the primary resources for the formation of spiral arms in scattered light for isolated systems.Should such objects exist, they are beyond the detection limits of Gaia DR3.
Moving forward, this framework can identify flyby candidates for new spiral systems, or establish flyby events when radial velocity measurements of comparable data quality are available.The flyby candidates from this framework do not require survey-level radial velocity observations, but discrete observations of individual targets.By doing so, we can reduce the observational cost in the search for stellar flyby events.Once these relationships are confirmed, however, we note that on the one hand, we cannot exclude the possibility that the spirals are indeed not excited by stellar flyby events.On the other hand, if stellar flyby events do have occurred, the orbits of the planets in these planet-forming systems could be excited to exotic orbits (e.g., Nguyen et al. 2021) that could be more challenging to image than those with circular orbits, which were previously assumed in spiral motion measurements (e.g., Ren et al. 2020;Xie et al. 2021;Safonov et al. 2022).
There are limitations in our study.First, we have only presented stellar flyby candidates that are identified in Gaia DR3 with both location and proper motion measurements.Second, we have adopted linear motion propagation in our flyby study, however this approach should be accurate for the purpose of identifying flyby events for isolated systems (e.g., De Rosa & Kalas 2019).Third, for stars with moderate motion uncertainties -yet low accuracy -which thus cannot be identified to have statistically significant flyby, they could still be responsible for the excitement of spiral arms.Last but not least, the high RUWE terms in Gaia DR3 products for certain sources suggest biased measurements that could result into non-credible flyby events, and high RUWE values might indicate the existence of undetected companions which can drive the spirals.Nevertheless, when upcoming measurements with higher accuracy are available, our analyt-ical framework will aid in narrowing down their connection to the observed spiral systems.
For each spiral host, we query the Gaia DR3 stars that are within its 10 pc at https://gea.esac.esa.int/archive/,see the following Astronomical Data Query Language (ADQL) code which uses MWC 758 as a query example.In addition to the default results from any Gaia query, the ADQL outputs are used for our flyby analysis by including for each neighbor its angular on-sky distance to the host ("dist arcsec"), distance to the Solar System ("z pc"), and three-dimensional physical distance to the host ("dist to host").In the above ADQL query example, we increase the querying efficiency as follows.We first find the stars whose on-sky angular distances are within 11 pc from MWC 758 to obtain a cone.We then identify those that have a distance that is within 10 pc from the MWC 758 distance to the Solar System, thus segmenting the cone with concentric spheres.We finally select the stars that are within 10 pc from MWC 758 in this segmented cone using the law of cosines, and order them by their three-dimensional distance to MWC 758.By doing so, the querying results can be obtained within 5 min for each host.
r h y J o S v n 9 L / R a t c L J 0 W K z e V Q u 1 i G U e W H J I j c k J K 5 I z U S J 0 0 S J M w c k 8 e y B N 5 t h L r 0 X q x X h e t G W s 5 c 0 B + l P X 2 C S n 6 l I s = < / l a t e x i t > ↵ NHt < l a t e x i t s h a 1 _ b a s e 6 4 = " x V 4 C 9 r k T 7 K 0 h 6 L 7 G f 0 i t 6 M J + P F e D c + 5 q 0 V o 5 w 5 R H 9 g f P 4 A E 4 u W F A = = < / l a t e x i t > ↵ c.a.
E 5 c 7 8 y t 3 l Q r 9 c s 8 j i I c w C E c g w f n U I d r a E A T K N z B A z z B s x M 7 j 8 6 L 8 7 p o L T j 5 z D 7 8 g P P 2 C e U 5 j 1 w = < / l a t e x i t > ↵ < l a t e x i t s h a 1 _ b a s e 6 4 = " T x A X a p u K i Point H is the position of spiral host in its reference frame (i.e., origin).N is the location of a star neighbour seen from H, which is located the center of the bivariate normal distribution in Equation (B4).The distribution along line ← − → HN is a one-dimensional normal distribution, see Equation (B13).
The relative location of star neighbour N from spiral host H at time t, ∆x where superscripts (H) and (N ) denote the generalized coordinates for spiral host H and its star neighbour N from Equation (B1), respectively.See Figure B1 for an example of such a distribution at time t.

B.2. Statistical distribution
The statistical quantification of the relative location between two stars can be obtained along the direction of the two stars, i.e., along line ← − → HN in Figure B1.At time t, the functional form of Equation (B4) is fixed, and we can clockwise rotate the bivariate normal distribution by angle θ t to align point N along the horizontal axis.The rotation matrix for such a clockwise rotation is .The corresponding expression of the bivariate normal distribution after this rotation is where µ ∈ R + , and ρ ∈ [−1, 1] is the correlation.The first element of ∆x N Ht , x , corresponds to the distribution along line ← − → HN , and the second element x ⊥ perpendicular to line ← − → HN , see Figure B1.
Given the information of spiral host H and a star neighbour N , the probability density distribution along line ← − → HN at time t, is therefore (B8)

B.3. Closest approach
In the reference frame of host H, the expected flyby path of star neighbour N is a straight line, since the proper motion measurements are linearly propagated.The minimum distance between the two stars is thus the length of the line segment that is perpendicular to the flyby path of N , see Fig- ure B1.
For H and N , to obtain the analytical expressions of the closest approaches, here we define relative R.A. offset in Gaia DR3 measurement as ∆α = α (N ) − α (H) , relative Decl.measurement ∆δ = δ (N ) − δ (H) , relative proper motion along the R.A. direction ∆µ α = µ Defining the functional form for the flyby path to be ax + by + c = 0, and comparing with Equation (B9), then we have The distance of the closest approach, or the length of the line segment that is perpendicular to the flyby path from H, is then where negative value corresponds to closest approach in the past, while positive value in the future.
In our analysis, we calculate both the minimum expected on-sky distance and the time of the closest approach in Equations (B11) and (B12).We compare them with our criteria in both fly-by time (−10 4 yr < t c.a. < 0), and distance of closest approach (0 < d c.a. < 10r disk , where r disk is the radial extent of the spirals in existing observations), to select flyby candidates.For the selected candidates, we calculate the posterior distribution and thus credible intervals as follows.

B.4. Posterior distribution
For the one-dimensional distribution along line ← − → HN in Equation (B8), the corresponding probability density function is For each star pair H and N , the Gaia DR3 values can result into divergence of tan θ t in the calculation of θ t for Equation (B5), since star N can situate along the vertical axis in Figure B1 at some certain time t.In this study, we avoid this divergence by calculating the four matrix elements of Equation (B6) based on the definition of trigonometric functions using line segments.
(B14) For a given disk host H, we set N to be one of its stellar neighbors and quantify the corresponding statistical significance of flyby using Equation (B8).We perform the likelihood calculation in Equation (B14) only for those candidate flyby neighbors to obtain the posterior distribution of their closest approach time t

Figure 1 .
Figure 1.Gallery of spiral systems studied here for flyby analysis (colorbar in log scale).The targets are sorted by decreasing physical extent from left to right, and top to bottom.

Figure 3 .
Figure 3. Flyby of RW Aur B from RW Aur A with Gaia DR3.(a) Relative distance between the binary in the past 1000 yr.(b) and (c) are the posterior distributions of the on-sky closest approach time and separation, respectively.The closest approach is d (B) c.a. = 148 +20 −20 au at t (B) c.a. = −418 +26 −38 yr.
. = 148 ± 20 au from RW Aur A, which is equivalently 7σ from zero distance, at t (f ) c.a. = −371 yr.We then explore the likelihood in Equation (5) using emcee, and obtain the posterior distribution of the closest approach time in Figure3b, or t (B) c.a. = −418 +26 −38 yr.We finally sample from the posterior distribution of the approach time, then sample the corresponding approach distance (see the prescription in Appendix B.4.2), to reach the corresponding posterior distribution for the closest approach distance in Figure 3c, or d (B) c.a. = 148 +20 (f ) c.a. = 203 +133 −133 au (equivalent to being 1.52σ away from zero separation) from the host at t (f ) c.a. = −3873 yr.The rest of the 12 systems are at least 100σ away from the spiral host, see Table 2.For EM* SR 21 B, we follow Appendix B.4.1 and quantify its posterior distribution of closest approach time.The maximum likelihood approach time and (16th, 84th) percentile values are t (B) c.a. = −4086 +291 −1010 yr from Gaia DR3.We obtain the posterior distribution of approach distance by first sampling from the posterior distribution of closest approach time, then sampling the approach distance using Equation (B8), see Appendix B.4.2 for the detailed procedure.The corresponding maximum likelihood distance and (16th, 84th) percentile values are d (B) c.a. = 205 +132 . = 3184 +127 −127 au (i.e., 25σ from zero distance) at t (f ) c.a. = −3053 yr.We do not identify other recent close-in on-sky flyby candidates.
. = +76.3yr.We do not identify recent close-in on-sky flyby candidates.However, the RUWE measurement for AS 205 is 1.75, indicating non-reliable solution from Gaia DR3 and compromising the corresponding linear flyby results.
. = 2767 +1409 −1409 au (i.e., being 2σ away from zero separation) from the host at t (f ) c.a. = −9740 yr.Yet the rest of the 9 systems are at least 100σ away from the spiral host.
-in flyby of neighboring stars can excite short-lived spiral arms in protoplanetary disks.Assuming linear motion propagation and by developing an analytical framework afm-spirals(Shuai & Ren  2022)  and performing flyby analysis for 20 known spiral arm hosts resolved in polarized scattered light with VLT/SPHERE/IRDIS, we have identified EM* SR 21 as the only system with a plausible recent flyby candidate (EM* SR 21 B) responsible for the spirals.Nevertheless, existing evidences show that the EM* SR 21 system could Figure 4.Relative distance as a function of past time for systems with recent close-in flyby events in Section 3.1.Top: Gaia DR3 6049152203067495808 (i.e., EM* SR 21 B) seen from EM* SR 21: moderate uncertainty growth in (a) allows for posterior calculation of the time of closest approach in (b), which shares the same vertical axis with the approach distance in (c).Bottom: Gaia DR3 3237512159787015936 (i.e., HD 34700 C) seen from HD 34700: uncertainty expansion in (d) cannot give conclusive answers to nearest approach time in maximum likelihood in (e), in which the MCMC samples drift towards the prior limit of −10 4 yr.Note: negative distances in (c) are physically implausible, yet it is the framework limit when sampling from normal distributions.
< l a t e x i t s h a 1 _ b a s e 6 4 = " 2 s z m t j V 9 c Y 7 + n k IV 7 q Q T O c 0 d E F o = " > A A A B + 3 i c d Z D L S g M x F I Y z 9 V b r b a x L N 8 E i u C r T 0 q r L o i 6 6 k g r 2 A m 0 p Z 9 K 0 D c 1 c S M 6 I Z Z h X c e N C E b e + i D v f x k x b Q U U P h P x 8 / z n k 5 H d D K T Q 6 z o e V W V l d W 9 / I b u a 2 t n d 2 9 + z 9 f E s H k W K 8 y Q I Z q I 4 L m k v h 8 y Y K l L w T K g 6 e K 3 n b n V 6 m f v u O K y 0 C / x Z n I e 9 7 M P b F S D B A g w Z 2 v n f F J U I P Z D i B Q X x d x 2 R g F 5 x i 1 T F V p k 4 x v S t V u i R V W p o T x y m Q Z T U G 9 n t vG L D I 4 z 4 y C V p 3 S 0 6 I / R g U C i Z 5 k u t F m o f A p j D m X S N 9 8 L j u x / P d E 3 p s y J C < l a t e x i t s h a 1 _ b a s e 6 4 = " J s A S + 0 d H JN J i R r o C 1 A Q g z 2 z J M Z s = " > A A A B 7 3 i c d V D L S g M x F M 3 U V 6 2 v q k s 3 w S K 4 G j K l V Z d F N y 4 r 2 A e 0 Q 8 m k m T Y 0 k x m T O 0 I p / Q k 3 L h R x 6 + + 4 8 2 / M t C O o 6 I G Q w z n 3 c u 8 9 Q S K F A U I + n M L K 6 t r 6 R n G z t L W 9 s 7 t X 3 j 9 o m z j V j L d Y L G P d D a j h U i j e A g G S d x P N a R R I 3 g k m V 5 n f u e f a i F j d w j T h f k R H S o S C U b B S t w 9 j D n Q A g 3 K F u H V i U c X E z f 5 a H e d K H X s L h Z A K y t E c l N / 7 w 5 i l E V f A J D W m 5 5 E E / B n V I J j k 8 1 I / N T y h b E J H v G e p o h E 3 / m y x 7 x y f W G W I w 1 j b p w A v 1 O 8 d M x o Z M 4 0 C W x l R G J v f X i b + 5 f V S C C / 8 m V B J C l y x 5 a A w l R h i n B 2 P h 0 J z B n J q C W V a 2 F 0 x G 1 N N G d i I S j a E r 0 v x / 6 R d d b 0 z t 3 Z T q z Q u 8 z i K 6 A g d o 1 P k o X P U Q N e o i V q I I Y k e 0 B N 6 d u 6 c R + f F e V 2 WF p y 8 5 x D 9 g P P 2 C V t r k D I = < / l a t e x i t > ✓ t < l a t e x i t s h a 1 _ b a s e 6 4 = " a C L W W 3 7 l 0 g 3 R θt = cos θ t sin θ t − sin θ t cos θ t , Ht ) 2 + (∆δ N Ht ) 2 ∆α N Ht ∆δ N Ht −∆δ N Ht ∆α N Ht , (B6)where ∆α N Ht = Eα (N ) − Eα(H) +t Eµ N Ht = Eδ (N ) − Eδ (H) + t Eµ α , and relative motion along the Decl.direction ∆µ δ = µ (N ) δ − µ (H) δ .Aligning the R.A. direction with the x-axis and the Decl.direction the y-axis in Cartesian coordinates, the flyby path can be expressed as y − ∆δ x − ∆α = ∆µ δ ∆µ α , or ∆µ δ • x − ∆µ α • y + ∆µ α • ∆δ − ∆µ δ • ∆α = 0. (B9) the horizontal direction, we can obtain the closest relative distance in the R.A. direction, ∆α c.a. = −ac a 2 + b 2 .Comparing the current -Gaia DR3 -relative distance in the R.A. direction and the closest approach, we can obtain the time of closest approach analytically,

Table 1 .
Summary of flyby information for 20 spiral hosts Star r disk n n.b.r n flyby d a σ Notes.Column 1: spiral host name.Column 2: approximate disk radius in scattered light matching field of view in Figure 1.Column 3: number of neighboring stars in Gaia DR3 with location and proper motion measurements within 10 pc.Column 4: number of neighboring star whose closest approach to the host are within 10 4 yr before Gaia DR3.

Table 2 .
Flyby history of EM* SR 21 neighbors using Gaia DR3 a Column 1: unique source designation in Gaia DR3.Column 2: distance of closest approach to EM* SR 21 within the past 10 4 yr, i.e., the expectation of the one-dimensional normal distribution in Equation (4).Column 3: standard deviation of the distance of closest approach, i.e., the standard deviation of the one-dimensional normal distribution in Equation (4).Column 4: closest approach time within the past 10 4 yr.Column 5: z-score, z = d