11institutetext: Instituto de Astrofísica e Ciências do Espaço, Universidade
do Porto, CAUP, Rua das Estrelas, 4150-762 Porto, Portugal 22institutetext:
Departamento de Física e Astronomia, Faculdade de Ciências, Universidade do
Porto, Rua do Campo Alegre, 4169-007 Porto, Portugal 33institutetext: European
Southern Observatory, Alonso de Córdova 3107, Vitacura, Región Metropolitana,
Chile 44institutetext: Lund Observatory, Division of Astrophysics, Department
of Physics, Lund University, Box 118, 221 00 Lund, Sweden 55institutetext:
Observatoire de Genève, Département d’Astronomie, Université de Genève, Chemin
Pegasi 51, 1290 Versoix, Switzerland 66institutetext: Instituto de Astrofísica
de Canarias, E-38200 La Laguna, Tenerife, Spain 77institutetext: Departamento
de Astrofísica, Universidad de La Laguna, E-38206 La Laguna, Tenerife, Spain
88institutetext: INAF – Osservatorio Astronomico di Padova, Vicolo
dell’Osservatorio 5, 35122, Padova, Italy 99institutetext: Centro de
Astrobiología, CSIC-INTA, Camino Bajo del Castillo s/n, 28692 Villanueva de la
Cañada, Madrid, Spain 1010institutetext: Center for Space and Habitability,
University of Bern, Gesellsschaftsstr. 6, 3012 Bern, Switzerland
1111institutetext: Département de Physique, Institut Trottier de Recherche sur
les Exoplanètes, Université de Montréal, Montréal, Québec, H3T 1J4, Canada
1212institutetext: Univ. Grenoble Alpes, CNRS, IPAG, F-38000 Grenoble, France
1313institutetext: INAF – Osservatorio Astronomico di Trieste, via G. B.
Tiepolo 11, I-34143, Trieste, Italy 1414institutetext: Centre Vie dans
l’Univers, Faculté des sciences de l’Université de Genève, Quai Ernest-
Ansermet 30, 1205 Geneva, Switzerland 1515institutetext: Centro de
Astrobiología, CSIC-INTA, Crta. Ajalvir km 4, E-28850 Torrejón de Ardoz,
Madrid, Spain 1616institutetext: Centro de Astrobiología (CAB, CSIC-INTA),
ESAC campus, 28692, Villanueva de la Cañada (Madrid), Spain 1717institutetext:
Centro de Astrofísica da Universidade do Porto, Rua das Estrelas, 4150-762
Porto, Portugal 1818institutetext: INAF - Osservatorio Astronomico di Palermo,
Piazza del Parlamento 1, 90134 Palermo, Italy

# The atmospheric composition of the ultra-hot Jupiter WASP-178 b observed
with ESPRESSO††thanks: Based on Guaranteed Time Observations collected at the
European Southern Observatory under ESO programme 1104.C-0350 by the ESPRESSO
Consortium.

Y. C. Damasceno 112233 J. V. Seidel ESO Fellow33 B. Prinoth 3344 A. Psaridi 55
E. Esparza-Borges 6677 M. Stangret 88 N. C. Santos 1122 M. R. Zapatero-Osorio
99 Y. Alibert 1010 R. Allart Trottier Postdoctoral Fellow111155 T. Azevedo
Silva 1122 M. Cointepas 551212 A. R. Costa Silva 112255 E. Cristo 1122 P. Di
Marcantonio 1313 D. Ehrenreich 551414 J. I. González Hernández 6677 E.
Herrero-Cisneros 1515 M. Lendl 55 J. Lillo-Box 1616 C. J. A. P. Martins 111717
G. Micela 1818 E. Pallé 6677 S. G. Sousa 11 M. Steiner 55 V. Vaulato 55 Y.
Zhao 55 F. Pepe 55

(Received …)

###### Abstract

Context. Ultra-hot Jupiters (UHJ) have emerged as ideal testbeds for new
techniques to study exoplanet atmospheres, however, only a limited number of
them are currently well studied.

Aims. We search for atmospheric constituents for the UHJ WASP-178 b with two
ESPRESSO transits. Additionally, we show parallel photometry used to obtain
updated and precise stellar, planetary and orbital parameters.

Methods. The two obtained transits are analysed with narrow-band transmission
spectroscopy and with the cross-correlation technique to provide detections at
different altitude levels. We focus on searching for Na i, H$\alpha$,
H$\beta$, H$\gamma$, Mg i and Li i lines in narrow-band, as well as Fe i, Fe
ii and attempt to confirm Mg i in cross-correlation. We correct for the
Rossiter-McLaughlin effect and low S/N regions due to ISM Na i absorption. We
then verify our results via bootstrapping.

Results. We report the resolved line detections of Na i ($5.5\,\sigma$ and
$5.4\,\sigma$), H$\alpha$ ($13\,\sigma$), H$\beta$ ($7.1\leavevmode\nobreak\
\sigma$), and tentatively Mg i ($4.6\,\sigma$). In cross-correlation, we
confirm the Mg i detection ($7.8\,\sigma$ and $5.8\,\sigma$) and additionally
report the detections of Fe i ($12\,\sigma$ and $10\,\sigma$) and Fe ii
($11\,\sigma$ and $8.4\,\sigma$), on both nights separately. The detection of
Mg i remains tentative, however, due to the differing results between both
nights, as well as compared with the narrow-band derived properties.

Conclusions. None of our resolved spectral lines probing the mid- to upper
atmosphere show significant shifts relative to the planetary rest frame,
however H$\alpha$ and H$\beta$ exhibit line broadenings of $39.6\pm
2.1\leavevmode\nobreak\ \mbox{${\rm km\,s}^{-1}$}$ and $27.6\pm
4.6\leavevmode\nobreak\ \mbox{${\rm km\,s}^{-1}$}$, respectively, indicating
the onset of possible escape. WASP-178 b differs from similar UHJ with its
lack of strong atmospheric dynamics in the upper atmosphere, however the
broadening seen for Fe i ($15.66(0.58)$ ${\rm km\,s}^{-1}$) and Fe ii
($11.32(0.52)$ ${\rm km\,s}^{-1}$) could indicate the presence of winds in the
mid-atmosphere. Future studies on the impact of the flux variability caused by
the host star activity might shed more light on the subject. Previous work
indicated the presence of SiO cloud-precursors in WASP-178 b’s atmosphere and
a lack of Mg i and Fe ii. However, our results suggest that a scenario where
the planetary atmosphere is dominated by Mg i and Fe ii is more likely. In
light of our results, we encourage future observations to further elucidate
these atmospheric properties.

###### Key Words.:

Planetary Systems – Planets and satellites: atmospheres, individual: WASP-178
b – Techniques: spectroscopic – Line: profiles – Methods: data analysis

##  1 Introduction

Ultra-hot Jupiters (UHJ), defined as Jupiter-like planets with equilibrium
temperatures above 2000 K, have emerged as ideal testbeds within the exoplanet
community. Due to their close-in orbit around their host star, their
atmospheres tend to be dissociated into atoms or even ionised, proportioning a
bloated atmosphere where the absorptions’ depth and width can be translated
into height and velocity distribution. The inspection of multiple elements,
which sit in different regions of the atmosphere, allows for the holistic
exploration of these planets’ chemistry, temperature-pressure profile, and
atmospheric dynamics directly from data. A range of modelling and retrieval
techniques were either benchmarked or matured using data from UHJ, e.g. the
detection of a wide variety of chemical species (Hoeijmakers et al., 2019;
Prinoth et al., 2022), the retrieval of abundances (Gandhi et al., 2022;
Gibson et al., 2022; Pelletier et al., 2023), the observation of emission
features (Pino et al., 2020, 2022), and the observation of atmospheric
dynamics (Borsa et al., 2019; Ehrenreich et al., 2020; Seidel et al., 2021,
2023). However, due to their extreme conditions only a handful of suitable
targets for atmospheric characterisation fall into the category of UHJ. Among
the dozens of UHJ whose atmospheres have been already observed, the most
canonically studied are WASP-121 b (Delrez et al., 2016; Azevedo Silva et al.,
2022; Seidel et al., 2023), WASP-76 b (West et al., 2016; Tabernero et al.,
2021), WASP-189 b (Lendl et al., 2020b; Stangret et al., 2022; Prinoth et al.,
2022), and the hottest exoplanet to date, KELT-9 b (Gaudi et al., 2017;
Hoeijmakers et al., 2018; Wyttenbach et al., 2020; Borsato et al., 2023).
WASP-178 b has an equilibrium temperature of $2470\pm 60$ K, with a planetary
radius of $1.81\pm 0.09\leavevmode\nobreak\ \mbox{${\rm R}_{\mathrm{J}}$}$, a
mass of $1.66\pm 0.12\leavevmode\nobreak\ \mbox{${\rm M}_{\mathrm{J}}$}$ and
an insolation of $5550^{+1250}_{-630}$ ${S}_{\oplus}$ (Hellier et al., 2019;
Rodríguez Martínez et al., 2020) (see Fig. 1, WASP-178 b marked as a black
star). For context, this puts WASP-178 b between WASP-121 b and WASP-76 b in
terms of insolation. However, differing from these two targets, WASP-178 is
the second hottest star known to date hosting an exoplanet, a type A1 IV-V
star with an effective stellar temperature of $9350\pm 150$ K (Hellier et al.,
2019) and with an apparent magnitude in the visible band of $9.95$.

