A comparative study of two X2.2 and X9.3 solar flares observed with HARPS-N Reconciling Sun-as-a-star spectroscopy and high-spatial resolution solar observations in the context of the solar-stellar connection

Context. Stellar flares cannot be spatially resolved, which complicates ascertaining the physical processes behind particular spectral signatures. Due to their proximity to Earth, solar flares can serve as a stepping stone for understanding their stellar counterparts, especially when using a Sun-as-a-star instrument and in combination with spatially resolved observations. Aims. We aim to understand the disk-integrated spectral behaviors of a confined X2.2 flare and its eruptive X9.3 successor, which had energies of 2 . 2 × 10 31 erg and 9 . 3 × 10 31 erg, respectively, as measured by Sun-as-a-star observations with the High Accuracy Radial velocity Planet Searcher for the Northern hemisphere (HARPS-N). Methods. The behavior of multiple photospheric (NaD 1 &D 2 , Mg i at 5173 Å, Fe i at 6173 Å, and Mn i at 4031 Å) and chromospheric (Ca ii H&K, H α , H β , and He i D 3 ) spectral lines were investigated by means of activity indices and contrast profiles. A number of di ff erent photospheric lines were also investigated by means of equivalent widths, and radial velocity measures, which were then related to physical processes directly observed in high-resolution observations made with the Swedish 1-meter Solar Telescope (SST) and the Atmospheric Imaging Assembly (AIA) on board of the Solar Dynamics Observatory (SDO). Results. Our findings suggest a relationship between the evolving shapes of contrast profile time and the flare locations, which assists in constraining flare locations in disk-integrated observations. In addition, an upward bias was found in flare statistics based on activity indices derived from the Ca ii H&K lines. In this case, much smaller flares cause a similar increase in the activity index as that produced by larger flares. H α -based activity indices do not show this bias and are therefore less susceptible to activity jitter. Sodium line profiles show a strongly asymmetric response during flare activity, which is best captured with a newly defined asymmetrical sodium activity index. A strong flare response was detected in Mn i line profiles, which is unexpected and calls for further exploration. Intensity increases in H α , H β , and certain spectral windows of AIA before the flare onset suggest their potential use as short-term flare predictors.


Introduction
As we enter the era of detailed studies of exoplanet atmospheric characterization and habitability, there is a growing interest in understanding the environment in which planets are formed and evolve.In the case of our Solar System, it is generally accepted that transient energetic phenomena, such as flares, coronal mass ejections (CMEs), and solar energetic particle (SEP) events, are the most important drivers of space weather.Based on this paradigm, this is likely also the case in other systems, especially in those with more active stars.In fact, stellar counterparts of such transient events have the potential to permanently alter the atmospheric conditions of an exoplanet (e.g., Pulkkinen 2007;Temmer 2021).Thus, such events are vitally important in understanding the habitable zone of exoplanets (Airapetian et al. 2020).
In the stellar regime, survey missions such as the Kepler space telescope (Borucki et al. 2010) and the Transiting Exoplanet Survey Satellite (TESS, Ricker et al. 2015), as well as dedicated observations from the Hubble Space Telescope (HST, Woodgate et al. 1986), the XMM-Newton mission (Koch-Miramond 1985), and the Chandra X-ray telescope (Wilkes & Green 2000), have enabled a relatively robust multi wavelength characterization of the flaring behavior of stars across spectral types and ages (e.g., Guarcello et al. 2019;Davenport et al. 2019;MacGregor et al. 2021).Particularly at early stages of stellar evolution and in later spectral types, flare rates, and energies have been observed, exceeding the solar levels by several orders of magnitude (e.g., Loyd et al. 2018b,a;Ilin et al. 2019;Ilin et al. 2021;Pietras et al. 2022).On the other hand, knowledge of the eruptive behavior of stars (for example, CMEs) and their high-energy particle environment is nowadays extremely limited (e.g., Leitzinger & Odert 2022).The large majority of studies are currently based on direct extrapolations from solar data (e.g., Kay et al. 2016Kay et al. , 2019;;Patsourakos & Georgoulis 2017;Hazra et al. 2022), whose validity is not well established in the stellar regime.One of the reasons is that the expected elevated CME activity on active flare stars is not only at odds with multiple reports of non-detections by dedicated multi wavelength observing programs (e.g., Crosley et al. 2016;Villadsen 2017;Crosley & Osten 2018;Vida et al. 2019;Muheki et al. 2020a,b;Koller et al. 2021) but also with the current knowledge on the mass loss budget of cool stars (Drake et al. 2013;Odert et al. 2017;Wood et al. 2021).In addition, the scarce set of currently known stellar CME-candidate events displays a large deficit of kinetic energy, deviating significantly from the behavior observed in solar flare-CME events (e.g., Moschou et al. 2017Moschou et al. , 2019;;Vida et al. 2019;Leitzinger & Odert 2022).The same behavior is observed in the handful of stellar CME events detected so far (Houdebine et al. 1990;Gunn et al. 1994;Houdebine et al. 1993;Guenther & Emerson 1997;Fuhrmeister & Schmitt 2004;Vida et al. 2016;Argiroffi et al. 2019;Namekata et al. 2021;Veronig et al. 2021).
Even less is known about the energetic particle environment of active stars, given the difficulties involved in their detection by remote observations (e.g., Drake et al. 2019).Regarding the flare emission itself, there are strong divergences when solar versus stellar phenomena are explored and compared in photometric studies in the visible spectrum (for example, white-light flare studies).Flares are commonly detected on Sun-like stars, for example in the TESS and Kepler band-passes (e.g., Maehara et al. 2012;Yan et al. 2021), while the detection of such energetic events is very scarce and difficult on the Sun when observed in disk-integrated broadband images (e.g., Kopp et al. 2004;Woods et al. 2006;Kretzschmar et al. 2010).The main reasons for these discrepancies are presumably the age and activity stage of the Sun as compared to younger and more active stars (e.g., Okamoto et al. 2021).
Equivalent width studies of stellar spectra have now reached a point, where modern instrumentation has become sensitive enough to register the changes induced by activity on the average disk-integrated shape of some spectral lines, in particular those forming in the upper layers of the photosphere and above (Yana Galarza et al. 2019;Baratella et al. 2020a,b;Spina et al. 2020).This has important implications for the derivation of the stellar atmospheric parameters, which vary over the course of an activity cycle.Despite large efforts, the question remains as to whether these effects are due to dark or bright spots, flares, plages, and magnetic fields or a combination of all (e.g.Cretignier et al. 2023).Thus, studying the variability of the equivalent width and other spectral parameters during such events is of primary importance.
Theoretical and numerical investigations study properties of stellar CMEs and energetic particles, as well as different physical conditions that could explain deviations from their solar counterparts (e.g., Alvarado-Gómez et al. 2022).These deviations can be due to large-scale magnetic fields, which may confine CMEs (Alvarado-Gómez et al. 2018a, 2019, 2020) and energetic particles (Fraschetti et al. 2019(Fraschetti et al. , 2022)), or prevent triggers of an eruption in the first place (Sun et al. 2022).Progress in this area is however hampered by the lack of observations, especially in the stellar regime, and by large degeneracies and uncertainties (e.g., Lynch et al. 2022).
One possibility to overcome the aforementioned limitations lies in so-called 'Sun-as-a-star' studies, where stellar instrumentation and observing techniques are used to characterize the Sun.Such investigations are getting more traction in recent years, including topics related to radial velocity variations (e.g., Dumusque et al. 2021;Al Moulla et al. 2023), stellar activity and magnetic fields (e.g., Milbourne et al. 2019;Maldonado et al. 2019;Thompson et al. 2020), convection patterns (Miklos et al. 2020), and total solar irradiance (Milbourne et al. 2021).
In the context of flares and CMEs, Namekata et al. (2021) and Otsu et al. (2022) provided a solid starting point for capturing different line-profile variations and their interpretation in connection with the characteristics of the underlying transient event.However, these studies do not completely fulfill the Sunas-a-star condition, as spatially resolved information is used to extract faint signals from data, and large-scale effects such as other activity signatures and center-to-limb variations (CLV) are not taken into account.Thus, these findings should be compared to 'true' Sun-as-a-star observations to see how they hold up in this regime (e.g.Pietrow & Pastor Yabar 2023).Nevertheless, the resolved context offered in the prior works acts as a bridge between solar and stellar observations and offers ways to 'translate' results back and forth between the fields.
One important aspect of such a translation is to find a link between solar and stellar notations of flare strengths.In solar physics, the strength of solar flares is typically expressed using a logarithmic scale (Baker 1970), which is based on the peak intensity of the X-ray emission in the 1 -8 Å band.Flares are given one of five designations (A, B, C, M, or X), which corresponds to the exponent, and a number between 1 and 9, which acts as a multiplication factor (for example, an M5.0 flare corresponds to 5 × 10 −5 W m −2 ).X-class flares are an exception to this scaling scheme, as they are defined to be the strongest category and thus open-ended in intensity (Pietrow 2022, p. 28).Attempts have been made to link these classes to bolometric energies, where estimates place an X1.0 flare at 10 31 erg (e.g., Shibata et al. 2013;Maehara et al. 2015;Namekata et al. 2021).However, such relations do not scale linearly (e.g., Warmuth & Mann 2016, Fig. 8).The reason for this is not known and requires further research.Therefore, the linear relation will be used for simplicity in our study.The two flares studied in this work have been measured to be X2.2 and X9.3 respectively, which corresponds to a rough energy of 2.2 × 10 31 erg and 9.3 × 10 31 erg, respectively.This is at the lower end of the 10 31 − 10 36 erg energy range of flares described by Pietras et al. (2022), with the average flare being around X100, or 10 times stronger than the large flare described in this work.
This work focuses on Sun-as-a-star observations of two large solar flares observed with the solar telescope (Dumusque et al. 2015) connected to the High Accuracy Radial-velocity Planet Searcher for the Northern hemisphere (HARPS-N, Cosentino et al. 2012) instrument of the Telescopio Nazionale Galileo (TNG) on La Palma.Later extensive solar context based on instruments with a high spatial resolution is added to demonstrate what can and cannot be seen in the disk-integrated HARPS-N spectra, as a way to highlight both the power and limitations of 1-D flare observations.

