Evidence for inflows and outflows in the nearby black hole transient Swift J1727.8 − 162

We present 20 epochs of optical spectroscopy obtained with the GTC-10.4m telescope across the bright discovery outburst of the black hole candidate Swift J1727.8 − 162. The spectra cover the main accretion states and are characterised by the presence of hydrogen and helium emission lines, commonly observed in these objects. They show complex profiles, including double peaks, but also blue-shifted absorptions (with blue-edge velocities of 1150kms − 1 ), broad emission wings, and flat-top profiles, which are the usual signatures of accretion disc winds. Moreover, red-shifted absorptions accompanied by blue emission excesses suggest the presence of inflows in at least two epochs, although a disc origin cannot be ruled out. Using pre-outburst imaging from Pan-STARRS, we identify a candidate quiescent optical counterpart with a magnitude of g ∼ 20 . 8. This implies an outburst optical amplitude of ∆ V ∼ 7 . 7, supporting an estimated orbital period of ∼ 7 . 6h, which favours an early K-type companion star. Employing various empirical methods, we derive a distance to the source of d = 2 . 7 ± 0 . 3kpc, corresponding to a Galactic plane elevation of z = 0 . 48 ± 0 . 05kpc. Based on these findings, we propose that Swift J1727.8 − 162 is a nearby black hole X-ray transient that exhibited complex signatures of optical inflows and outflows throughout its discovery outburst


Introduction
Swift J1727.8−162(hereafter J1727) was originally identified as a gamma-ray burst (GRB 230824A; Lipunov et al. 2023;Page et al. 2023) by Swift on August 24, 2023 (MJD 60180.5831;all times will be referred to this date).The duration and X-ray colour of the event, however, led to a new improved classification as a low-mass X-ray binary, whose outburst evolution was immediately followed by the MAXI/GSC (Negoro et al. 2023;Nakajima et al. 2023) and NICER (O'Connor et al. 2023) observatories.The source evolved through the X-ray hard and soft states (see e.g.Bollemeijer et al. 2023a;Miller-Jones et al. 2023a), following the canonical behaviour for black hole transients (BHTs; e.g.Done et al. 2007;Belloni et al. 2011).The brightness of the event (see e.g.Palmer & Parsotan 2023) prompted multiwavelength campaigns with ground-based monitoring.Optical follow-up revealed a very bright r ∼ 12.7 counterpart (Wang & Bellm 2023;Baglio et al. 2023;Alabarta et al. 2023), which subsequently started a slow decline over the outburst duration.This enabled spectroscopy from the early stages of the outburst (Castro-Tirado et al. 2023), revealing typical Doppler-broadened emission lines of H and He species.Mata Sanchez & Muñoz-Darias (2023) further extended the identification to other metallic transitions while reporting on the detection of blue-shifted absorption features in a number of lines, a hallmark of cold disc outflows.
In this letter we confirm the detection of outflows through the analysis of multi-epoch optical spectroscopy obtained during the first 62 days of the outburst and across all the classical accretion states.Additionally, we present a pre-outburst optical counter-part and provide constraints on some fundamental parameters, such as the orbital period and the distance to the source.

Observations
We obtained 20 spectroscopic epochs with the 10.4m Gran Telescopio Canarias (GTC) at the Roque de los Muchachos Observatory (La Palma, Spain), equipped with the Optical System for Imaging and low-Intermediate-Resolution Integrated Spectroscopy (OSIRIS, Cepa et al. 2000).The observing set-up varied across the different epochs, as detailed in Table 1.The spectra were reduced, extracted, and wavelength-calibrated in pyraf and molly.We employed sky emission lines to correct from flexure effects on the wavelength calibration, finding sub-pixel drifts.

Hardness-intensity diagram
In order to put our observations in context with the outburst evolution, we built a hardness-intensity diagram (HID, Homan et al. 2001) employing daily averaged fluxes from MAXI (see Fig. 1).The HID follows the canonical q-shaped hysteresis pattern observed in BHTs (e.g.Fender & Belloni 2012), characterised by lower hardness values than their neutron star counterparts (e.g.Muñoz-Darias et al. 2014).The X-ray state of each GTC epoch is listed in Table 1.Inspection of the HID reveals that there were X-ray detections prior to the outburst trigger.During the initial outburst rise in the hard state, quasi-periodic oscillations (QPOs)  et al. 2023).Transition to the soft-intermediate state (SIMS) occurred a month later, based on the disappearance of the QPO and a drop in the aperiodic X-ray variability (Bollemeijer et al. 2023b;Belloni et al. 2005).On day 52 a transition to the soft state was reported (Trushkin et al. 2023), where the system gradually decayed in luminosity.At the time of writing this letter, the outburst is still ongoing.