Figure 1: Exoplanets in the radius vs insolation plot, in terms of Earth’s
values. The ultra-hot Jupiter WASP-178 b is marked with a black star. WASP-121
b, WASP-76 b and WASP-189 b, mentioned in the introduction, are marked as
orange stars.

WASP-178 b has been studied previously with CHEOPS111CHaracterising ExOPlanets
Satellite and TESS222Transiting Exoplanet Survey Satellite and was found to be
in a near pole-on geometry with a rotation period of the star similar to the
orbital period of the planet (Pagano et al., 2023). They find efficient heat
transport from the day to the night side, thus observationally challenging the
current theory that heat transport by zonal winds becomes less efficient with
increasing equilibrium temperature (e.g Perez-Becker & Showman, 2013; Komacek
et al., 2017; Schwartz et al., 2017; Parmentier & Crossfield, 2018).
Additionally, WASP-178 b was observed with HST/WFC3/UVIS finding one of the
largest NUV spectral features to date (Lothringer et al., 2022). They find no
transit asymmetry indicating that signals are present on both terminators.
Photochemical hazes are ruled out due to a lack of scattering slope and their
observed spectral features can be explained by either SiO at solar abundance
or an atmosphere dominated by Mg i and Fe ii at super-solar abundances with no
SiO. Surprisingly, they report non-detections for Fe i and Fe ii.

In this work, we present two transit observations of WASP-178 b obtained with
the ESPRESSO333Echelle SPectrograph for Rocky Exoplanets and Stable
Spectroscopic Observations spectrograph. The manuscript is structured as
follows: in Sect. 2 we report on the data quality of the two transits and our
data reduction, Sect. 3 analyses the parallel photometry taken with EulerCam
at the Swiss 1.2m Euler telescope. Sections 4 and 5 show the narrow-band and
cross-correlation transmission analysis and detections, respectively, which
are then put in context with the mentioned literature in Sect. 6.

##  2 ESPRESSO Observations and Data Analysis

We observed the WASP-178 system capturing two full transits of the ultra-hot
Jupiter WASP-178 b. The target was observed with ESPRESSO (Pepe et al., 2021)
in HR21 mode ($\mathcal{R}\leavevmode\nobreak\ \approx 140.000$), installed at
ESO’s VLT telescopes in the Paranal Observatory in Chile. The transits were
observed on the nights of 2021 May 03 and 2021 July 09, with the UT4 and UT2
telescopes, respectively. Both observations were performed with fibre A on the
target and fibre B on the sky to monitor telluric emission.

On the first night, $48$ spectra were taken, the first $13$ with an exposure
time of $300$ s and, due to a consistently high seeing, the remaining $35$
with $500$ s. On the second night, $61$ spectra were taken all with an
exposure time of $300$ s. In total, the two nights resulted in $109$ spectra,
of which $58$ were taken in-transit and $51$ were out-of-transit. In both
nights the transits were observed from start to finish, with the first night
presenting higher signal-to-noise ratio (S/N) consistency. The airmass, seeing
and S/N of each exposure are shown in Fig. 2 and in Table 1. The S/N shown in
both is for order $116$. The spectra are reduced using the ESPRESSO data
reduction pipeline (DRS version 3.0.0), queried from the
DACE444https://dace.unige.ch/ platform and the orders are extracted and
corrected for the blaze function. In this study, we work in narrow-band with
the S2D blaze-corrected and sky-subtracted spectra. We focus on the paired
orders containing the Na i doublet ($116$ and $117$), the H$\alpha$ line
($138$ and $139$), the H$\beta$ line ($70$ and $71$), the H$\gamma$ line ($40$
and $41$), the Mg i b triplet ($86$ and $87$), and the Li i resonant line
($142$ and $143$). We search as well throughout the entire wavelength range of
ESPRESSO for Fe i, Fe ii and Mg i in cross-correlation using the S2D spectra
without blaze correction nor sky subtraction.

Table 1: Overview of the two transit observations for WASP-178 b

Date |  $\\#$ Spectra1 | Exp. Time [s] | Airmass | Seeing | S/N $\\#$116
---|---|---|---|---|---
2021-03-05 | 48 (23/25) | 300 and 500 | 1.55 - 1.05 - 1.30 | 1 to 1.7 | 27 to 71
2021-07-09 | 61 (35/26)2 | 300 | 1.08 - 1.05 - 2.05 | 0.4 to 1.2 | 0 to 64 3

Note: 1 In parentheses are the in-transit and out-of-transit spectra,
respectively. 2 $7$ spectra were discarded due to low S/N, leaving $32$ in-
transit and $22$ out-of-transit spectra. 3 After removing the low S/N spectra
the lowest S/N value was $18$.

Figure 2: Conditions of the first (blue markers) and second (orange markers)
observed transits showing the airmass (top panel), seeing (middle panel) and
the S/N (bottom panel) for each exposure. The S/N shown is calculated from the
Na i D doublet orders. The dashed black lines show the beginning and end of
transit. The red dashed line marks the S/N = $15$ threshold below which
exposures were discarded. The circular markers correspond to $300$ s exposures
while the lighter-shaded triangular markers are used for $500$ s exposures.

###  2.1 Data reduction

The spectra from both transits, as reduced via the ESPRESSO DRS, are given in
the reference frame of the Solar System barycentre, the wavelength in air and
blaze-corrected.

The second night of observations was affected by clouds resulting in $7$
exposures with low S/N ($\leq$ $15$). As a consequence we discarded these
spectra, leaving a total of $102$ spectra, $55$ in-transit and the remaining
$47$ out-of-transit. The data reduction done by the ESPRESSO DRS corrects for
most cosmic rays, however few are still present in the reduced data. In each
exposure, we rejected the remaining cosmic rays using a $6$ $\sigma$ clipping
routine on the flux difference between adjacent wavelength bins. The rejected
points were then replaced by the mean of the $6$ nearest values. We replaced,
between all exposures from both nights, a total of $24$ data points in orders
$50$ and $41$, $54$ points in orders $70$ and $71$, $24$ points in orders $86$
and $87$, $75$ points in orders $116$ and $117$, $65$ points in orders $138$
and $139$, and $75$ points in orders $142$ and $143$. This accounts to an
overall less than $0.0002\leavevmode\nobreak\ \%$ of the reduced data in these
orders being affected.

###  2.2 Telluric correction

Ground-based observations are subject to contamination from Earth’s
atmosphere. Telluric contamination is time variable and depends on the airmass
and water vapour column in the line of sight. We performed the telluric
correction using molecfit version 1.5.1 (Smette et al., 2015; Kausch et al.,
2015), an ESO software developed for modelling the Earth’s spectral features
for ground-based observations. This approach to telluric absorption correction
has been used in the exoplanetary field in high-resolution spectroscopy data,
such as for HARPS555High Accuracy Radial velocity Planet Searcher spectra
(Allart et al., 2017) and on ESPRESSO data (Allart et al., 2020; Tabernero et
al., 2021; Seidel et al., 2022). For further details on molecfit’s application
to exoplanet spectra see Allart et al. (2017).

In the spectral range probed by ESPRESSO, the elements responsible for most of
the contamination are H2O, O2 and O3. Considering the orders addressed in this
work we include only the contributions from H2O when computing the telluric
model spectra, since O3 affects the visible wavelength range via broadband
absorption and O2 lines were masked for the cross-correlation analysis. The
telluric model for H2O was fitted on the wavelength range near the sodium
doublet, in orders $115$ and $116$. In these orders, the telluric lines are
not very prominent, so the fitting region had to be carefully selected such
that it did not include any stellar features. The fitted telluric model was
then applied to all orders. For the spectral regions studied in narrow-band
this correction was sufficient, while for the cross-correlation analysis we
corrected for O2 by masking its respective features. Figure 3 shows the mean
spectrum over all exposures, normalised for better visibility, before and
after the telluric correction, as well as the model telluric spectrum. As we
can see from Fig. 3 the telluric lines are corrected down to the noise level.
We additionally verified from fibre B there was no emission from telluric
sodium during our observations.

Figure 3: Mean spectrum before (solid black line) and after (solid green line)
the telluric correction, for the first night of observations in the Earth’s
rest frame. The telluric model averaged over all exposures is represented by
the dashed blue line.

###  2.3 ISM Na i Absorption

Near the stellar Na i Fraunhofer lines, we identified three additional
absorption features. The stellar lines are shifted by $-23.43(0.02)$ ${\rm
km\,s}^{-1}$ with respect to the Solar System barycentre’s rest frame, which
is consistent with the expected system velocity reported in Hellier et al.
(2019), considering the $0.5$ ${\rm km\,s}^{-1}$ bin size of ESPRESSO. During
the first transit, the three right-most lines are shifted by $-10.41(0.02)$,
$4.10(0.09)$ and $14.72(0.01)$ ${\rm km\,s}^{-1}$, and on the second transit
the velocities are $-10.42(0.03)$, $3.88(0.12)$ and $14.72(0.01)$ ${\rm
km\,s}^{-1}$. The line centres were estimated through a least squares Gaussian
fit. Each pair of lines is shifted equally from the expected position of the
doublet on both nights, indicating they are not of telluric origin. In Fig. 4
the spectrum portions near the sodium doublet are shown in velocity space with
respect to each of the doublet’s lines. Given these lines follow the stellar
features they are likely caused by separate interstellar medium (ISM) clouds
with different radial velocities.