Observations
The primary dataset used in this work is the HARPS-N time series, with all other observations being used to give context to these observations.

Sun-as-a-star spectra
Sun-as-a-star spectra1 were observed between 08:57 and 14:33 UT on the 6 September 2017 (shaded gray in Fig. 1), with two flares taking place between 8:57 and 9:17 UT and between 11:53 and 12:10 UT respectively.They were observed with the 3-inch solar telescope (Dumusque et al. 2015) that feeds into HARPS-N.The observations were made at a 5-minute cadence, recording the visible spectrum between 3900 and 6900 Å with a spectral resolution of R ≈ 110 000.HARPS-N is a crossdispersed echelle spectrograph, which observes several dozens of orders at once on a 4k × 4k-pixel CCD mosaic before they are merged by the standard data reduction software of HARPS-N to produce a one-dimensional spectrum of the full spectral range.
The HARPS-N spectra are usually not photometrically calibrated since conservation of the étendue requires small optical fibers to collect the stellar light at the high-spectral resolution, whereby the sky-projected size of the fibers are similar to the on-site seeing disk (Pepe et al. 2021).Furthermore, other airmass effects such as differential extinction or weather conditions changes are not corrected.Thus, the shape of the spectrum is not preserved due to the different filters inside the instruments that try to balance the overall flux in order to avoid saturation of the detector.All of these features, combined with guiding errors, result in flux variations of up to 50% (Dumusque et al. 2021).This means that the data does not contain reliable flux values, and has to be studied after the continuum is fitted.
In this work, this was achieved with the Rolling Alpha Shape for a Spectrally Improved Normalisation Estimation (RASSINE, Cretignier et al. 2020b) code, which is publicly available on GitHub. 2 The code is based on the convex hull theory to fit upper envelopes to a cloud of data point.This filter aims to separate photospheric lines (high-frequency terms) from the continuum (low-frequency term).In more descriptive terms, the continuum 0 8 :0 0 1 0 :0 0 1 2 :0 0 1 4 :0 0 1 6 :0 0 1 8 :0 0 2 0 :0 0 2 2 :0 0 Time is fitted by rolling a circle along the top of the spectrum with a radius larger than the width of the photospheric lines.Each contact point between the 'rolling pin' and the spectrum is used to fit the upper envelope of the spectrum.
Additionally, the HARPS-N spectra are contaminated by several systematic effects such as interference patterns produced by the filters inside the instrument, ghosts that are internal reflections inside the spectrograph, and telluric lines.We used spectra processed with the YARARA software (Cretignier et al. 2021), which was designed to correct the time variation of all these effects.Moreover, YARARA features an algorithm to improve the radial velocity precision, which is mainly affected by stellar activity (e.g., Cretignier et al. 2022).However, we disabled the stellar activity correction for this study.

High-resolution observations
Both flares were also observed by the 1-meter Swedish Solar Telescope (SST, Scharmer et al. 2003), using simultaneously the CRisp Imaging SpectroPolarimeter (CRISP, Scharmer et al. 2008) and the CHROMospheric Imaging Spectrometer (CHROMIS, Scharmer 2017).Both instruments are dual Fabry-Pérot interferometers, which can be tuned to specific wavelengths in order to 'scan' through a spectral line with an average spectral resolution of around R ≈ 130 000.CRISP executed a sequence that alternated between Hα and Ca ii 8542 Å, while CHROMIS only recorded the Ca ii K line together with the 4000 Å continuum.
The cadence of the CHROMIS observing sequence was 6.5 s with 19 wavelength positions in the Ca ii K line at ±1.00, ±0.85, ±0.65, ±0.55, ±0.45, ±0.35, ±0.25, ±0.15, ±0.07, and 0.00 Å relative to the line center, plus a single continuum point at 4000 Å.The CHROMIS plate scale is 0.0375 ′′ pixel −1 .In addition to the narrow-band images, wide-band images were obtained co-temporally with each CRISP and CHROMIS narrowband exposure for alignment purposes.
The data was processed using the standard SSTRED pipeline (de la Cruz Rodríguez et al. 2015;Löfdahl et al. 2021) using multi-object multi-frame blind deconvolution (MOMFBD, Löfdahl 2002;van Noort et al. 2005).However, the routine does not perform well under mediocre seeing conditions and can even introduce artifacts in frames with bad seeing conditions (e.g.see Fig. 5.4 of Pietrow 2022).In frames where image restoration failed, restored data were replaced simply by the sum of the narrow-band images after applying calibrations for pixel bias and gain (i.e., darks and flats), as well as the calibration for camera alignment.During the summing process shift vectors were derived by cross-correlation on the broadband frames and subsequently applied to the simultaneous narrow-band frames (Pietrow et al. 2023b).Finally, absolute wavelength and intensity calibrations were performed using the solar spectral atlas by Neckel & Labs (1984).
The Ca ii 8542 Å data of the X2.2 flare was already described in Vissers et al. (2021) but have now been re-processed together with the Hα and Ca ii K observations.The Hα and Ca ii 8542 Å data of the X9.3 flare were first described in Quinn et al. (2019), while the Ca ii K data were first shown in (Pietrow et al. 2022) and were re-processed for this work.

Weather and seeing conditions
Both the SST and HARPS-N data were taken in close proximity of each other on the Canary Island of La Palma.A video 0 6 :0 0 0 7 :0 0 0 8 :0 0 0 9 :0 0 1 0 :0 0 1 1 :0 0 1 2 :0 0 1 3 :0 0 1 4 :0 0 1 5 :0 0 1 6 :0 0 Time recorded by an all-sky camera indicated a cloud-free day.3However, the seeing conditions were variable.A summary of the weather and seeing conditions is provided in Fig. 2, showing the temporal evolution of the Fried parameter r 0 (Fried 1966), the solar intensity measured by the SHAdow BAnd Ranger (SHABAR, Sliepen et al. 2010), and the GOES X-ray flux.SHABAR observations were interrupted for about an hour before the second flare.The adaptive optics (AO) system was switched off starting around 12:00 UT during the second flare, resulting in a fixed value of r 0 ≈ 7 cm.Other intervals of constant r 0 ≈ 3 cm occurred at times when the AO introduced randomized motions for taking flat-field frames.The peak of r 0 > 50 cm signifies a calibration step that involves focusing on a pinhole array.

Total solar irradiance and X-ray observations
The Variability of IRradiance and Gravity Oscillation (VIRGO, Fröhlich et al. 1997) experiment onboard the Solar and Heliospheric Observatory (SOHO, Domingo et al. 1995) has been monitoring the total solar irradiance (TSI) since 1996 from the Sun-Earth L 0 point (e.g., Pap & Fröhlich 1999;Fehlmann et al. 2012;Finsterle et al. 2021).The data were averaged resulting in a 1-minute cadence and corrected with the new scale of TSI VIRGO/PMO6V-A (see Discussion, Table 2, Finsterle et al. 2021).The TSI data are available from the VIRGO Team through PMOD/WRC, 4 and the SoHO archives at ESA and NASA.The GOES data are provided by NOAA. 5  In Fig. 3, the TSI is plotted for a large part of the day.The data are plotted with a 60s cadence in blue with a curve that smoothens the data over 10-time steps in orange.A regular jump in the detected signal took place around 13:00 UT and this data has been removed from the plot.
In addition, a 1 -8 Å Sun-as-a-star integrated light curve taken by the EUV and X-ray Irradiance Sensors (EXIS, Machol et al. 2020) onboard the Geostationary Operational Environmental Satellite No. 16 (GOES-16, Schmit et al. 2005, 2017, 2019) is plotted in black.The X-ray band is sensitive to the solar corona and contains a combination of spectral lines and continuum that are primarily sensitive to flare emission but can also detect quiescent active regions during solar maximum (White et al. 2005;Simões et al. 2015).