Evolution of the optical spectra
Five different epochs, representative of the collected data during the four different X-ray states, are shown in Fig. 2. The spectrum of J1727 is characterised by the presence of emission lines corresponding to H Balmer and Paschen series, He i (e.g.5875.618Å, 6678.149Å) and He ii (4685.750Å, 5411.551Å) transitions.The Bowen blend and emission from the Fe ii forest (∼ 5284 Å) are also detected.We searched for short-term variability in our extended E2 observations (a total of 18 spectra), but could not see evidence of any within timescales of a few minutes to an hour.While this does not preclude stronger variability from occurring at a different state of the outburst, we base our study on the average spectral properties obtained for each epoch.
An overall view of the evolution of the emission lines reveals predominantly single-peaked lines during the bright hard state (E1 to E3), while at later epochs (HIMS) they develop a double-peaked structure, first on the He i and He ii transitions, (starting on E4) and later over the H series (e.g.E16).We 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 Hardness (4-10 keV)/(2-4 keV) Fig. 1.HID constructed from MAXI data.Hardness corresponds to the ratio of the count rates in the 4-10 keV to the 2-4 keV bands, while the intensity corresponds to the count rate in the 2-20 keV band.The black line depicts the outburst evolution with the grey square representing a binning of ∼ 50 days of data prior to the X-ray trigger (shown as transparent points in the background).The stars mark the timestamps of our optical observations, coloured according to the X-ray state (see Table 1): hard state (blue), HIMS (green), SIMS (orange), and soft state (red).
performed single and two-Gaussian fits to each Hα, Hγ, and Hδ line, as the remaining transitions are too weak (even undetectable at certain epochs, see e. by nearby features (e.g.He i-5876 Å, Hβ).In spite of the presence of variable asymmetric components distorting the profiles (described below), the single-Gaussian fit yields an average full width at half maximum of FWHM = 750 ± 120 km s −1 .The two-Gaussian fit leads to a consistent centroid velocity across all epochs of −170 ± 50 km s −1 .Given the multi-epoch stability of the line centroid, we adopt it as the tentative radial systemic velocity of J1727.We refer any line profile to this value (i.e. in the binary rest frame).We note that a Gaussian fit to He ii-4686 Å yields a consistent centroid, although the FWHM increases monotonically as the outburst progresses, reaching FWHM = 1500 ± 300 km s −1 in the soft state observation (E20, see Fig. 2).Hα and He i-5876 Å are usually the best lines to search for outflows.In the case of J1727, the presence of nearby and strong telluric features hampers a clean detection.Hβ is similarly affected by the presence of a diffuse interstellar band (DIB) that contaminates the red wing of the line.For this reason we initially focus our analysis on Hγ and Hδ.We find two remarkable patterns on the profiles (see Figs. 2 and 3 for examples of the epochs cited below): -Blue-shifted absorptions: They consistently appear in the Balmer series across most epochs.He i transitions do not show such clear patterns, but He ii-4686 Å does, dipping below the continuum (see e.g.E11).The absorption depth is variable, being at its deepest in E8 and E11, reaching 7% below the continuum level for Hβ (4% for Hγ).They show blue-edge velocities of ∼ −1150 km s −1 , which remain consistent across all epochs.-Red-shifted absorptions: A number of epochs exhibit redshifted absorptions (E4, E7, E9, E10, E19).They meet the continuum at ∼ 900 km s −1 , a velocity ∼ 20% lower than that of their blue-shifted counterparts, and exhibit slightly shallower depths.The deepest absorption is found in epoch E10 (a day before the deepest blue-shifted absorption was observed) being 2% below the continuum level for Hγ.These red-shifted absorptions can be accompanied by blue-shifted absorptions (E10), broad blue wings (E4, E7), skewed (E9, E10), or even flat-top (E7) emission line profiles.We note that even the high excitation He ii-4686 Å line exhibited these red-shifted absorptions in E4 and E7.

Optical accretion disc winds
We detect blue-shifted absorptions (E11, Fig. 3) sometimes accompanied by a red tail excess (E3, Fig. 2), matching the prescription for P-Cygni profiles (e. ).In addition, these systems can also show broad emission wings that meet the continuum at the same velocity as the P-Cygni profiles.These features are thought to be associated with optically thin ejecta, as well as ultimately responsible for the so-called nebular phase (e.g.Mata Sánchez et al. 2018).Flat top (E7, see Fig. 3) and skewed (E9, E10, see Fig. 2) profiles, both typically associated with the presence of outflows, are also identified.All this phenomenology (see The analysis of the J1727 spectra is complex due to the presence of contaminants and the multi-component nature of the line profiles.While the effect of DIBs and telluric absorptions can be mitigated by analysing clean wavelength regions, the detection of red-shifted absorptions at certain epochs poses a challenge. We propose two alternative scenarios to explain them.On the one hand, the simultaneous presence of a weaker blue-shifted absorption component during epochs with red-shifted absorptions (e.g.Balmer series in E10) suggests that the emission line might be embedded into a broad absorption component.These have been observed in H and He i transitions in other BHTs (e.g.GRO J1655−40; Soria et al. 2000).Their origin is still debated, as predictions from the most commonly accepted model (Dubus et al. 2001) have been challenged (see e.g.Mata Sánchez et al. 2022 and references therein).On the other hand, narrow redshifted absorptions have been previously reported in the optical spectra of the BHT GRS 1716−249 (Cúneo et al. 2020), and described as inverse P-Cygni profiles (i.e.inflow signatures).In our dataset, the line profiles of Hγ and Hδ in E4 and E7 (see Fig. 3) are the most promising candidates supporting this scenario, as they are concurrent with extended blue emission wings.To shed some light on this matter, we searched for outflows and broad absorption features with the machine learning classifier ATM (Mata Sánchez et al. 2023) adapted to the Hγ and Hδ lines (which are free from nearby contaminants).The resulting classifications (collected in Table A.1) support the detection of outflow features (mainly as blue-shifted absorptions) in several epochs, while a number of profiles are classified as embedded in a broad absorption component (including some with narrow red-shifted absorption features; e.g.E7, E19).A Monte Carlo approach reveals, for spectra where the classifier struggles the most, that the broad absorption class is the second most likely classification (typically ∼ 30 − 40% association probability).This suggests that a broad absorption component might be present during most of the outburst, but only dominates the profile at certain epochs.The absence of a dedicated inflow class in ATM precludes further inspection.Another puzzling result is the detection of possible outflow features in He ii-4686 Å, including blue-shifted absorptions dipping below the continuum (E11, Fig. 3) and skewed profiles (E3, see Fig. 2).This line behaves as the rest of the simulta-N E 5" r-band neously observed transitions in these epochs, both in terms of depth and blue-edge velocity, which leads us to conclude that it traces the same phenomena.This would be one of the few detections of outflows in a high-ionisation optical transition, with Swift J1357.2−0933being the only precedent (Charles et al. 2019;Jiménez-Ibarra et al. 2019).
The only observation in our sample during the soft state is E20 (Fig. 2).By then, Hγ exhibits a skewed profile (where the blue peak is absorbed, compared to other symmetric doublepeaked transitions).There is a blue-shifted absorption in Hβ reaching 4% below the continuum (comparable to E16, see Fig. 2).However, the contaminants in the red wing of Hβ, as well as the lack of a similar feature in other lines, preclude a definitive confirmation.An unambiguous detection of optical outflows during the soft state of a BHT remains elusive (but see Ponti et al. 2012;Sánchez-Sierras & Muñoz-Darias 2020;Muñoz-Darias & Ponti 2022;Parra et al. 2023 for wind detections at infrared and X-ray wavelengths).
To calculate ∆V we take the outburst peak V-band magnitude V outburst = 12.66 ± 0.01 (Alabarta et al. 2023), measured on day 4.8 (simultaneous to the peak at X-rays).We established a quiescent V-band magnitude of V quiescence = 20.31± 0.06 applying photometric system transformations (Jordi et al. 2006;Tonry et al. 2012) to the PS1 pre-outburst photometry.This leads to ∆V = 7.65 ± 0.06 and P orb = 7.57 ± 0.14 h.Following Faulkner et al. (1972), the combination of such P orb with the assumption of a Roche-Lobe filling dwarf companion star (with mean density as per Drilling & Landolt 2000) imply an early K spectral type.This result should be taken with some caution as different systematics might be at play (see e.g.López et al. 2019).

The distance to J1727
No radio parallax is known to date for J1727, while the parallax from Gaia DR3 (π = 0.03 ± 0.39 m.a.s.) results in an unconstraining posterior distribution (see e.g.XTE J1118+480 in Gandhi et al. 2019).We thus here employ different methods to constrain its distance and reddening.Casares (2018) presents an empirical correlation between the absolute r-band magnitude for BHTs in quiescence and P orb : M r = (4.64 ± 0.10) − (3.69 ± 0.16) log (P orb (d)).
Adopting P orb = 7.57±0.14h we obtain M r = 6.50±0.13.M r can be used in combination with the pre-outburst r-band magnitude (r = 19.95± 0.04) and A r extinction to calculate the distance.A r can be derived from the reddening to the source E(B − V), using A r /E(B − V) = 2.271 (Schlafly & Finkbeiner 2011) and (Savage & Mathis 1979;Fitzpatrick 2004).We apply several methods to constrain the colour excess E(B−V) and/or distance: -The equivalent width (EW) of the interstellar line K i 7699 is a known tracer of the reddening (Munari & Zwitter 1997), and covered during E5.Nearby telluric features limited the precision of its measurement as they affected the determination of the adjacent continuum.We employed a Monte Carlo approach to simulate 10 5 spectra using as a seed the original data and its observational uncertainties, and obtained EW = 0.21 ± 0.07 Å, implying E(B − V) = 0.9 ± 0.3, which results in d = 2.0 ± 0.7 kpc.
-The DIB at 8621 Å is also correlated with reddening (Wallerstein et al. 2007).Its equivalent width of EW = 0.18±0.06Å, measured with the same method as above, corresponds to E(B − V) = 0.8 ± 0.3 and to a distance of d = 2.2 ± 0.7 kpc.-The hydrogen column density was estimated from X-ray fitting to be in the range of N H = (2.26− 4.1) • 10 21 cm −2 (O' Connor et al. 2023;Draghis et al. 2023), with a mean value of N H = (3.2± 0.9) • 10 21 cm −2 , from which we derive E(B − V) = 0.47 ± 0.13 (Güver & Özel 2009) and d = 3.0 ± 0.5 kpc.Megier et al. (2009) studied the correlation of the interstellar Ca II doublet (H and K) with the distance to early-type stars beyond 1 kpc, taking into account the line saturation.J1727 appears to fulfil the conditions to apply this correlation [EW(K)/EW(H) > 1.3; and being no further than a few hundred parsecs from the Galactic plane].This results in d = 3.2 ± 0.6 kpc.We calculated the conditional probability resulting from the above methods.This results in E(B− V) = 0.57 ± 0.11, as well as d = 2.7 ± 0.3 kpc, and therefore, a height over the Galactic plane of z = 0.48 ± 0.05 kpc.

Conclusions
We present multi-epoch optical spectroscopy during the outburst of the newly discovered BHT J1727.We cover the main stages of the outburst, and report on the detection of diverse outflow features, including blue-shifted absorptions sometimes accompanied by red-shifted excesses (i.e.P-Cygni profiles), broad emission wings, and flat-top profiles, in the H Balmer series.We also report the detection of similar features in the higher excitation He ii-4686 Å line.The presence of red-shifted absorptions accompanied by blue emission wings in a number of epochs suggests the presence of inflows.Based on the current information available, we propose the following configuration for this system: a BHT with an early K-type companion, P orb ∼ 7.6 h, and placed at a distance of d = 2.7 ± 0.3 kpc (z = 0.48 ± 0.05 kpc over the Galactic plane).

Fig. 2 .
Fig.2.Normalised spectrum of five relevant spectroscopic epochs.They are offset vertically by 0.25 (0.3 in the right panel) for visualisation purposes; the colours correspond to their X-ray state, as defined in Fig.1.The identified transitions in this wavelength range are marked with dotted lines: black for H, red for He i, blue for He ii, and green for other metallic lines (Bowen blend at ∼ 4640 Å).Telluric bands and interstellar features are shown as grey and yellow shadowed regions, respectively.The E20 spectrum was smoothed through convolution with a Gaussian for visualisation purposes.

Fig. 3 .
Fig.3.Normalised spectrum of epochs E7 (green) and E11 (blue).They are representatives of the blue-shifted and red-shifted absorption features detected during the outburst.The identified transitions in this wavelength range are marked with black dashed lines (in the laboratory rest frame), while the velocities of ±900 km s −1 and ±1150 km s −1 (referred to the rest wavelength of each line after accounting for the systemic velocity) are marked with red and blue dashed lines, respectively.Telluric bands and interstellar features are shown as grey and yellow shadowed regions, respectively.

Fig. 4 .
Fig. 4. Pre-outburst quiescent counterpart of J1727 from PS1 r-band images.The position of the quiescent counterpart is marked with a white cross.

Table 1 .
Journal of observations.