We treated the ISM lines the same way as the stellar lines, by including them
in the master out-of-transit spectrum. Due to the very low S/N around the
deepest ISM line, we masked a $0.22$ $\AA$ band around its line centre. The
masked values were replaced with the local continuum, which was determined as
the mean of the $1$ $\AA$ band towards the red of the mask since the adjacent
points towards the blue contain another ISM absorption line. Given the
calculated planet and star velocities, a planetary sodium absorption feature
is expected to not cross the masked region in any of the exposures so this
process should not affect the results.

Figure 4: Average normalised spectrum for the first (solid blue line) and
second (solid yellow line) transits, showing the vicinity of the sodium D2
(top panel) and D1 (bottom panel) lines. The yellow line has an added offset
for better visibility. The spectrum is shown in function of the Doppler
velocity with reference to the rest-frame wavelength of each line in the Solar
System barycentre.

###  2.4 Rossiter-McLaughlin effect modelling

The Rossiter-McLaughlin (RM) effect (Holt, 1893; Rossiter, 1924; McLaughlin,
1924) is a result of the non-uniformity throughout the stellar surface, with
contributions from the limb darkening and stellar rotation, which affects the
in-transit data as the planet passes through different portions of the stellar
disk (Casasayas-Barris et al., 2020). This effect can be measured from the
radial velocities (RVs) as they deviate from the Keplerian motion of the star
during a transit. The exact pattern imprinted in the RVs and the spectra
depends on the orbit architecture as well as the stellar and planetary
parameters (Triaud, 2018).

Here, we studied the obliquity of the system by analysing the RM signal
imprinted in the RV measurements and measuring the sky-projected spin-orbit
angle $\rm\lambda$. We combined the RV measurements of both transits using a
$\rm 14.4\leavevmode\nobreak\ min$ binning and extracted the RM signal by
subtracting a linear fit from the out-of-transit RVs. The approach used by the
ESPRESSO DRS pipeline to measure the RV is based on the fitting of a Gaussian
to the cross-correlation function (CCF) (find this technique detailed in
Baranne et al., 1996; Pepe et al., 2002). Accordingly, we analysed the RM
signal using a Python implementation of ARoME666ARoME code is publicly
available at http://www.astro.up.pt/resources/arome/ (Boué et al., 2013),
which is a code specially designed to model the RV data extracted by the CCF
approach. Based on ARoME models and the parameters from Hellier et al. (2019),
we performed a Markov Chain Monte Carlo (MCMC) fitting of the RM signal with
emcee (Foreman-Mackey et al., 2013) using 11 chains of 5000 steps each. During
the fitting we left as free parameters the mid-transit time ($\rm T_{0}$), the
sky-projected spin-orbit angle ($\rm\lambda$) and the projected stellar
rotational velocity ($v\sin{i}$). We imposed wide uniform priors on the three
free parameters: $\rm-0.02\leavevmode\nobreak\
days<T_{0}<0.02\leavevmode\nobreak\ days$, $\rm-90\leavevmode\nobreak\
deg<\lambda<160\leavevmode\nobreak\ deg$, $\rm-60\leavevmode\nobreak\
kms^{-1}<v\sin{i}<60\leavevmode\nobreak\ kms^{-1}$. Additionally, we fixed the
rest of planetary, stellar and instrumental parameters in the fitting,
including the limb-darkening coefficients that were estimated through LDTk
(Parviainen & Aigrain, 2015).

As a result of the RM analysis, we found WASP-178 b to be a misaligned planet,
measuring $\rm\lambda=105.7^{+3.6}_{-4.2}\leavevmode\nobreak\ deg$, which is
consistent with the value presented in Rodríguez Martínez et al. (2020) within
the $3\leavevmode\nobreak\ \sigma$ level. We show the best-fit RM model and RM
models within $\rm 1\leavevmode\nobreak\ \sigma$ in Fig. 5. We present the
posterior distributions from the fitting in Fig. 6. The stellar $v\sin
i_{\ast}$ result shows a $3\leavevmode\nobreak\ \sigma$ difference from the
literature value of $8.2(0.6)$ ${\rm km\,s}^{-1}$ (Hellier et al., 2019),
which can be associated with the use of updated system parameters. The effect
of this difference in the RM profiles is small and, for this reason, has no
notable impact on our results. The unusually low rotational velocity for a
spectral type A star might be explained if we are observing it on a near pole-
on position, a hypothesis posed in Rodríguez Martínez et al. (2020) and
supported by results in Pagano et al. (2023).

Figure 5: Rossiter-McLaughlin signal imprinted in the first transit (green
crosses), second transit (blue crosses) and combined (black dots) RV time
series. Additionally, in the top panel the best RM model from the ARoME \+
emcee fitting (magenta) and models within $\rm 1\sigma$ (light pink) are
shown. The bottom panel contains the residuals of the combined RV time series.
Figure 6: Resulting posterior distributions for the three free ($\rm T_{0}$,
$\rm\lambda$ and $v\sin{i}$) parameters from the RM fitting.

We corrected for the RM effect using the
StarRotator777https://github.com/Hoeijmakers/StarRotator code, which estimates
the star’s spectrum during a transit via numerical integration of the stellar
disk, allowing us to obtain a model for the stellar spectrum behind the planet
at each phase. We generated the simulated star in a $400\times 400$ grid
without differential rotation and considered the limb darkening coefficients
determined from the simultaneous photometry. The model spectra were taken from
the PHOENIX database (Husser et al., 2013) for each observed phase of the
transit and included the centre-to-limb variations with a quadratic limb-
darkening law. The RM effect at each input phase is obtained by dividing the
in-transit spectra by the out-of-transit and convolving with the instrumental
resolution (considered $140.000$ for the ESPRESSO mode used). We used the
stellar and planetary parameters listed in Table 3, except for Teff, log(g),
[Fe/H], which we rounded up to the nearest allowed values, $9400$ K, 4.5 dex
(in cgs units) and 0.0 dex (in solar metallicity), respectively. The resulting
residuals are then used to correct for the RM effect on all in-transit
exposures.

##  3 Simultaneous photometry with EulerCam

We observed four full transits of WASP-178 b with the EulerCam instrument
(Lendl et al., 2012) installed on the 1.2 m Euler telescope in La Silla. The
transits were observed in the $r’-Gunn$ filter on 2021 May 03, 2021 June 29,
2021 July 09 and 2023 April 02 with exposure times of 110 s, 40 s, 42 s, and
33 s, respectively. On the nights of 2021 May 03 and 2021 July 09 the transits
were obtained simultaneously with ESPRESSO. We reduced the data with the
standard bias subtraction and flat correction procedure. The light curves were
extracted using relative aperture photometry with apertures ranging from 30 to
44 pixels. The choice of reference stars and aperture size minimizes the root
mean square (RMS) scatter in the out-of-transit portion.

Since the photometric data are affected by correlated noise due to
observational, instrumental, or stellar effects, we used a combination of
first- and second-order polynomial baseline models in different variables
(time, FWHM, airmass, coordinate shifts, sky background). The best combination
of variables for each data set is established using the Bayesian Information
Criterion (Table 2). We detrended the light curves and derived the system
parameters using CONAN (Lendl et al. (2020a)), a Markov chain Monte Carlo
(MCMC) framework. Uniform priors were used for the fitting of
$R_{p}/R_{\ast}$, $b$, T0, $P$, and T14. The quadratic limb-darkening
coefficients and their uncertainties were derived using the
LDCU888https://github.com/delinea/LDCU code (Deline et al., 2022) based on the
stellar parameters derived by Hellier et al. (2019) and fitted using Gaussian
priors. We also accounted for additional white noise by including a jitter
term for each light curve. The set of planetary and stellar parameters
obtained and used are listed in Table 3. The EulerCam light curves, together
with their best-fit models are presented in Fig. 7.

Table 2: Summary of the EulerCam light curves.

Date | Aperture (pixels) | Detrending
---|---|---
2021-05-03 | 44 | $p(x^{2}+y+FWHM^{2})$
2021-07-09 | 30 | $p(t^{2}+x^{2}+y+FWHM+sky^{2})$
2021-06-29 | 30 | $p(t^{2}+FWHM^{2})$
2023-04-02 | 30 | $p(AM^{2}+x+y+FWHM+sky)$

  * •

Notes: The notation of the baseline models for,
$\textit{p(j}^{\textit{i}}\textit{)}$, refers to a polynomial of degree i in
parameter j (t:time, AM:airmass, FWHM:stellar FWHM and sky:sky background).
The notation of GPs refers to Gaussian Processes.

Table 3: Summary of the stellar and planetary parameters of the WASP-178
system adopted in this study.