Full-disk UV and EUV observations
The Helioseismic and Magnetic Imager (HMI, Scherrer et al. 2012) and the Atmospheric Imaging Assembly (AIA Lemen et al. 2012) onboard the Solar Dynamics Observatory (SDO, Pesnell et al. 2012) observe the full solar disk in the visible continuum, ultraviolet (UV), and extreme-ultraviolet (EUV) at a cadence of 45 s, 24 s, and 12 s, respectively, and a plate scale of 0.5 ′′ pixel −1 and 0.6 ′′ pixel −1 , respectively.HMI is an imaging spectropolarimeter, which records the Fe i line at 6173 Å in each polarimetric state at five wavelength points and additionally records one point in the continuum (Švanda et al. 2018).The AIA instrument consists of four telescopes that observe in total one continuum, two UV, and seven EUV windows.Each of the AIA channels has a width of several Ångströms and thus observes the combined emission of several spectral lines.Consequently, each of the AIA channels is sensitive to a wide range of temperatures, and the temperature response function of each of the channels has multiple peaks related to different atmospheric conditions.The UV channels cover spectral lines from the photosphere and chromosphere (Simões et al. 2019).The EUV channels cover spectral lines in the transition region and solar corona (e.g., Träbert et al. 2014).During flares, AIA images with standard exposure times typically saturate and AIA switches to a short-exposure mode, where AIA predicts reasonably short exposure times for every other image.Ideally, in the short exposure images, the flaring region does not saturate anymore, but at the same time, the photon counts in the non-flaring (that is, quiescent) regions diminish and are often even below the digitization threshold.Furthermore, AIA observations suffer from strong diffraction, which is a result of the entrance and focal plane filter within the instrument.
To avoid saturated images as much as possible, we analyzed only every other AIA image, choosing the low-exposure image if available.To correct for the diffraction pattern, we deconvolved the AIA images with the point-spread functions provided by the instrument team.To account for flux from quiescent regions that are below the digitization threshold in the short-exposure images, we compared the flux in the quiescent region in the short-exposure images with the one in the regularexposure images to derive an offset.The short-exposure images were subsequently corrected by this offset.The integrated flux of selected channels is presented in Fig. 1, with the GOES light curve for comparison.In addition, a pair of movies were created for the same time range: one of the full disk6 and another one with a smaller region-of-interest (ROI)7 centered on active region NOAA 12673.

Results
In this section, we discuss various methods of investigating the two flares through the HARPS-N data, without additional context as if it was another star.These begin with a look at the con-trast profiles, which are then compared with the short timescale variations of activity indices, RV measurements, and EW variations.Finally, high-resolution SST observations of the same event are presented.

Contrast profiles
In Fig. 4, we show the so-called contrast profiles of ten selected lines from the HARPS-N spectrum.These profiles are obtained by dividing each time step by an average of the time series between 10:30 and 11:30 UT, this was done to ensure that the reference level for non-flaring spectra was taken at a time when the locations and conditions of all the solar active regions on the solar disk are as close as possible to those during the flares.This ensures that as much of the registered changes as possible are due to the flares and not unrelated evolution.Ideally one would use a longer baseline that happens before both events, but this was not available for this data set.Observations on other days were either plagued with bad weather or represented an active region geometry that was too different from the current one.
The spectral lines in Fig. 4 are shown in columns from left to right with decreasing quiet-Sun formation height (e.g.Kuridze et al. 2016;Sasso et al. 2017;de la Cruz Rodríguez et al. 2019;Carlsson et al. 2019).These specific lines were picked because of their use as activity indices (see Sect. 3.2).The two exceptions are the Mn i 4031 Å and Fe i 6173 Å lines.The latter has been added because it is the same line that is observed by HMI, which makes it one of the best-studied iron lines in solar physics, while the manganese line was selected due to its potential as an activity indicator, something which has been debated since the late 20th century.
From this plot, we can see a constant broadening in the line core of most metrics.The Ca ii H & K lines show by far the strongest response in both flares, with brightening close to 2.5% above the non-flaring base level, as well as with a similar width.This can be seen in Fig. 5 and 6, which from now on will be called the integrated contrast profiles.The integration range of these profiles is taken between −164 to −145 min and 0 to 80 min, respectively, as illustrated with a pair of dashed lines in Fig. 4.
A weaker, and less extended response is found in most other lines, except for helium, magnesium, and iron.While no response is expected in the low photosphere where the iron line forms, it is surprising that helium, which is a widely used activity proxy (see Sect. 3.2), does not seem to respond to the flare at all.It is possible that the flare is simply too weak, or that there is some kind of angular dependence on the response strength of this line.
The Na line profiles both show an asymmetrical structure during both flare times, which is consistent with the findings of Rutten et al. (2011).Given the fact that this line is used regularly for exoplanet atmosphere characterization, further investigations looking at stronger flares on different stars are warranted, especially if observing on the 'quiet' side of the lines could decrease the line's sensitivity to the background activity of the host star.In the next section, we explore this by redefining the sodium activity index in such a way that it deals with this asymmetry.
No signature of the flare is detected in the magnesium, even though this line has been used as an activity index (e.g., Sasso et al. 2017).However, two strong and slightly delayed signals can be seen in manganese, which corresponds to the Mn i 4031 Å and Mn i 4033 Å lines.While no response was detected from the Mn i 4034 Å line.Doyle et al. (1992) reported a delayed response to a flare in these lines (their Figs. 6 and 7), in particular, a Mn i line at around 4030 Å that increases in intensity during the impulsive phase, and remains above the average level in the gradual phase, above the enhancement shown by most other lines around it.This is in line with our observations.However, not much else is known about this line as most works focused on the Mn i 5432/5395 Å lines (e.g., Livingston & Wallace 1987;Andriyenko 2004;Vince et al. 2005;Livingston et al. 2007;Bergemann et al. 2019) which were shown to trace the solar cycle and seem to react to chromospheric plage.It was first suggested by Doyle et al. (2001) that their chromospheric sensitivity is due to optical pumping by Mg ii k, while Danilovic et al. (2005); Danilović et al. (2007) suggested that this line has an above-average sensitivity to solar activity.It was later shown by Vitas et al. (2009) that this sensitivity is due to an excessive hyperfine structure, which dominates over the thermal and granular Doppler smearing that most narrow photospheric lines suffer from, effectively making it uniquely sensitive to magnetic fields.A similar test was performed on the data presented here, for these lines.No response to the flare was detected, with spectral windows looking similar to those of magnesium and iron (see Fig. 4).
Besides the central increase in the contrast profiles, it is also possible to make out slight increases on the red side of the Ca ii H & K and Hα lines that overlap in Ca ii K and Hα but not in Ca ii H (Fig. 5).These structures could be signs of chromospheric evaporation (e.g., Kuridze et al. 2015), with the mismatch in the profile of Ca ii H likely being caused by the higher amount of blends on the red side (e.g.Alvarado-Gómez et al. 2015, Fig. 2) of the line, as well as by the Hϵ line located at about 150 km s −1 (Krikova et al. 2023).This would imply chro- mospheric evaporation of around 100 km s −1 .However, further studies would be required to corroborate this.

Short-term activity index variations
A wide variety of activity indices have been proposed over the last decades that quantify solar and stellar activity (see Ermolli et al. 2014, and references within).By design, many of these indices are partially correlated as they react primarily to the 11year solar cycle (Schwabe 1844;Jørgensen et al. 2019), or similar cycles on other stars (e.g., Wilson 1978;Baliunas et al. 1995).However, since the lines used for deriving such indices form at different heights in the atmosphere, and therefore react differently to changes around them, one cannot expect them to be equivalent.This is illustrated by the different intensities, widths, and start times of the flare signal in the contrast profile time series shown in Fig. 4. In addition, this gives us the opportunity to not only investigate the response of the activity indices as they are used today but to investigate if perhaps a different definition would fit the data better.
In the case of our HARPS-N observations, the five most responsive indices have been plotted in Fig. 7.Each of these indices and the lines that they are based on are described below.