WASP-178 System parameters
---
RA2000 |  15:09:04.89 |  [4]
DEC2000 |  -42:42:17.8 |  [4]
Parallax $p$ [mas] |  $2.3119(0.0600)$ |  [4]
Magnitude [Vmag] |  9.95 |  [4]
Systemic velocity ($v_{\rm sys}$) [$\mathrm{km}\text{\,}{\mathrm{s}}^{-1}$] |  $-23.908(0.007)$ |  [2]
Stellar parameters
Star radius ($R_{\ast}$) [$R_{\odot}$] |  $1.772(0.020)$ |  [3]
Star mass ($M_{\ast}$) [$M_{\odot}$] |  $2.169^{+0.083}_{-0.089}$ |  [3]
Proj. rot. velocity ($v\sin{i}$) [$\mathrm{km}\text{\,}{\mathrm{s}}^{-1}$] |  $10.48^{+0.63}_{-0.56}$ |  [1]
Age [Gyr] |  $0.05^{+0.06}_{-0.05}$ |  [3]
Effective Temperature (Teff) [K] |  $9350\pm 150.$ |  [2]
Surface gravity ($\log g_{\star}$) [$\log g_{\odot}$] |  $4.35(0.15)$ |  [2]
Metallicity ([Fe/H]) [[Fe/H]⊙] |  $0.21(0.16)$ |  [2]
Planetary parameters
Planet radius ($R_{\rm p})$ [$R_{\rm Jup}$] |  $1.796(0.022)$ |  [1]
Planet mass ($M_{\rm p}$) [$M_{\rm Jup}$] |  $1.66(0.12)$ |  [2]
Eq. temperature ($T_{\rm eq}$) [$\mathrm{K}$] |  $2470\pm 60.$ |  [2]
Density ($\rho$) [$\mathrm{g}\text{\,}{\mathrm{cm}}^{-3}$] |  $0.632(0.051)$ |  [1]
Surface gravity ($\log g_{\rm p}$) [cgs] |  $3.106(0.033)$ |  [1]
Orbital and transit parameters
Transit centre time ($T_{0}$) [HJD (UTC)] |  $2459338.19728^{+0.00007}_{-0.00015}$ |  [1]
Period ($P$) [d] |  $3.3448371^{+0.0000010}_{-0.0000011}$ |  [1]
Orbital semi-major axis ($a$) [au] |  $0.0561^{+0.0005}_{-0.0013}$ |  [1]
Scaled semi-major axis ($a/R_{\ast}$) |  $7.00^{+0.03}_{-0.13}$ |  [1]
Orbital inclination ($i$) [∘] |  $85.50^{+0.09}_{-0.29}$ |  [1]
Projected orbital obliquity ($\lambda$) [∘] |  $105.7^{+3.6}_{-4.2}$ |  [1]
Impact parameter ($b$) |  $0.549^{+0.025}_{-0.008}$ |  [1]
Eclipse duration ($T_{14}$) [h] |  $3.532^{+0.019}_{-0.004}$ |  [1]
Radius ratio ($R_{p}/R_{\ast}$) |  $0.10716^{+0.00047}_{-0.00039}$ |  [1]
RV semi-amplitude ($K_{\star}$) [$\mathrm{km}\text{\,}{\mathrm{s}}^{-1}$] |  $0.139(0.009)$ |  [2]
Eccentricity ($e$) |  $0$ (fixed) |  -
Derived parameters
Planetary orbital velocity ($v_{\rm orb}$) [$\mathrm{km}\text{\,}{\mathrm{s}}^{-1}$] |  $182.3(2.6)$ |
Approx. scale height ($H$) [$\mathrm{km}$] |  $732\pm 59.$ |
Transit depth of $H$ ($\delta F/F$) [$\times 10^{-5}$] |  $13.1(1.1)$ |

(1) This work; (2) Hellier et al. (2019); (3) Pagano et al. (2023); (4) Gaia
Collaboration et al. (2018)

Figure 7: The four detrended EulerCam transit observations of WASP-178 b with
an offset of $0.02$ for visibility. In the top panel the data is represented
by the gray points and the best-fit model is represented by the red lines,
with the corresponding date displayed above each set. The blue points
correspond to the x$20$ binned data. The bottom panel contains the residuals
for each night relative to the dashed black line, in the same order.

On the date of the second ESPRESSO transit (2021 July 09) we noticed a
deviation from the lightcurve fitted model starting around the end of ingress.
This pattern can be caused by the passage of the planet in front of a spot on
the surface of the star. Although WASP-178 is an A type star, for which
magnetic activity is not expected, these stars may still present some level of
magnetic activity phenomena (Rackham et al., 2019). In order to safeguard from
the influence of a possible active region, the 5 affected in-transit spectra
between $-0.054$ and $-0.030$ days from the transit centre were discarded from
the analysis. Without these exposures the S/N of the second transit’s
transmission spectrum in the Na i doublet orders drops from $402$ to $386$,
while for the first transit we reach a S/N of $456$ in these orders.

##  4 Transmission spectroscopy of WASP-178 b

To construct the transmission spectrum we combined the out-of-transit spectra
in the stellar rest frame into the master-out spectrum, which contains the
mean stellar spectrum. The master-out as well as the RM model were divided out
of the in-transit data, leaving behind the planetary atmosphere’s signal.
These spectra were then shifted to the planetary rest frame and combined into
the transmission spectrum. We executed this process for each night separately
to evaluate any variations between them. No significant difference was noticed
between both nights’ transmission spectra, so these were combined to form a
higher S/N transmission. For more details on the methodology followed, we
refer to Wyttenbach et al. (2015) and Seidel et al. (2019).

It is known that the Coudé Train optics of ESPRESSO leave interference
patterns on the data in the form of pseudo-sinusoidal waves (Allart et al.,
2020; Tabernero et al., 2021; Sedaghati et al., 2021). These interference
patterns are most prominent after removing the stellar out-of-transit spectrum
and are a conjunction of a high-frequency wave ($\sim$ 1 $\AA$ period) and a
lower frequency wave ($\sim$ 30 $\AA$ period). The higher-frequency wiggles
have a smaller amplitude and can be neglected as they are hidden in the noise.
On the other hand, the lower frequency wiggles present a significant effect on
the transmission spectra around the Na i doublet. We corrected this trend by
masking the sodium lines and using a cubic splines fit to the over-binned
(x600) transmission spectrum of each transit. The effect of the wiggles was
not noticeable in the remaining orders addressed in this work.

###  4.1 Transmission lines fitting

The transmission lines were binned and fitted with Gaussian profiles using a
Bayesian MCMC approach. In Figs. 8-11 the transmission lines for the Na i
doublet, H$\alpha$, H$\beta$ and the Mg i b1 lines are shown, respectively,
with their best-fit profile. In the case of the Li i and H$\gamma$ lines, no
signal was identified, as we can verify from Figs. 12-13. The resulting line
fit parameters are shown in Table 4. We use the central wavelength and FWHM of
the fitted Gaussians to derive the equivalent line centre shift and broadening
in terms of velocity. The detection level is computed as the ratio between the
fitted line amplitude and its positive uncertainty, obtained from the
parameter’s probability distribution, propagated with the false-positive
probability, discussed further in Sect. 4.2.

We relate the absorption line depths with the area covered by the respective
element and translate the line profiles to equivalent heights and velocity
distributions, shown in Figs. 15-18. For the Na i doublet we co-added the
lines in velocity space with respect to their expected position. We illustrate
as well the instrumental broadening and the escape velocity, $v_{\rm esc}$,
with height $h$ above the opaque planetary disk, calculated via Eq. 1, for
comparison.

$v_{esc}=\sqrt{\frac{2GM_{p}}{(R_{p}+h)}}$ (1)

With the detection of two of hydrogen’s Balmer series lines we are able to
estimate the temperature in the thermosphere layer. This can be done through
Boltzmann’s equation, using the H$\alpha$ and H$\beta$ lines to estimate the
ratio between hydrogen atoms in the second and third excited states. Since we
do not have the true continuum of the planetary spectrum we may use the
equivalent widths measured from the transmission spectrum as a probe for the
ratio between the electronic levels.

Table 4: Median values of the Gaussian fit parameters and 68% confidence
intervals from the probability distribution for the narrow-band detections.

| Amplitude [%] | FWHM $\left[\AA\right]$ | Centre $\left[\AA\right]$ | VFWHM $\left[\mbox{${\rm km\,s}^{-1}$}\right]$ | Centre shift $\left[\mbox{${\rm km\,s}^{-1}$}\right]$ | Detection
---|---|---|---|---|---|---
Na i D2 | -0.338${}^{+0.053}_{-0.056}$ | 0.186${}_{-0.036}^{+0.044}$ | 5889.953${}_{-0.012}^{+0.013}$ | 9.5${}_{-1.8}^{+2.2}$ | 0.14${}_{-0.60}^{+0.65}$ | 5.5$\sigma$
Na i D1 | -0.314${}_{-0.055}^{+0.049}$ | 0.160${}_{-0.034}^{+0.037}$ | 5895.966${}_{-0.014}^{+0.012}$ | 8.1${}_{-1.7}^{+1.8}$ | 2.18${}_{-0.79}^{+0.65}$ | 5.4$\sigma$
H$\alpha$ | -0.717${}_{-0.039}^{+0.038}$ | 0.866${}_{-0.044}^{+0.047}$ | 6562.724${}_{-0.023}^{+0.022}$ | 39.6${}_{-2.0}^{+2.1}$ | -3.5${}_{-1.0}^{+1.0}$ | 13$\sigma$
H$\beta$ | -0.462${}_{-0.062}^{+0.060}$ | 0.447${}_{-0.065}^{+0.075}$ | 4861.338${}_{-0.028}^{+0.032}$ | 27.6${}_{-4.0}^{+4.6}$ | 0.3${}_{-1.7}^{+1.9}$ | 7.1$\sigma$
Mg i b1 | -0.200${}_{-0.031}^{+0.030}$ | 0.477${}_{-0.081}^{+0.092}$ | 5183.427${}_{-0.038}^{+0.034}$ | 27.6${}_{-4.7}^{+5.3}$ | -10.2${}_{-2.2}^{+2.0}$ | 4.6$\sigma$
Li i resonant line | … | … | … | … | … | ¡$3\leavevmode\nobreak\ \sigma$
H$\gamma$ | … | … | … | … | … | ¡$3\leavevmode\nobreak\ \sigma$