Ca ii H & K based S-index
The Ca ii H & K lines centered at 3968.47 Å and 3933.66Å belong to the deepest lines in the visual spectrum.Their broad wings sample the high photosphere up to the temperature minimum and can be modeled in local thermodynamic equilibrium (LTE; e.g., Sheminova 2012).The core, which usually has a characteristic 'M-shape', forms as a result of the temperature rising in the low chromosphere, decoupling from the source function which has to be modeled in non-LTE with partial redistribution.The line core forms high up in the chromosphere below the Mg ii h & k lines (Vernazza et al. 1981;Leenaarts et al. 2013;Bjørgen et al. 2018).Strong variations in the line shape can be seen in spatially resolved solar observations of areas with activity (e.g., de la Cruz Rodríguez & Piskunov 2013; Varun et al. 2018), while in disk-integrated observations this change expresses itself with a brightening in the cores of these lines.This change has been used as a measure of stellar and solar activity for nearly half a century in the form of the so-called S-index (Wilson 1978;Oranje 1983;Gomes da Silva et al. 2011;Alvarado-Gómez et al. 2018b;Dineva et al. 2022;Amazo-Gómez et al. 2023;Sowmya et al. 2023), where a triangular bandpass is used to integrate the line cores, which are then weighed with a nearby pseudo continuum in the following way: where H and K refer to the integrated flux over a 1.09-Å-wide window centered on 3968.47Å and 3933.664Å, respectively.B and V are normally selected as 20-Å-wide band around 3900 Å and 4000 Å, respectively.However, our HARPS-N data starts at 3900 Å, which limits the size of B to half of what is usually used.This, combined with the ghosts and low filter throughput that plagues the instrument, results in higher noise and lower absolute index values than expected.However, as these effects are largely constant over time, we can still look at the normalized activity index, where we divide the indices by the mean spectral index between 10:00 and 11:00 UT.We repeat this step for all other indices to facilitate easier comparison.The S-index (blue line in Fig. 7) shows strong enhancement during the X2.2 flare at the beginning of the time series.It also increases by around 1% during the X9.3 flare, peaking at about 1 hour after the start of the flare.The peak of the S-index activity is approximately equal for both flares, although the X9.3 flare causes a much longer-lasting increase.
Between 11:30 and 11:50 UT, that is between the two flares for 20 min before the X9.3 impulsive phase, a pulsating behavior is seen in the S-index, which cannot be easily discerned in other lines, nor the integrated AIA curves (Fig. 1), but is present in the contrast profiles (see Fig. 4, Ca ii K and Ca ii H panels at the times immediately before 11:53 UT).When looking at the AIA video in the 1600 Å and 1700 Å channels, these peaks coincide with small flare-like brightenings that do not show up in the GOES curve.Depending on the activity cycle, the cutoff for flare detection of the GOES satellite lies between low C-class to mid B-class flares (Sadykov et al. 2019), in our case the baseline being around C1 class.Thus, if the brightenings seen in the AIA data are indeed flares, they would be below C-class.However, they could also simply be due to the ubiquitous variations in activity on the solar disk.

Hα and Hβ indices
The hydrogen Hα and Hβ lines are located at 6562.79 Å and 4861.35Å respectively.Both lines require three-dimensional effects to be modeled (Leenaarts et al. 2012), although it has been suggested that the high mass density in the active region would make it possible to model the Hα line in one dimension (Bjørgen et al. 2019).
In non-flaring conditions, both lines are in absorption and form principally as a result of the scattering of light in the chromosphere from the intense incident continuum emission produced at photospheric heights (Leenaarts et al. 2012).The Hα line is much more commonly studied in solar work than the Hβ line, which shows broadly a similar behavior with a line intensity ratio of approximately 0.3 to 0.4 when compared to the Hα line (Capparelli et al. 2017;Koza et al. 2019).In quiet-Sun conditions, the line-center-to-continuum intensity ratio is sensitive to column density rather than temperature (Leenaarts et al. 2012(Leenaarts et al. , 2015;;Druett et al. 2022a) displaying the canopy of chromospheric fibrils in the line center and granulation in the far wings, with an opacity gap (due to the temperature minimum re-gion of the Sun that occurs just above the photosphere) causing a rather abrupt switch between these views.The quiet-Sun Hα line width is correlated with typical chromospheric temperature variations (Molnar et al. 2019), although this correlation is via an indirect cause, with line width being principally sensitive to column density present above the temperature minimum layer or opacity gap.Thus, under standard line synthesis, only 8% of the line width variations are attributable to thermal broadening, that is, variations of around 0.025 Å out of total observed variations of order 0.3 Å (Molnar et al. 2019).This opacity broadening can itself be useful to infer line-of-sight-column masses in resolved images (Pietrow et al. 2022).In flares, both Hα and Hβ go into emission and exhibit extreme broadening and Doppler shifts (Ichimoto & Kurokawa 1984;Wuelser & Marti 1989;Druett et al. 2021;Pietrow et al. 2022).This occurs over large sections of the flare ribbon but is particularly acute in small 'flare kernels' associated with energetic events such as high-energy beam particle heating (Druett et al. 2017;Zharkov et al. 2020;Osborne & Fletcher 2022).
Although such metrics as strong red-wing enhancements are highly valuable in spatially resolved observations of solar flares, the most effective bandwidths for detecting flare activity in stellar observations is still a matter of debate, usually framed in particular implementations of the Hα activity index (da Silva et al. 2011, and references within).Similarly to the S-index, this index takes the average over the Hα line core and divides it by two sections of pseudo-continuum to either side of it.Bonfils et al. (2007) and Boisse et al. (2009) define it as where F Hα corresponds to a 0.6-Å-wide window centered at 6562.808 Å, and B and V are both 8-Å-wide windows centered around 6550.85 and 6580.28Å, respectively.Not long after this definition, a larger width of 1.5 Å has been used for F Hα (e.g., Cincunegui et al. 2007;Meunier & Delfosse 2009;Gomes da Silva et al. 2011), as very strong activity can broaden the line core to this point and beyond (Pietrow et al. 2022) and the signal-to-noise ratio of a larger band is of course better.However, when averaged over the full disk, this bandpass includes a significant photospheric contribution (e.g., Watanabe et al. 2011, Fig. 1) which washes out the chromospheric signal in all but the most extreme cases.A similar conclusion has been drawn by Gomes da Silva et al. (2022), who reported that the narrower bandpass correlates more strongly with the S-index.We confirm this, as using the broader bandpass washed out almost entirely the signal of both flares, while the narrower bandpass tracks better with the S-index.In Fig. 8, we show a series of normalized activity indices with differing bandpass values, showing the wash-out effect of large bandwidths.
We take a similar approach for Hβ, where we define a bandwidth of 0.2 Å, which was chosen to cover a similar fraction of the line core as with Hα (0.4 Å), and later narrowed down to compensate for the lower opacity of the line.For the B and V bands, we use the definitions by West & Hawley (2008) which span a 10-Å-wide region centered around 4845 and 4880 Å, respectively.
The orange line, which represents the Hα activity index in Fig. 7 is much less noisy than the S-index.This is likely due to the higher throughput of this section of the HARPS-N bandwidth, as well as the lack of any ghosts, which are present in the Ca ii H & K window.The flare causes a roughly 0.5% increase in activity around the time of the X9.3 flare and increases several minutes before the onset of the flare as discussed in (e.g., Benz 2016), and tracks the GOES curve more closely than the S-index.The smaller X2.2 flare does not leave a significant imprint on the index.
The green line, which represents the Hβ index, peaks near the X2.2 flare, showing more sensitivity for it than Hα.For the X9.3 flare, we see an increase of similar magnitude as for the smaller flare, but with a longer duration.However, the increase declines much faster than for Hα.
Similarly in behavior to the Ca ii H & K lines, Hα and Hβ brighten just before the GOES SXR curve indicating the start of the flare at 11:53 UT (see Fig. 4), with offsets on the order of 5 min between these signals reported in other flares (Singh et al. 2023) and also in historical literature (Kane 1974).The response is stronger in Hα than in Hβ, which Zirin et al. (1982) noted and attributed to the higher opacity of the line and Capparelli et al. (2017) used to infer electron beam statistics using RADYN models (Allred et al. 2015).The Hβ line has a shorter response time with emission decreasing from the peak values back down to quiescent levels about an hour earlier than Hα, which could be attributed to the lower enhancement of Hβ above the background emission strength compared to Hα, as well as potential differences in the formation processes of the lines.

Na index
The Na i D 1 and D 2 lines centered at 5895.92 Å and 5889.95Å are strong resonance lines that require three-dimensional NLTE modeling (Leenaarts et al. 2010;Lind et al. 2011).These lines are often described as purely chromospheric (e.g., Gomes da Silva et al. 2011) but over the last few years it has been shown that the line core of these lines is sensitive to a range that goes from the high photosphere to the low chromosphere (Kuridze et al. 2016).In general, for the quiet Sun, the lines form just above the temperature minimum, while the formation height moves down significantly in areas with high magnetic concentrations (Leenaarts et al. 2010), meaning that the line core brightness correlates to magnetic bright points in the lower photosphere.It has also been shown by Rutten et al. (2011) that the Na i D 1 line suffers from an asymmetry in formation height, with the blue wings showing inverse granulation, while the red wings show normal granulation lower down.In the contrast profiles, we see that the opposite is true for the Na i D 2 line, where the asym-metry is on the blue side.Despite this, Short & Doyle (1998) showed that these lines do track the Hα index well.
The two lines are used together for a single activity index in a similar fashion as for the S-index.Díaz et al. (2007) defines where D 1 and D 2 correspond to two 1-Å-wide windows centered on the two sodium lines.B and V are in this case 10-and 20-Åwide windows centered at 5805.0 and 6090.0Å, respectively.However, instead of taking the average of these windows, the 10 highest flux values inside of these bands are averaged.
Similarly to the Hα index, this band is very wide and samples photospheric contributions (e.g., Rutten et al. 2011, Fig. 1).In addition, the response of the line is asymmetric, so we adapt our window to match both of these aspects and end up with a 0.4-Å-wide window centered 0.1 Å bluewards and redwards of the respective line cores.In Fig. 9, we show the difference between the index as defined by Díaz et al. (2007), a symmetrical index with a narrower width, and the one described above.Both flares do not show any response to the classical index, while the strongest signature can be seen in the asymmetric index.
While it is hard to call this a detection, the red line in Fig. 7 is slightly raised with respect to the mean value from the moment when the X9.3 flare starts, especially when compared to the broader indices shown in Fig. 9.

He index
The He i D 3 line at 5875.62 Å requires to be modeled in threedimensional NLTE (Libbrecht et al. 2021).Due to its low opacity, this line is dominated by the photospheric continuum in quiet regions, while it gains opacity in active regions (Landman 1981;Heinzel et al. 2020).This means that in quiet-Sun environments, the line is hardly present, that is, it appears and becomes deeper as more activity is present (Landman 1981, Fig. 1).For this reason, it is necessary to correct for the continuum component when studying this line in resolved observations (Libbrecht 2016, Figs. 4.8 and 4.9).In addition, we can see from the same figure, as well as those presented in Libbrecht et al. (2021) that this method could potentially be utilized with activity indices, where the index is divided by a quiet day or the outer wings of the profile.However, the S/N ratio of our data is not sufficient to meaningfully test this idea.Therefore, we used the classical He activity index as defined by Boisse et al. (2009).
where F He corresponds to two 0.4-Å-wide windows centered at the He i line, and B and V correspond to two 5-Å-wide windows centered around 5869.0 and 5881.0Å, respectively.No signature of either flare shows up in this index, which could be a matter of the flares being too weak, or that the flares are located so close to the limb, where higher atmospheric layers get more opacity.

Radial velocity measurements
The RV method detects planets by observing the host star's reflex motion-induced velocity changes, which are typically of the order of a few meters per second for mini-Neptune exoplanets, but a few tens of centimeters per second for Earth-like ones.This technique measures the spectral shift compared to a reference, or as a function of time to find periodicity.However, besides traditional noise sources due to the instruments (Dumusque et al. 2021;Cretignier et al. 2021), such detections are made more difficult by variations in activity on the stars themselves (Meunier et al. 2010;Dumusque et al. 2011;Meunier et al. 2017;Cretignier et al. 2022;Sen & Rajaguru 2023).Indeed, the transit of active regions across the stellar disk has been known to cause signals in RV similar to those of planets (e.g., Queloz et al. 2001;Bonfils et al. 2007;Huélamo et al. 2008;Meunier et al. 2010;Dumusque et al. 2014;Zhao & Dumusque 2023).As a consequence, several planetary claims have been shown to be induced by stellar activity or are still debated today, for instance, the case for Barnard's star (Ribas et al. 2018;Lubin et  Since the RV value is obtained from broad bandpass highresolution spectra, the RV observations are often paired with monitoring of one or more activity indices, which can be used to retrieve the rotational period of the star (Butler et al. 2017;Langellier et al. 2021), especially on stars where active regions can persist for hundreds of rotations (Robertson et al. 2020).However, the sparse observational sampling of RV stellar observations can provide a poor temporal sampling for active regions that evolve rapidly while on the disk, or transient events such as flares that can still cause RV offsets of a few meters per second on M-dwarfs in the infrared (Reiners 2009), this is also called 'activity jitter'.Additionally, simulations have shown that the contribution function of photospheric lines can expand well into the chromosphere where peak beam energy deposition occurs (Monson et al. 2021), confirming that a strong enough flare should have an RV imprint.
We investigate the effects of these flares on solar RVs.The RVs were extracted using a cross-correlation function (CCF, Baranne et al. 1996;Pepe et al. 2002) with a tailored line selection of 3277 photospheric stellar lines between 3900 Å and 6828 Å. Lines are selected based on morphological criteria of the line profiles in order to avoid the strongest blends (Cretignier et al. 2020a).Only lines presenting a clear line profile with a resolved line core were kept.The use of a CCF in signal processing is a typical way to extract the small shift signatures by agglomerating the information of thousands of photospheric stellar lines.The RV curve was then de-trended by the daily averaged RV to remove the effect of active regions on the solar rotation.The detrended RVs with their corresponding error bars were plotted in Fig. 10, together with a scaled GOES curve.
Due to the instrumental stability and granulation signals, we do not expect an RV dispersion smaller than 50 cm s −1 (Al Moulla et al. 2023).While the scatter in the points is too large to claim a detection, a tightening of the scatter and a small bump of a few tens of centimeters per second do coincide with the GOES curve, although the second peak corresponds to the secondary bump rather than the X9.3 flare peak in much the same way as the S-index did.Even if the present work cannot significantly detect the signature in RVs, an upper limit of 50 cm s −1 can be fixed which represents the intrinsic stability of the HARPS-N spectrograph.This value is lower than the one obtained in Reiners (2009) which can be explained either by the different flare intensities, the different stellar spectral types, or the different spectral ranges of the spectrographs.We then studied in a similar fashion the RV time series of each individual line rather than the average value obtained from the CCF.The line-by-line (LBL) RVs were obtained as in Dumusque (2018) using a template matching method.The vast majority of the LBL RVs were not correlated to the GOES peak.This is not surprising given that the LBL RVs precision does not exceed ∼5 m s −1 for the best lines.A closer investigation of the top three most correlated lines reveals that they are all blends (4947.6Å: V ii and Si i, 5664.0Å: Ni i and Cr i, and 4327.1 Å: Fe i and CH).Previous studies have shown that RVs coming from blended lines should be carefully interpreted (Cretignier et al. 2020a, Appendix).This raises the question if a similar, and more significant, trend would emerge when investigating a much stronger stellar flare with the same methods.

Equivalent width measurements
Recent high-resolution spectroscopic studies have demonstrated how the EW of some atomic lines increases with stellar activity.Different studies have confirmed that spectral lines are systematically deeper in active stars than in quiet ones with similar stellar parameters.Reddy & Lambert (2017) demonstrate that iron lines forming in the upper layers of the photosphere (that is, at small optical depth) yield larger abundances than those forming deep in the photosphere.The authors also show how the barium over-abundance correlates with stellar activity in young stars.Following this, Yana Galarza et al. (2019) shows a similar behavior of spectral lines when analyzing the young (∼400 Myr) solar-analog HIP36515.The stellar parameters derived with the classic spectroscopic equilibrium approach vary with activity as well, as a consequence of this activity-related enhancement of the spectral lines.Significant changes of effective temperature T eff , surface gravity log g, and (in particular) micro-turbulence velocity parameter ξ are detected along the activity cycle, which translates also in changes of the overall iron content [Fe/H] and age determination.Later, Spina et al. (2020) expanded the analysis to a sample of 211 Sun-like stars and investigated the behavior of 20 different atomic elements.The authors report an increase of EW with activity along the stellar cycle especially in moderate to strong lines.This is in line with Yana Galarza et al. (2019) and Spina et al. (2020), who report that the major effects are visible in lines with EW ≳ 50 mÅ or optical depth log τ < −1 dex.As a consequence of the spectroscopic abundance analysis, these effects result in an over-estimation of ξ and under-estimation of T eff , log g (even though to a smaller extent), and [Fe/H].For Ba, the authors confirm the previous study by Reddy & Lambert (2017).Finally, Baratella et al. (2020bBaratella et al. ( , 2021) ) analyse dwarf stars in several young open clusters (OCs) and reach the same conclusions.On the one hand, they state that the classic EW method (that is, using only iron lines, which form on a wide range of optical depth) fails when applied to very young and/or active stars.One way out is the application of new methods and a more refined selection of the spectral lines used in the analysis.On the other hand, the barium over-abundance is strictly related to the activity but the same could be said also for other elements, such as yttrium if the abundance is derived using very strong spectral lines.This is in stark contrast to solar abundance studies where typically only quiet-Sun observations are considered and where the phase of the solar cycle is known (e.g., Bergemann et al. 2021;Pietrow et al. 2023a).
In high-resolution solar observations, it is possible to confirm interpretations of the changes of spectral lines as a result of activity (Ichimoto & Kurokawa 1984;Hong et al. 2018), for example, by using spectroscopic inversion codes (e.g., Kuridze et al. 2018;de la Cruz Rodríguez et al. 2019;Pietrow et al. 2020;Kianfar et al. 2020).However, these effects have only been studied for a select number of lines, and not in a disk-integrated environment.Therefore, it is still largely unknown what the main cause(s) of these EW enhancements is (are), although the most affected lines seem to be those that form in the highest part of the photosphere.
The set of HARPS-N observations of solar flares offers a unique opportunity to check if we can detect the same effects observed in younger and more active stars.We measured the EW of the spectral lines listed in Baratella et al. (2020a) with the code ARES v2 (Sousa et al. 2015), which allows us to measure them in a fast and automatic way.The line list is specifically designed to study Sun-like stars observed with HARPS-N and it comprises a total of 225 lines of 11 different atomic species.In particular, iron lines are used to derive the stellar parameters by imposing the excitation (for T eff ) and ionisation (for log g) equilibria, and by imposing that the abundances of each line do not correlate with the reduced EW (for micro-turbulence velocity ξ).To do this, we used the automatic software qoyllur-quipu (q 2 , Ramírez et al. 2014).
In general, we detect no significant variations of the T eff , log g, and ξ with the flare detection.The scatter of the measurements along the whole time series is of the order of 70 K, 0.1 dex, and 0.15 km s −1 for the three parameters, respectively.These values are comparable with the typical uncertainties found with this method.We can conclude that there is no distinct signal of the flare in the stellar parameters determination via the EW method.
At a deeper investigation, the EW of each spectral line of the different atomic species shows no variation along the time series as well.We do not see any variation of EW directly linked to the flare in any of the 225 spectral lines in the list.The scatter of the measurements of each individual line is small (within ∼5 mÅ for the majority of the lines), and mainly due to continuum placement.In Spina et al. (2020) and Baratella et al. (2020b), variations larger than 10 mÅ are expected, especially in moderate and strong lines: we do not observe this in our set of spectra.This means that activity, which is not visible in the RV or white-light light curves, should not affect measurements of this kind.

High-resolution flare observations
In Figs.11 and 12, we present the evolution of the two flares in the Hα and Ca ii 8542 Å lines using Color Collapsed plots (CO-COPLOTs, Druett et al. 2022b), as well as by showing the total circular polarization (Stokes-V), and a continuum image.CO-COPLOTS is a technique where a three-dimensional data cube is collapsed into a two-dimensional image, processing the collapsed dimension into an RGB color value via three filters that can be used to select ranges of interest in the collapsed dimension.Here, we collapse the spectral dimension by applying the red filter to the red wing of the line, the green filter to the line center, and the blue filter to the blue wing.In the third column of Fig. 13 a COCOPLOT applied to the time series of the line core is shown for both flares, in order to capture the evolution of the flare in a single RGB image.This is combined with two background-subtracted solar activity maps (BaSAMs, Denker & Verma 2019).The concept of BaSAMs was initially introduced by Verma et al. (2012) to monitor changes in the magnetic field around decaying pores, and more recently, Kamlah et al. (2023) presented BaSAMs for high-resolution images.This technique involves calculating an average two-dimensional map for the entire time series, subtracting this average map from each individual image, and computing the modulus of these difference maps to obtain the final average two-dimensional BaSAMs.
In the top row of Fig. 13, we see a BaSAM for the X2.2 flare in the 4000 Å continuum, the Hα line core, and a temporal COCOPLOT of the Hα line core.The bottom row shows the same thing but for the X9.3 flare.
For the first flare, the most significant changes in both the continuum and Hα BaSAMs are observed in the curved penumbral filaments encircling the rotating umbra (green arrows), which shows the increasing helicity of the flare.In addition, noticeable small-scale changes are seen along the elongated penumbra and the lower part of the PIL, which seem to correspond to the footpoints of the flare (magenta arrows).The temporal COCOPLOT shows that the structure over the rotating umbra becomes narrower over time, and expands further outwards (blue arrow).
For the eruptive X9.3 flare, extended regions exhibit significant signals in the BaSAMs.The footpoints of the flare loop arcades are visible in the continuum BaSAMs (green arrows), along with small-scale changes throughout the rotating umbra and along the elongated PIL (magenta arrows).In Hα BaSAMs, the two extended flare ribbons are clearly delineated (green arrows).Moreover, strong variations are observed in the neighboring umbra (magenta arrow), indicating the broader extent of the X9.3 flare.The COCOPLOT captures the expansion of the flare ribbons over time, as well as the acceleration of this process.The difference in the extent of variations in both metrics also suggests that the first flare is confined, while the subsequent flare is eruptive in nature.
In addition, the secondary peak in the GOES spectrum occurs during a period of dramatic expansion of one bright flare ribbon over the dark umbra beneath (Fig. 12e,f), and also the formation of a new arcade system outside of the SST field of view (see AIA videos).

Discussion
The two flares, that have been investigated in this work, are amongst the best-studied solar flares ever, making them excellent  2010) demonstrate how difficult it is to detect a solar flare signal in TSI, even for an X-class flare.In their work, the signal of 42 flares in the range from X1.3 to X10 was combined to recover a detectable signal.For weaker flares, this is even more complex because 1477 flares in the range from M1.6 to C4 had to be averaged to achieve a significant detection.This places the two studied flares, with estimated energies of 2.2 × 10 31 erg and 9.3 × 10 31 erg, amongst the smallest stellar flares ever detected.This is because many stellar flare observations are made with comparatively broad filters which require a strong white-light signal to create a detectable peak.However, a significant signal is found primarily in chromospheric spectral lines, and the activity indices derived from them.
While only a select number of works have reported flare observations with high-resolution spectra, a pattern in the contrast profile seems to emerge when these are compared to the results of Otsu et al. (2022).For example, a superflare on YZ Canis Minoris reported by Namizaki et al. (2023) seems to be located close to the limb when its contrast profile pattern is compared to Fig. 4 of Otsu et al. (2022).On the other hand, the superflare on HK Aqr reported by Martínez González et al. ( 2022) has been assigned a heliocentric latitude of around 34 degrees by the authors, which places it relatively close to the disk center.The contrast profiles shown in their Fig. 4 are similar to the pattern shown in Fig. 2 of Otsu et al. (2022), which is also taken for a flare close to the disk center, further validating the idea that the shape of the contrast profiles depends on the location of the flare on the disk.From these works, a constant shape in the profile would be expected for our flares, as they took place close to the limb.This is indeed the case.
Activity indices and contrast profiles.The strongest signal was found in the Ca ii H & K lines, where the enhancement in both the S-index and the contrast profiles was above 1%.However, the intensity and width of these metrics were comparable for both flares, including the magnitude of the chromospheric evaporation, with the only differentiating factor being the duration of each flare.
Our analysis extended to the behavior of the Hα and Hβ lines, revealing a weaker but still distinguishable signal if a modified narrower definition of the activity index was used.A stronger response was seen in Hα than in Hβ, likely due to the higher opacity of the former.In addition, these lines brightened several minutes before the start of the flare, which is likely a manifestation of the Neupert (1968) effect (see next section).
This makes these lines potentially valuable as short-term flare predictors.
We studied multiple other activity indices, including He i D 3 , the Na i D lines, Mg i 5173 Å, Fe i 6173 Å, and Mn i 4031 Å. Notably, we found no flare signatures in the helium, magnesium, and iron lines, but did find an asymmetrical structure in both sodium lines, and a delayed signal in the manganese lines.Both signals are in line with expectations based on prior work (Doyle et al. 1992;Rutten et al. 2011).As a result, a modified asymmetrical sodium index was proposed.It is unknown what could cause the signal in the manganese line, given the current consensus that these lines are not pumped.
Radial velocity and equivalent width measures.In terms of RV measurements, we found that flares of this magnitude can cause RV offsets despite not being visible in TSI.However, these offsets are no larger than a few tens of centimeters per second.This can be explained by the RV signal mainly coming from the wings of photospheric lines (where the flux derivative is sharper), which are formed in a deeper atmospheric layer that is less affected by the flare.
We find the same for the effects of the flare on the EW measurements, in the sense that it does not seem energetic enough to leave an imprint on the EWs and consequently on the abundances.

Solar context
In this section, we give a detailed description of the environment that gave rise to the flares, their evolution, and other related signatures resulting from the flares.
X-ray flux and (extreme) ultraviolet light curves.The diskintegrated emission from AIA full-disk observations is presented as light curves in Fig. 1.Each AIA channel observes a different set of ions formed at different temperatures and thus at different formation heights.This gives rise to another manifestation of the Neupert effect, where the impulsive peak of the flare in each of the channels will occur later or even earlier than the peak of the GOES X-ray flux.This is generally interpreted as being the result of the downward precipitation of energy from the heated corona to lower layers via non-thermal electrons that lose their energy by colliding with ions in the dense lower atmosphere.This creates hard X-rays and drives chromospheric evaporation, that is, the conversion of cool chromospheric material into hot upflowing plasma, which increases the density in the corona and leads to an increase in soft X-ray emission (e.g., Qiu 2021).Thus, the ascending part of the SXR curve (before its maximum) is expected to follow approximately the cumulative integral of the impulsive HXR signal (Neupert 1968).Woods et al. (2011) shows that the 304 Å emission rises early along with the 171 Å emission in the absence of coronal dimming.Coronal dimming can be seen between the two flares but not after (see the 171 Å signal in Fig. 1 between 09:40 and 12:00 UT).The 94 Å emission, on the other hand, tends to peak a few minutes after the peak of the GOES X-ray flux and can have a secondary peak minutes later due to post-flare loop reconnection (e.g., Mitra et al. 2018).
Location and evolution.Active region NOAA 12673 appeared as a single symmetrical sunspot on 29 August 2017, which evolved into a complex δ-spot during its disk passage due to a pile-up of trailing spots with opposite polarities.This resulted in a spot with a curved polarity inversion line (PIL) that coincided with a light bridge (Yang et al. 2017;Verma 2018;Wang et al. 2018;Romano et al. 2018;Bamba et al. 2020).
The region exhibited strong photospheric motions, which when combined with the consistent flux emergence made this active uniquely capable of producing flares (Joshi & Mitra 2022).The region became one of the most productive active regions of Solar Cycle 24, unleashing in total 40 C-, 20 M-, and four X-class flares (Sun & Norton 2017;Romano et al. 2018;Vissers et al. 2021).
The X2.2 flare was the result of a strong shearing flow along the PIL between the dominant positive-polarity region and the parasitic negative-polarity umbra encroaching on its east side.This caused the intrusion and eventual penetration of the negative-polarity region into the positive polarity in its northern section (Yang et al. 2017;Hou et al. 2018;Inoue et al. 2018;Romano et al. 2018;Wang et al. 2018;Verma 2018;Inoue & Bamba 2021;Zou et al. 2019Zou et al. , 2020)).Figure 11a shows the total signed circular polarisation signal (that is, Stokes-V) in the Ca ii 8542 Å line, which thus displays the chromospheric imprint of the line-of-sight (LOS) magnetic field structure in the early stages of the X2.2 flare at 09:04:30 UT.The flare ribbons over the parasitic, negative-polarity region appear white and impinge on the positive-polarity region to the north of the flare (with flare ribbons that appear black).Thus, we interpret that the intrusion of the negative-polarity patch has triggered reconnection that causes brightenings in a number of strongly curved flare ribbons around this impinging polarity as well as in a ribbon to the lower right of this in Fig. 11a.A co-temporal Hα COCOPLOT is shown in Fig. 11b, where several bright flare ribbons (with broad emission, hence appearing white) have been formed around the edges of the umbrae (black) in this complex δ-spot (with some overlying cool material).Liu et al. (2018) and Price et al. (2019) found that the magnetic helicity increased significantly, which is consistent with our observations of the rotation of the impinging negative-polarity umbra (compare Fig. 11a,c and the top row of Fig. 13).This rotation occurs co-temporally with the expansion of the flare ribbon areas, and a small white-light flare signature (red arrow in Fig. 11d) indicates deeper energetic action, visible in the Ca ii K continuum channel and which sweeps around the umbra in a clockwise direction.The ribbon to the south also expands in area (red arrows in Fig. 11e,f, which shows the Hα and Ca ii K CO-COPLOTs at 09:11:52 UT), and a small cool arcade rises (magenta loops, see blue arrow).Where the umbra is impinging, the footpoint of a filament is located.This filament of cool material runs from north to south, along the main PIL of the subsequent X9.3 flare (green arrow, magenta in Fig. 11e,f).The flux rope eventually erupted, triggering the X9.3 flare at 11:53 UT (Jiang et al. 2018;Chakraborty et al. 2021).At times between the two large flares, several smaller brightening can be seen which do not produce any measurable signal in the GOES curve.This suggests that they are either weak flares or below or heating caused by the movement or shuffling of the loops (Skan et al. 2023).
The ribbons of the X9.3 flare were observed from an early stage in the Hα 6563 Å, Ca ii 8542 Å, and Ca ii K 3933 Å lines and the 4000 Å continuum by the SST (Fig. 12).Flare ribbons form along a great length of the PIL between the two regions.The ribbons start out close to the PIL (Fig. 12a) producing strong central enhancement in the Ca ii 8542 Å line profiles, which are thus bright green in the COCOPLOT.Along the PIL, between the ribbons, we also see the previously formed flare filament in dark purple (red arrows in Fig. 12a).The LOS magnetic structure before the flare is shown in the HMI magnetogram in Fig. 12b.Early in the X9.3 flare, a white light signature (Kretzschmar 2011) was detected in the Ca ii K continuum.The ribbons expand in area both in the north-south direction as well as outward from the PIL in this stage of the flare, as the reconnection continues and the footpoints of the reconnection field loops expand outward in line with the standard solar flare model.Fig. 12c,d display the flare 5 min later at around 12:06 UT in Ca ii 8542 Å and Hα respectively.The flare ribbons have continued expanding outward from the PIL, which produces a signature in the HARPS-N data (see Fig. 5).This will also expand the footpoint areas of chromospheric evaporation, that is, hot upflows from the lower atmosphere that fills the loop with dense hot material and leads to UV and X-ray emission.
Figure 12e shows a series of 'fringes' emitted to the west and south from the western flare ribbon (red arrow).These are the fronts of the sunquake (Zharkov et al. 2020;Zharkova et al. 2020) reported in Quinn et al. (2019).This sunquake coincides in time and propagation direction with the start of an expansion of the flare ribbons and thus potentially corresponds to magnetic reconnection in a new region.This expansion of the ribbon is seen in Fig. 12f at 12:45:21 UT.The western ribbon extends to cover the umbra of both sunspots, one can also observe cool coronal upflows and downflows superimposed over the ribbon along very widely arched or open field lines.This rapid expansion and covering of the umbra cause a peak in brightness in both the GOES and AIA channels (see Fig. 1).
Corresponding coronal mass ejections.The three-dimensional propagation, and thus the Doppler signal of CMEs in interplanetary space is determined by their launch direction from the Sun, their initial width, and their velocity in interplanetary space.Therefore, it is possible to have large CMEs without a corresponding Doppler signal if the launch direction is perpendicular to the Sun-Earth axis, or is launched on the back side of the Sun (Tassev et al. 2017).Strong (X-class) flares are eruptive in 90% of the observed cases.In the remaining 10%, a flare is confined and produces a so-called pseudo-CME (Vourlidas et al. 2010(Vourlidas et al. , 2013)), which is a type of CME that peaks in size below 7 R ⊙ , rather than above 10 R ⊙ , as is usual.A flare's 'eruptiveness' is related to its location with respect to the flux-weighed magnetic center of the source active region, with eruptive flares taking place further from the center than confined ones.This is likely due to the overlying arcade field, which dampens the upward motion, thus preventing the flare from becoming eruptive (Wang & Zhang 2007;Thalmann et al. 2015).
In the case of our flares, the first resulted in a pseudo-CME with an estimated speed of 391 km s −1 , while the latter was accompanied by a halo-CME (see Fig. 14) with a speed of 1910 km s −1 (Scolini et al. 2020).
Earth response.A CME will affect the Earth only when it is launched roughly in our direction, or its expansion is suffi-ciently large that it appears as a halo CME.The geomagnetic storms resulting from flares and associated CMEs produced by active region NOAA 12673 have been extensively studied in the context of space weather, especially in relation to their effect on Earth.The halo CME launched on September 6 was caused by the X9.3 flare and interacted with two CMEs in interplanetary space.These were previously launched in September 4 from the same active region and reached Earth on September 8, causing a geomagnetic storm (Scolini et al. 2020).When a CME hits Earth, it compresses the magnetosphere, magnetically reconnects with the magnetosphere, and injects particles into the van Allen radiation belts.A portion of the injected particles precipitates into the upper atmosphere and causes aurora.However, more importantly, the injected particles increase the strength of Earth's ring current, which again induces a magnetic field that can be measured at the surface.The Dst index gives the strength of the induced magnetic field as determined by four magnetic observatories located near the equator, and is the standard measure for the strength of geomagnetic storms.Our complex CME event resulted in a (provisional) Dst index of −122 nT, classifying the geomagnetic storm on the weaker side of intense geomagnetic storms.
Besides the geomagnetic storm, the X-ray emission of both flares caused a measurable enhancement in the ionospheric (150 -300 km) electron density and temperature (Yamauchi et al. 2018;Yasyukevich et al. 2018;Mendoza et al. 2019;de Paula et al. 2022).This increase in density absorbs radio waves, including those used by aviation and emergency services (Redmon et al. 2018), as well as GPS services (Desai & Shah 2020).The larger flare caused a 1.5-hour ionosonde blackout in several sun-lit regions, while the smaller one caused a blackout for half the time (Berdermann et al. 2018;Zhang et al. 2019;Fagundes et al. 2020;Amaechi et al. 2021).However, the radio emission from the flare itself did not affect any services in a measurable way (Zhou et al. 2018).
The X8.3 flare that happened several days after these two had much less of an effect on the Earth due to its proximity to the solar limb (Shagimuratov et al. 2020;Chakraborty et al. 2021), suggesting that the majority of the emitted light moves radially outward.Bagiya et al. (2018) confirms a type of centerto-limb (CLV) relation between the electron content measured in the sunlit ionosphere and the flare location, which matters more than the strength.Qian et al. (2019) shows the same for the extreme ultraviolet (EUV), but notes that the soft X-ray enhancement is essentially not affected by the location of a flare on the solar disk, which is in line with how GOES measures flare intensities.Lyakhov & Korsunskaya (2018) concludes that purely the GOES flare classification without location information of the flare on the disk is not enough to accurately predict the ionosphere response, which can cause the radio wave impact to be underestimated.On top of that, simulated responses on Mars and Venus show differences in the ionospheric response compared to Earth, which means that the results for our planet are likely universal (Yan et al. 2022).Flares, including the X9.3 flare, have also been correlated to earthquakes on Earth (Novikov et al. 2020;Marchitelli et al. 2020), although the process is still debated.
These effects on Earth are, however, very mild compared to the potential effects that large stellar flares can have on exoplanets.For example, a strong enough flare can alter, or even erode exoplanet atmospheres, and even cause loss of potential oceans on the surface (Ilin et al. 2021, and references within).However, the same work showed that the strongest flares tend to appear at high latitudes on the stellar disk, which means that the effects will likely be less intense than an equivalent flare near the disk center.