Note: The amplitude [%], FWHM [$\AA$] and centre [$\AA$] were the fitted
parameters while the remaining values shown were derived. The Li i and
H$\gamma$ were not detected in the narrow-band transmission spectrum and as
such we did not fit any profile.

Figure 8: ESPRESSO transmission spectrum of WASP-178 b on the planetary rest
frame around the Na i doublet. Top panel: The grey points represent the
unbinned data, the blue points represent the data binned by x20 and the
Gaussian fit to the sodium doublet lines is shown by the solid red line. The
expected line centres are marked by the dashed black lines. Bottom panel: The
residuals of the fit are shown, with the black dots corresponding to the
binned data. Figure 9: Same as Fig. 8 for the H$\alpha$ line. Figure 10: Same
as Fig. 8 for the H$\beta$ line. Figure 11: Same as Fig. 8 for the Mg i b1
line. Figure 12: Same as Fig. 8 for the Li i line. The data show no absorption
signal in this region. Figure 13: Same as Fig. 8 for the H$\gamma$ line. The
data show no absorption signal in this region.

###  4.2 Bootstrap Analysis

We performed a bootstrap analysis through empirical Monte-Carlo (EMC) methods
to assess the possibility that the absorption features are induced by spurious
signals or systematic errors, and quantify it through the false-positive
probability. We followed the approach in Redfield et al. (2008) by comparing
the results achieved from three simulated scenarios: in-in, out-out and in-
out. In all scenarios, we sampled with repetition exposures to form virtual
in-transit and out-of-transit sets, each with 18 spectra. In the out-out
scenario, both virtual sets contain spectra sampled from the real out-of-
transit set, while the opposite is done for the in-in scenario. The third
scenario is the in-out, where the virtual in-transit and out-of-transit sets
contain real in-transit and out-of-transit spectra, respectively.

In each of the scenarios, we built the transmission spectrum following the
steps previously discussed and computed the relative depth of the central
wavelength passband in comparison to adjacent red and blue passbands. We
defined central passbands with widths of 12 $\AA$ around the centre of the Na
i doublet, 10 $\AA$ around the H$\alpha$ line and 6 $\AA$ around the H$\beta$
and Mg i b1 lines. The red and blue passbands were defined with widths of 6
$\AA$ for the sodium doublet, the H$\beta$ and the Mg i b1 lines and of 10
$\AA$ for the H$\alpha$ line.

We performed 10,000 iterations of the in-in, out-out and in-out scenarios on
each night separately and built the transmission spectra. The relative depth
distributions are shown in Figs. 19-20 for the Na i doublet, the H$\alpha$,
H$\beta$ and Mg i b1 lines. We fitted a Gaussian profile to each of the
distributions and recorded the in-out absorption depth, the standard deviation
of the out-out distribution, $\sigma_{\mathrm{out-out}}$, and the false-
positive probability in Table 5. The false-positive probability is derived
from $\sigma_{\mathrm{out-out}}$ and quantifies the possibility of a spurious
detection from other than the planet’s atmosphere, since the out-out scenario
is composed of only out-of-transit spectra. If the signal observed in the
transmission spectrum is of planetary origin we expect the distributions to be
centered around 0, with the in-out distribution shifted.

In all cases the in-in and out-out scenarios are centred around $0.0$ $\%$,
deviating at most $0.005$ $\%$, as expected. The in-out scenarios for the Na i
doublet and H$\alpha$ show deviations of over $-0.19$ $\%$ and $-0.14$ $\%$,
respectively, indicating the signals are of planetary origin. The case for the
H$\beta$ line shows a similar result, although with a relatively smaller
deviation. For the Mg i b1 line we cannot take this conclusion since the in-
out distributions are drifted by an order of magnitude less from $0.0$ $\%$,
indicating the absorption is little to none. On top of this, the second
night’s in-out distribution shows a positive shift, which corresponds to an
emission signal, further deeming these results as inconclusive. We take the
false-positive probability as the standard deviation of the out-out scenario,
corrected to the real number of in- and out-of-transit exposures. We conclude
from the bootstrap analysis that the Na i doublet has a false-positive
probability of $0.047\leavevmode\nobreak\ \%$ and $0.037\leavevmode\nobreak\
\%$ for the two transits, respectively. These values are
$0.056\leavevmode\nobreak\ \%$ and $0.057\leavevmode\nobreak\ \%$ for
H$\alpha$, $0.033\leavevmode\nobreak\ \%$ and $0.038\leavevmode\nobreak\ \%$
for H$\beta$ and for Mg i they are $0.043\leavevmode\nobreak\ \%$ and
$0.041\leavevmode\nobreak\ \%$.

Table 5: Results from the EMC bootstrap method for the narrow-band results.  |  | in-out centre [$\%$] |  $\sigma_{out-out}$ [$\%$] | False-Positive probability [$\%$]
---|---|---|---|---
Na i | 2021 May 03 | -0.19 | 0.065 | 0.047
2021 July 09 | -0.19 | 0.055 | 0.037
H$\alpha$ | 2021 May 03 | -0.15 | 0.077 | 0.056
2021 July 09 | -0.14 | 0.086 | 0.057
H$\beta$ | 2021 May 03 | -0.040 | 0.045 | 0.033
2021 July 09 | -0.036 | 0.056 | 0.038
Mg i b1 | 2021 May 03 | -0.011 | 0.059 | 0.043
2021 July 09 | 0.012 | 0.061 | 0.041

##  5 Cross-correlation analysis

To confirm the detection of Mg i and search for Fe i and Fe ii, we further
analyzed the two transit time series using the cross-correlation technique
(Snellen et al., 2010), following the methodology in Hoeijmakers et al.
(2020), only including exposures with sufficient S/N, see Sect. 2. We used
tayph999https://github.com/Hoeijmakers/tayph to perform the cross-correlation
analysis on the S2D spectra. In particular, we corrected the spectra for
telluric contamination by dividing out the best-fit telluric profiles, see
Section 2 and then performed a velocity correction for the stellar reflex
motion, leaving all spectra at a constant velocity shift that is consistent
with the systemic velocity. Following Hoeijmakers et al. (2020), we applied a
colour correction to the individual orders to account for variations in the
broad-band continuum throughout the observations (see Hoeijmakers et al.,
2020, for a more detailed discussion) and rejected outliers by applying an
order-by-order sigma clipping algorithm with a width of 40 px. This algorithm
computes a running median absolute deviation over sub-bands and any value
deviating more than 5$\,\sigma$ from the running median in any given band was
masked out, thus rejected, and interpolated. Additionally, we manually flagged
columns in the data where the telluric correction left systematic residuals,
in particular in the region of deep O2 bands, and rejected the reddest order
because Mg i, Fe i and Fe ii are not expected to absorb significantly at the
reddest orders. The rejection of outliers and manual masking affected 4.31%
and 13.53% of the pixels in the time series of 2021 May 03 and 2021 July 09
respectively. Using cross-correlation templates from Kitzmann et al. (2023) at
a temperature of $2500\text{\,}\mathrm{K}$ (neutrals) and
$4000\text{\,}\mathrm{K}$ (ion) , we searched for Mg i, Fe i and Fe ii. To fit
for the Rossiter-McLaughlin effect, we constructed an empirical model based on
the two-dimensional cross-correlation maps for each species individually,
fitting a Gaussian with two components similar to Prinoth et al. (2022) and
dividing it out, see Fig. 22. Any residual broad-band variation was removed by
a high-pass filter of a width of
$100\text{\,}\mathrm{km}\text{\,}{\mathrm{s}}^{-1}$. Finally, we converted the
two-dimensional cross-correlation maps into Kp-Vsys-maps, see Hoeijmakers et
al. (2020) and Prinoth et al. (2022) for an extensive discussion. Using the
average S/N in Table 1 as a weight, we combined the two Kp-Vsys-maps. The
results of the cross-correlation analysis for Mg i, Fe i and Fe ii are shown
in Fig. 14. At the location of the peak, we extracted the one-dimensional
cross-correlation function and fit a Gaussian to determine the amplitude,
centre and width of the absorption. The fitted parameters are shown in Table
6, along with the shift between the literature Vsys value, which corresponds
to the planetary rest frame. The detection level is obtained as the ratio
between the fitted signal amplitude and its uncertainty.

To assess whether the signal uniquely stems from in-transit exposures, we
conducted a bootstrapping analysis, following the methodology outlined in
Hoeijmakers et al. (2020), Appendix C.1. This assessment is similar to the
approach detailed in Sect. 4.2, though being executed in velocity space rather
than wavelength space. This adaptation takes into account the fact that we are
considering the average of all lines within the spectrograph’s wavelength,
rather than single absorption lines. We conducted the bootstrap analysis for
each night and each species individually, see C.

Table 6: Median values of the Gaussian fit parameters and 68% confidence
intervals from the probability distribution for the cross-correlation
detections of each night.

| Date | Amplitude $\left[\%\right]$ | FWHM $\left[\mbox{${\rm km\,s}^{-1}$}\right]$ | Peak RV $\left[\mbox{${\rm km\,s}^{-1}$}\right]$ | Peak RV-Vsys shift $\left[\mbox{${\rm km\,s}^{-1}$}\right]$ | Detection
---|---|---|---|---|---|---
Fe i | 2021 May 03 | $0.0502(0.0015)$ | $16.53(0.57)$ | $-28.10(0.24)$ | $-4.19(0.24)$ | 12
2021 July 09 | $0.0297(0.0016)$ | $15.36(0.94)$ | $-28.83(0.40)$ | $-4.93(0.40)$ | 10
Fe ii | 2021 May 03 | $0.1441(0.0058)$ | $11.32(0.52)$ | $-26.61(0.22)$ | $-2.70(0.22)$ | 11
2021 July 09 | $0.1056(0.0051)$ | $13.33(0.74)$ | $-26.72(0.31)$ | $-2.81(0.31)$ | 8.4
Mg i | 2021 May 03 | $0.154(0.011)$ | $17.9(1.5)$ | $-26.73(0.64)$ | $-2.82(0.64)$ | 7.8
2021 July 09 | $0.138(0.017)$ | $11.4(1.6)$ | $-25.74(0.67)$ | $-1.83(0.67)$ | 5.8

Note: All parameters shown were obtained from the fit to the CCF signal,
except for the peak shift (RV-Vsys) and the detection level.

Figure 14: Cross-correlation analysis results of the first (2021 May 03, top) and second (2021 July 09, bottom) transit. From left to right we searched for Fe i, Fe ii, and Mg i. Top panel: The white lines indicate the expected velocities, while the black lines indicate the detected location in the Kp-Vsys-space. Bottom panel: Extracted one-dimensional cross-correlation function at the detected location (black horizontal line). The red dashed lines show the best-fit Gaussian. The vertical black line shows the expected rest frame velocity, indicating blueshifts for all the detected species.  Table 7: Results from the EMC bootstrap method for the cross-correlation results.  |  | in-out centre [$\%$] |  $\sigma_{out-out}$ [$\%$] | False-Positive probability [$\%$]
---|---|---|---|---
Fe i | 2021 May 03 | -0.030 | 0.0052 | 0.0038
2021 July 09 | -0.023 | 0.0040 | 0.0025
Fe ii | 2021 May 03 | -0.100 | 0.017 | 0.012
2021 July 09 | -0.096 | 0.018 | 0.011
Mg i | 2021 May 03 | -0.091 | 0.022 | 0.016
2021 July 09 | -0.052 | 0.027 | 0.017

##  6 Discussion and Conclusions

The results from the narrow-band transmission spectroscopy revealed the
presence of sodium via the detection of the Na i D2 ($5.5\,\sigma$) and D1
($5.4\,\sigma$) lines and hydrogen via the H$\alpha$ ($13\,\sigma$) and
H$\beta$ ($7.1\,\sigma$) lines, with a tentative detection of the Mg i b1
($4.6\,\sigma$) line. According to the analysis described in Sect. 4.1 we
observe a certain difference in behaviour between the detected elements. The
Na i D2 line does not appear to be shifted, with a centre velocity of
$0.14(0.65)$ ${\rm km\,s}^{-1}$, while the D1 line shows a very slight
$2.18(0.79)$ ${\rm km\,s}^{-1}$ redshift (significant below $3\,\sigma$). Both
lines are significantly broader than the instrumental resolution of
$2\leavevmode\nobreak\ $${\rm km\,s}^{-1}$, with a FWHM of $9.5(2.2)$ for the
D2 line and $8.1(1.8)$ ${\rm km\,s}^{-1}$ for the D1 line. We observe a
blueshift of $-3.5(1.0)$ ${\rm km\,s}^{-1}$ (significant at $3.5\,\sigma$)
with a broadening of $39.6(2.1)$ ${\rm km\,s}^{-1}$ for H$\alpha$, while
H$\beta$ shows no shift and is broadened by $27.6(4.6)$ ${\rm km\,s}^{-1}$.
These values are far above the instrumental resolution, which could serve as
an indication for possible atmospheric escape. From inspecting Figs. 15-18 we
note it is possible for hydrogen higher up in the atmosphere to have speeds
exceeding the escape velocity, while for sodium and magnesium, this scenario
is far less likely. The Mg i b1 line studied in narrow-band shows a
considerable blueshift of $-10.2(2.2)$ ${\rm km\,s}^{-1}$. The line FWHM
corresponds to a broadening of $27.6(5.3)$ ${\rm km\,s}^{-1}$ which, similarly
to H$\alpha$, could be caused by atmospheric dynamics under the caveat of our
bootstrapping results in narrow-band. As this line probes lower in the
atmosphere, where the escape of magnesium is less likely, this result points
towards the existence of strong winds in the terminator. Similar atmospheric
dynamics are hinted at by the presence of broadened absorption features on the
hot dayside in emission, verified on CRIRES+ data in the NIR (Cont et al.,
2024).

We additionally report the non-detection of the Li i resonance line and the
H$\gamma$ line. The non-detection of Li i is curious given this trace element
has been detected in the atmospheres of similar UHJ, such as WASP-121 b (Borsa
et al., 2021) and WASP-76 b (Tabernero et al., 2021). A detection of Li i
should be made easier by the absence of Li i absorption from the star,
yielding a higher S/N in the wavelength range around the line as well as
avoiding the RM effect. This might be due to insufficient S/N in our data. We
note that Li i absorption was only detected on 4-UT data and not detected on
1-UT data of WASP-121 b for this reason (Borsa et al., 2021). Further
observations might help clarify the existence of Li i in the atmosphere of
WASP-178 b.

When analysed through the cross-correlation method, we detected the presence
of Fe i and Fe ii in the atmosphere of WASP-178 b with a significance of
$12\,\sigma$ and $10\,\sigma$ respectively for the first night, with
11$\,\sigma$ and $8.4\,\sigma$ for the second. The bootstrap analyses of these
two species showed that the signal uniquely and uniformly originated from the
in-transit exposures (see Appendix C). Similarly, Mg i exhibited a signal in
the Kp-V${\rm sys}$-map with a significance of $7.8\,\sigma$ and $5.8\,\sigma$
for the two transits, though we note that for the second night, the location
of the Mg i absorption is observed at a significantly lower Kp.

All signals appear to be blueshifted with respect to the expected rest frame
velocity by at least $-4.19\pm 0.24$ ${\rm km\,s}^{-1}$ (Fe i), $-2.70\pm
0.22$ ${\rm km\,s}^{-1}$ (Fe ii) and $-1.83\pm 0.67$ ${\rm km\,s}^{-1}$ (Mg i)
and broadened to a FWHM of $15.36\pm 0.94$ ${\rm km\,s}^{-1}$ (Fe i),
$11.32\pm 0.52$ ${\rm km\,s}^{-1}$ (Fe ii), and $17.9\pm 1.5$ ${\rm
km\,s}^{-1}$ (Mg i). These results indicate the presence of atmospheric
dynamics in the more central to lower layers, where Fe i sits. Between the
detections of Na i, Fe i, Fe ii and Mg i we observe decreasing broadening and
blueshift with height, which might be an indication of the lower layers having
stronger dynamics and winds, since for these elements atmospheric escape is
less likely. However, the disparity between both nights’ Mg i signature
through cross-correlation, and with regards to the detection in narrow-band,
leaves room for doubt as to the existence and concrete behaviour of magnesium
in the atmosphere of WASP-178 b.

The ratio between the depths of H$\alpha$ and H$\beta$ is $1.55(0.22)$, which
is similar to results obtained for distinct UHJ, such as WASP-33 b (Cauley et
al., 2021) and MASCARA-2 b (Casasayas-Barris et al., 2019). Following these
studies, H$\gamma$ is expected to have a depth of $0.56$ times that of
H$\alpha$, corresponding to $-0.40\leavevmode\nobreak\ \%$, which coincides
with the standard deviation of the continuum near the line centre. The noise
level verified around the H$\gamma$ line core can mask a potential detection,
reinforcing the need for higher S/N observations. The application of
Boltzmann’s equation on H$\alpha$ and H$\beta$ yielded a temperature of
$4875\pm 1750.$ K in the thermosphere of WASP-178 b, taking into consideration
it is determined using the direct ratio between the two Balmer lines, which
serves only as a rough estimate. This value is in agreement with the pressure-
temperature profile obtained in Lothringer et al. (2022).

A previous study conducted with HST/WFC3/UVIS data (Lothringer et al., 2022)
in the NUV presented the absence of Fe i in the atmosphere of WASP-178 b and
found the absorption in this band could be explained by SiO at solar abundance
or Mg i \+ Fe ii at super solar abundance. The non-detection of Fe ii and Mg
ii on higher resolution in STIS E230M data led to the conclusion the
atmosphere is likely SiO-dominated. Our detections of Mg i, Fe i and Fe ii in
cross-correlation suggest the most likely scenario would be a Mg i and Fe ii-
dominated absorption in the NUV, possibly containing contributions from SiO as
well in order to justify the absorption depths observed in this band. Further
space-based observations could help to determine the relative abundances of
these and other elements and to better interpret these results.