Solar-stellar context
While much can be learned from the HARPS-N contrast profiles, the prior discussion makes it clear that there are limitations to observing flares in one dimension versus two dimensions.
For example, both flares have a very similar signature in the S-index, RV profile, and even for chromospheric evaporation, despite being almost an order of magnitude apart in energy.With the duration of flares being the only potential discriminator between their strength.More importantly, it was impossible to distinguish between the eruptive flare that resulted in a halo-CME and the confined flare.This could also explain why it has so-far been rare to detect CME signatures in stellar flare data, as the geometry of the problem might be a strong factor in whether or not the CME is measured.
For example, the flare measured by Namekata et al. ( 2021) likely occurred near the disk center, as its contrast profile is similar to the one shown in Fig. 2 of Otsu et al. (2022).This shape is explained in Otsu et al. (2022) as being the result of an interplay between the ejected material going up, and later down, along the LOS.A statistical study on solar flares in a Sun-as-a-star setting could shed more light on the fraction of flares that seem to have an accompanying CME versus the actual fraction.
In addition, the resolved images showed that the response in the Ca ii H & K lines, and thus the S-index scale primarily with the area of the bright flare ribbons rather than the peak of the flare itself.This response is highly non-linear in relation to flare strength, with potentially even smaller flares producing a similar excess in the spectrum.The Hα line and index do not suffer from this problem, and therefore are a much less biased metric.