Strong evidence of H2O and CO was also found on the dayside of WASP-178 b
through emission spectroscopy with CRIRES+ (Cont et al., 2024). As a possible
scenario to explain both our findings, we propose that H2O vapour on the
nightside dissociates due to the extremely high temperature and irradiation on
the dayside, allowing for the detection of hydrogen in the higher layers of
the atmosphere via the H$\alpha$ line. Near the terminator recombination can
occur, forming once again H2O. Extending this cycle to H2 would go in
agreement with results reported in recent studies (Bell & Cowan, 2018; Tan &
Komacek, 2019; Mansfield et al., 2020; Helling, C. et al., 2021, 2023; Pagano
et al., 2023), suggesting that at the high temperatures of UHJ, such as
WASP-178 b, dissociation and recombination of H2 can occur giving origin to
winds of ionised particles on the dayside, driven by the planet’s magnetic
field. The presence of such winds would also support the hypothesis that UHJs
with high irradiation temperatures present an efficient recirculation from the
dayside to the nightside (Zhang et al., 2018), as e.g. observed in Seidel et
al. (2021) and Seidel et al. (2023). In a separate study, WASP-178 b was found
to have a very high recirculation efficiency (Pagano et al., 2023) which
according to global circulation models (GCM) from Kataria et al. (2016) can be
associated with the existence of zonal winds. Our results from the
transmission spectroscopy show only slight blueshift on the upper or middle
layers of the atmosphere, indicating a lack of strong zonal winds in these
layers. This seems to contradict the previous predictions since the observed
high recirculation efficiency appears to be dissociated with the presence of
zonal winds.

WASP-178 b is an interesting case study for atmospheric dynamics and the
relationship between winds and the efficiency of recirculation in UHJ. We
suggest follow-up observations and investigation of this system, through the
use of both space-based instruments such as JWST as well as ground-based
instruments, in order to better constrain WASP-178 b’s atmospheric
composition. Additionally, the application of circulation models would allow
for a better constraint on the undergoing atmospheric dynamics, linking it to
other hot Jupiter and UHJ observations.

###### Acknowledgements.

We thank the anonymous referee for their comments which have improved the
manuscript. We thank D. Cont for his fruitful discussion on this target and
for sharing a draft of his parallel work on the dayside of this planet. The
authors acknowledge the ESPRESSO project team for its effort and dedication in
building the ESPRESSO instrument. This work relied on observations collected
at the European Southern Observatory. This work has been carried out within
the framework of the National Centre of Competence in Research PlanetS
supported by the Swiss National Science Foundation under grants 51NF40_182901
and 51NF40_205606. The authors acknowledge the financial support of the SNSF.
We acknowledge financial support from the Agencia Estatal de Investigación of
the Ministerio de Ciencia e Innovación MCIN/AEI/10.13039/501100011033 and the
ERDF “A way of making Europe” through project PID2021-125627OB-C32, from the
Centre of Excellence “Severo Ochoa” award to the Instituto de Astrofisica de
Canarias, and from The Fund of the Walter Gyllenberg Foundation. This project
has received funding from the Swiss National Science Foundation (SNSF) for
project 200021_200726. R. A. is a Trottier Postdoctoral Fellow and
acknowledges support from the Trottier Family Foundation. This work was
supported in part through a grant from the Fonds de Recherche du Québec -
Nature et Technologies (FRQNT). This work was funded by the Institut Trottier
de Recherche sur les Exoplaneètes (iREx). JIGH, ASM, RR and CAP acknowledge
financial support from the Spanish Ministry of Science and Innovation (MICINN)
project PID2020-117493GB-I00. This work was financed by Portuguese funds
through FCT (Fundação para a Ciência e a Tecnologia) in the framework of the
project 2022.04048.PTDC (Phi in the Sky, DOI 10.54499/2022.04048.PTDC). CJM
also acknowledges FCT and POCH/FSE (EC) support through Investigador FCT
Contract 2021.01214.CEECIND/CP1658/CT0001 (DOI
10.54499/2021.01214.CEECIND/CP1658/CT0001). FPE and CLO would like to
acknowledge the Swiss National Science Foundation (SNSF) for supporting
research with ESPRESSO through the SNSF grants nr. 140649, 152721, 166227,
184618 and 215190. The ESPRESSO Instrument Project was partially funded
through SNSF’s FLARE Programme for large infrastructures. J.L.-B. was partly
funded by grants LCF/BQ/PI20/11760023, Ramón y Cajal fellowship with code
RYC2021-031640-I, and the Spanish MCIN/AEI/10.13039/501100011033 grant
PID2019-107061GB-C61. E. E-B. acknowledges financial support from the European
Union and the State Agency of Investigation of the Spanish Ministry of Science
and Innovation (MICINN) under the grant PRE2020-093107 of the Pre-Doc Program
for the Training of Doctors (FPI-SO) through FSE funds. A.R.C.S. acknowledges
support from the Fundação para a Ciência e a Tecnologia (FCT) and POCH/FSE
through the fellowship 2021.07856.BD and the research grants UIDB/04434/2020
and UIDP/04434/2020. This work has been carried out within the framework of
the NCCR PlanetS supported by the Swiss National Science Foundation under
grant 51NF40_205606. This work was co-funded by the European Union (ERC,
FIERCE, 101052347). Views and opinions expressed are however those of the
authors only and do not necessarily reflect those of the European Union or the
European Research Council. Neither the European Union nor the granting
authority can be held responsible for them. This work was supported by FCT -
Fundação para a Ciência e a Tecnologia through national funds and by FEDER
through COMPETE2020 - Programa Operacional Competitividade e
Internacionalização by these grants: UIDB/04434/2020; UIDP/04434/2020. E.H.-C.
acknowledges support from grant PRE2020-094770 under project
PID2019-109522GB-C51 funded by the Spanish Ministry of Science and Innovation
/ State Agency of Research, MCIN/AEI/10.13039/501100011033, and by ‘ERDF, A
way of making Europe’. Y.C.D. and J.V.S. acknowledge support from ESO through
an SSDF studentship. MRZO acknowledges financial support from the Spanish
Ministry for Science, Innovation and Universities via project
PID2022-137241NB-C42. ML acknowledges support of the Swiss National Science
Foundation under grant number PCEFP2_194576.

## References

  * Allart et al. (2017) Allart, R., Lovis, C., Pino, L., et al. 2017, A&A, 606, A144
  * Allart et al. (2020) Allart, R., Pino, L., Lovis, C., et al. 2020, A&A, 644, A155
  * Azevedo Silva et al. (2022) Azevedo Silva, T., Demangeon, O. D. S., Santos, N. C., et al. 2022, A&A, 666, L10
  * Baranne et al. (1996) Baranne, A., Queloz, D., Mayor, M., et al. 1996, A&AS, 119, 373
  * Bell & Cowan (2018) Bell, T. J. & Cowan, N. B. 2018, ApJ, 857, L20
  * Borsa et al. (2021) Borsa, F., Allart, R., Casasayas-Barris, N., et al. 2021, A&A, 645, A24
  * Borsa et al. (2019) Borsa, F., Rainer, M., Bonomo, A. S., et al. 2019, A&A, 631, A34
  * Borsato et al. (2023) Borsato, N. W., Hoeijmakers, H. J., Prinoth, B., et al. 2023, A&A, 673, A158
  * Boué et al. (2013) Boué, G., Montalto, M., Boisse, I., Oshagh, M., & Santos, N. C. 2013, A&A, 550, A53
  * Casasayas-Barris et al. (2019) Casasayas-Barris, N., Pallé, E., Yan, F., et al. 2019, A&A, 628, A9
  * Casasayas-Barris et al. (2020) Casasayas-Barris, N., Pallé, E., Yan, F., et al. 2020, A&A, 635, A206
  * Cauley et al. (2021) Cauley, P. W., Wang, J., Shkolnik, E. L., et al. 2021, AJ, 161, 152
  * Cont et al. (2024) Cont, D., Nortmann, L., Yan, F., et al. 2024, arXiv e-prints, arXiv:2406.08166
  * Deline et al. (2022) Deline, A., Hooton, M. J., Lendl, M., et al. 2022, A&A, 659, A74
  * Delrez et al. (2016) Delrez, L., Santerne, A., Almenara, J. M., et al. 2016, MNRAS, 458, 4025
  * Ehrenreich et al. (2020) Ehrenreich, D., Lovis, C., Allart, R., et al. 2020, Nature, 580, 597
  * Foreman-Mackey et al. (2013) Foreman-Mackey, D., Hogg, D. W., Lang, D., & Goodman, J. 2013, PASP, 125, 306
  * Gaia Collaboration et al. (2018) Gaia Collaboration, Brown, A. G. A., Vallenari, A., et al. 2018, A&A, 616, A1
  * Gandhi et al. (2022) Gandhi, S., Kesseli, A., Snellen, I., et al. 2022, MNRAS, 515, 749
  * Gaudi et al. (2017) Gaudi, B. S., Stassun, K. G., Collins, K. A., et al. 2017, Nature, 546, 514
  * Gibson et al. (2022) Gibson, N. P., Nugroho, S. K., Lothringer, J., Maguire, C., & Sing, D. K. 2022, MNRAS, 512, 4618
  * Hellier et al. (2019) Hellier, C., Anderson, D. R., Barkaoui, K., et al. 2019, MNRAS, 490, 1479
  * Helling, C. et al. (2023) Helling, C., Samra, D., Lewis, D., et al. 2023, A&A, 671, A122
  * Helling, C. et al. (2021) Helling, C., Worters, M., Samra, D., Molaverdikhani, K., & Iro, N. 2021, A&A, 648, A80
  * Hoeijmakers et al. (2018) Hoeijmakers, H. J., Ehrenreich, D., Heng, K., et al. 2018, Nature, 560, 453
  * Hoeijmakers et al. (2019) Hoeijmakers, H. J., Ehrenreich, D., Kitzmann, D., et al. 2019, A&A, 627, A165
  * Hoeijmakers et al. (2020) Hoeijmakers, H. J., Seidel, J. V., Pino, L., et al. 2020, A&A, 641, A123
  * Holt (1893) Holt, J. R. 1893, Astronomy and Astro-Physics (formerly The Sidereal Messenger), 12, 646
  * Husser et al. (2013) Husser, T. O., Wende-von Berg, S., Dreizler, S., et al. 2013, A&A, 553, A6
  * Kataria et al. (2016) Kataria, T., Sing, D. K., Lewis, N. K., et al. 2016, ApJ, 821, 9
  * Kausch et al. (2015) Kausch, W., Noll, S., Smette, A., et al. 2015, A&A, 576, A78
  * Kitzmann et al. (2023) Kitzmann, D., Hoeijmakers, H. J., Grimm, S. L., et al. 2023, A&A, 669, A113
  * Komacek et al. (2017) Komacek, T. D., Showman, A. P., & Tan, X. 2017, ApJ, 835, 198
  * Lendl et al. (2012) Lendl, M., Anderson, D. R., Collier-Cameron, A., et al. 2012, A&A, 544, A72
  * Lendl et al. (2020a) Lendl, M., Bouchy, F., Gill, S., et al. 2020a, MNRAS, 492, 1761
  * Lendl et al. (2020b) Lendl, M., Csizmadia, S., Deline, A., et al. 2020b, A&A, 643, A94
  * Lothringer et al. (2022) Lothringer, J. D., Sing, D. K., Rustamkulov, Z., et al. 2022, Nature, 604, 49
  * Mansfield et al. (2020) Mansfield, M., Bean, J. L., Stevenson, K. B., et al. 2020, ApJ, 888, L15
  * McLaughlin (1924) McLaughlin, D. B. 1924, ApJ, 60, 22
  * Pagano et al. (2023) Pagano, I., Scandariato, G., Singh, V., et al. 2023, arXiv e-prints, arXiv:2309.09037
  * Parmentier & Crossfield (2018) Parmentier, V. & Crossfield, I. J. M. 2018, in Handbook of Exoplanets, ed. H. J. Deeg & J. A. Belmonte, 116
  * Parviainen & Aigrain (2015) Parviainen, H. & Aigrain, S. 2015, MNRAS, 453, 3821
  * Pelletier et al. (2023) Pelletier, S., Benneke, B., Ali-Dib, M., et al. 2023, Nature, 619, 491
  * Pepe et al. (2021) Pepe, F., Cristiani, S., Rebolo, R., et al. 2021, A&A, 645, A96
  * Pepe et al. (2002) Pepe, F., Mayor, M., Galland, F., et al. 2002, A&A, 388, 632
  * Perez-Becker & Showman (2013) Perez-Becker, D. & Showman, A. P. 2013, ApJ, 776, 134
  * Pino et al. (2022) Pino, L., Brogi, M., Désert, J. M., et al. 2022, A&A, 668, A176
  * Pino et al. (2020) Pino, L., Désert, J.-M., Brogi, M., et al. 2020, ApJ, 894, L27
  * Prinoth et al. (2022) Prinoth, B., Hoeijmakers, H. J., Kitzmann, D., et al. 2022, Nature Astronomy, 6, 449
  * Rackham et al. (2019) Rackham, B. V., Apai, D., & Giampapa, M. S. 2019, AJ, 157, 96
  * Redfield et al. (2008) Redfield, S., Endl, M., Cochran, W. D., & Koesterke, L. 2008, ApJ, 673, L87
  * Rodríguez Martínez et al. (2020) Rodríguez Martínez, R., Gaudi, B. S., Rodriguez, J. E., et al. 2020, AJ, 160, 111
  * Rossiter (1924) Rossiter, R. A. 1924, ApJ, 60, 15
  * Schwartz et al. (2017) Schwartz, J. C., Kashner, Z., Jovmir, D., & Cowan, N. B. 2017, ApJ, 850, 154
  * Sedaghati et al. (2021) Sedaghati, E., MacDonald, R. J., Casasayas-Barris, N., et al. 2021, MNRAS, 505, 435
  * Seidel et al. (2023) Seidel, J. V., Borsa, F., Pino, L., et al. 2023, A&A, 673, A125
  * Seidel et al. (2022) Seidel, J. V., Cegla, H. M., Doyle, L., et al. 2022, MNRAS, 513, L15
  * Seidel et al. (2021) Seidel, J. V., Ehrenreich, D., Allart, R., et al. 2021, A&A, 653, A73
  * Seidel et al. (2019) Seidel, J. V., Ehrenreich, D., Wyttenbach, A., et al. 2019, A&A, 623, A166
  * Smette et al. (2015) Smette, A., Sana, H., Noll, S., et al. 2015, A&A, 576, A77
  * Snellen et al. (2010) Snellen, I. A. G., de Kok, R. J., de Mooij, E. J. W., & Albrecht, S. 2010, Nature, 465, 1049
  * Stangret et al. (2022) Stangret, M., Casasayas-Barris, N., Pallé, E., et al. 2022, A&A, 662, A101
  * Tabernero et al. (2021) Tabernero, H. M., Zapatero Osorio, M. R., Allart, R., et al. 2021, A&A, 646, A158
  * Tan & Komacek (2019) Tan, X. & Komacek, T. D. 2019, ApJ, 886, 26
  * Triaud (2018) Triaud, A. H. M. J. 2018, in Handbook of Exoplanets, ed. H. J. Deeg & J. A. Belmonte, 2
  * West et al. (2016) West, R. G., Hellier, C., Almenara, J. M., et al. 2016, A&A, 585, A126
  * Wyttenbach et al. (2015) Wyttenbach, A., Ehrenreich, D., Lovis, C., Udry, S., & Pepe, F. 2015, A&A, 577, A62
  * Wyttenbach et al. (2020) Wyttenbach, A., Mollière, P., Ehrenreich, D., et al. 2020, A&A, 638, A87
  * Zhang et al. (2018) Zhang, M., Knutson, H. A., Kataria, T., et al. 2018, AJ, 155, 83

##  Appendix A Velocity-Height narrow-band absorptions

Figure 15: Co-added Na i doublet line as a function of the velocity shift from
the lines’ centre wavelength. The absorption depth was converted to an
equivalent radius. Top panel: The data is shown by the grey points and the x20
binned data by the blue points. The data was fitted with a Gaussian, shown by
the solid red line, while the golden line shows the ESPRESSO line spread
function (FWHM = $2$ ${\rm km\,s}^{-1}$) and the green dot-dashed line
represents the escape velocity. Bottom panel: The residuals are presented with
the same representation as the top panel. Figure 16: Same as Fig. 15 for the
H$\alpha$ line. Figure 17: Same as Fig. 15 for the H$\beta$ line. Figure 18:
Same as Fig. 15 for the Mg i b1 line.

##  Appendix B Bootstrap analysis for narrow-band

Figure 19: Distributions of the empirical Monte-Carlo analysis for the 12
$\AA$ passband on the Na i doublet (top panels) and 10 $\AA$ on H$\alpha$
(bottom panels), for each of the ESPRESSO transits. Results from the first and
second nights are displayed on the left and right panels, respectively. The
distributions representing the ’in-in’ (red bins) and ’out-out’ (blue bins)
scenarios are centred at 0, corresponding to non-detections, as expected. The
’in-out’ distributions (black bins) for Na i and H$\alpha$ deviate from 0 in
both transits, indicating a detection of planetary origin. The Gaussian fits
to the histograms are shown as dashed lines of the respective colour.

Figure 20: Same as Fig. 19 for the 6 $\AA$ passband on the H$\beta$ line (top
panels) and on the Mg i b1 line (bottom panels). For H$\beta$ both nights show
a slight deviation which hints at a detection, although not as clearly as Na i
and H$\alpha$. In the case of Mg i the ’in-out’ sits close to 0, indicating a
lack of planetary signal.

##  Appendix C Bootstrap analysis for cross-correlation

Figure 21: Distribution of bootstrapping analysis for 20,000 random selections
for Mg i, Fe i, Fe ii (top to bottom panels) for each night individually based
on the cross-correlation results. Similar to Figs. 19-20, the ’in-in’
distributions (in red) and ’out-out’ distributions (in blue) are supposed to
be centred around 0, indicating the absence of the considered species. The
’in-out’ distributions (shown in black) indicate the planetary origin of the
feature.

##  Appendix D RM correction for cross-correlation

Figure 22: Rossiter-McLaughlin (RM) correction for Fe i during 2021 May 03.
Top panel: Two-dimensional cross-correlation function in the rest frame of the
system. Transit contact times are indicated in black horizontal dashed lines.
The expected trace of the planetary atmosphere is indicated in white. Middle
panel: Best-fit RM model. Bottom panel: Residual after dividing the RM model.
The planetary trace is now clearly visible.  Figure 23: Same as Fig. 22 but
for Fe ii. Figure 24: Same as Fig. 22 but for Mg i.