Conclusions
In this study, we investigated the properties of an eruptive X9.3 flare and its confined X2.2 predecessor in a one-dimensional disk-integrated setting and compared these findings to highresolution resolved observations of the same event.While these flares are some of the strongest solar flares ever recorded, they are simultaneously amongst the weakest stellar flares ever detected with energies of roughly 2.2×10 31 and 9.3×10 31 erg, respectively.This unique comparative analysis between the HARPS-N disk-integrated spectra and high-resolution observations revealed several valuable insights which are summarized below.

Activity indices
The strongest signal was found in the Ca ii H & K lines, where the enhancement in both the S-index and the contrast profiles was above 1%.However, the intensity and width of these metrics were comparable for both flares, despite the almost one order of magnitude difference in energy, as well as the fact that the X2.2 flare was confined and the X9.3 flare was eruptive.In addition, the delayed peak of the S-index seemingly aligns with the moment where the flare ribbon covers the most area on-disk, not the peak of the flare itself.This implies that this index is more sensitive to the area of the bright flare ribbons, rather than the total flare brightness.This combined with the fact that small noise-like peaks in this index seemingly align with weak flares, implies that the S-index is highly responsive to flare activity, but in a non-linear way that biases the results towards higher activity.This is not the case for other indices, especially the Hα line which seems to be a better metric for flare strength, duration, and activity in general.In addition, this line brightened several minutes before the start of the flare, with a time offset consistent with previous research.A similar behavior was noted in the AIA 193, 304, 1600, and 1700 Å channels, which makes these lines/channels potentially valuable as short-term flare predictors.
We studied multiple other activity indices, including He i D 3 , the Na i D lines, Mg i 5173 Å, Fe i 6173 Å, and Mn i 4031 Å. Notably, we found no flare signatures in the helium, magnesium, and iron lines, but did find an asymmetrical structure in both sodium lines, and a delayed signal in the manganese lines.Both signals are in line with expectations based on prior work (Doyle et al. 1992;Rutten et al. 2011), and as a result, a modified asymmetrical sodium index was proposed.It is unknown what could cause the flare signal to present itself in the manganese line.

Radial velocity and equivalent width measurements
In terms of RV measurements, we found that flares of this size can cause RV offsets, but not larger than a few tens of centimeters per second.Furthermore, the timing of the peaks aligns better with that of the S-index, meaning that it is more sensitive to the total area of brightenings induced by the flare, rather than the total flare intensity.However, it is hard to draw any strong conclusions from a signal this weak, and a statistical follow-up is required.
Similar conclusions can be drawn regarding the effects of the flare on the EW measurements.The observed flare events seem to be not energetic enough to see signatures in the EWs measurements and consequently on the results of the stellar abundance analysis similar to what is found in much younger stars.Nevertheless, we cannot exclude that flares might be one of the causes (if there are more than one) of the growing EW with activity.It would be interesting to repeat the same study as the time series of a stronger stellar flare to study its effects on the RVs and EWs.

Flare signatures and coronal mass ejections
All prior metrics that register the X2.2 flare do so in a manner that is nearly identical to the X9.3 flare in all aspects except the duration of the enhancement in the contrast profiles.This is despite the fact that the two flares are almost one order of magnitude apart in energy, as well as one being eruptive and the other confined.
The signature in the contrast profile time series had the same shape as the limb flare studied by Otsu et al. (2022) and the signature found by Namizaki et al. (2023).This, together with the findings of Otsu et al. (2022) andMartínez González et al. (2022) shows that the location of the flare impacts the shape of the contrast profiles.If this behavior is indeed universal, then a more systematic study into these patterns may result in additional spatial constraints for stellar flares.The same could also shed more light on the rate of false negatives of flare CMEs, because in our case no difference in chromospheric evaporation was seen between the two flares.

Outlook
The recent increased interest in Sun-as-a-star studies is being fuelled by the insights that they provide to both the solar and stellar research communities.They enable solar physicists to contextualize the behavior of the Sun within the broader stellar regime and provide a resolvable solar context for stellar spectral emissions.While our results were fundamentally enabled by the unique nature of this data set, which contained two very strong and well-understood flares, similar investigations can be done for other flares, or even different types of active regions as long as there is some context for them.
In addition, new Sun-as-a-star instruments are being developed and installed around the globe on telescopes with highresolution spectrographs (e.g., PEPSI (Strassmeier et al. 2018), HARPS/HELIOS, NEID (Lin et al. 2022), ESPRESSO/POET, and EXPRES (Llama et al. 2022)).Once all operational, this will result in a (near) constant coverage of the Sun (if weather permits), and thus greatly increase the overlap with general solar observations.

Fig. 1 .
Fig. 1.Comparison between spatially integrated and normalized AIA UV and EUV intensities and the normalized GOES X-ray flux.The area between the dashed lines shows the time window over which the X2.2 and X9.3 flares have been enlarged for the lower two panels.The gray shaded area represents the time during which HARPS-N observed, and the blue shaded area represents when SST was observing.

Fig. 2 .
Fig.2.Overview of the weather and seeing conditions at the SST on 6 September 2017.The red curve represents the solar intensity in arbitrary units as measured by the SHABAR showing a smooth curve, which indicates a cloud-free day.The Fried parameter r 0 is plotted in blue.The black curve represents the scaled GOES X-ray flux, and the vertical light-blue bands in the background refer to times when the SST flare data were taken.

Fig. 4 .Fig. 5 .
Fig. 4. Contrast profiles spanning the entire HARPS-N time series of 10 spectral regions that are centered on the Ca ii H & K, Hα, Hβ, He i D 3 , Na i D 1 and D 2 , Mg i 5173 Å Mn i 4031 Å, and Fe i 6173 Å.Each plot shows both the wavelength and Doppler velocity centered at each respective line versus the time starting from the beginning of the X9.3 flare.

Fig. 9 .
Fig. 9. Variation of Na i D 1 line integration window for activity index.

Fig. 10 .
Fig. 10.Relative comparison between activity indices which have been normalized to the quietest period between 10:00 and 11:00 UT.The gray vertical line denotes the start of the X9.3 flare.

Fig. 13 .
Fig. 13.BaSAMs and temporal COCOPLOTs of the X2.2 and X9.3 flares mapping the points of largest change in the FOV.The first column shows a BaSAM of the 4000 Å continuum point over the entire time range.The second column does the same but for the Hα line core.The third image captures the time evolution in the Hα line core, with red being early in the time series, green towards the middle, and blue late.

Fig. 14 .
Fig. 14.CME related to both flares as seen roughly two hours after their occurrence: (Pseudo)CME corresponding to the X2.2 flare (left) and halo-CME corresponding to the X9.3 flare (right).