AGN STORM 2. IV. Swift X-Ray and Ultraviolet/Optical Monitoring of Mrk 817

The AGN STORM 2 campaign is a large, multiwavelength reverberation mapping project designed to trace out the structure of Mrk 817 from the inner accretion disk to the broad emission line region and out to the dusty torus. As part of this campaign, Swift performed daily monitoring of Mrk 817 for approximately 15 months, obtaining observations in X-rays and six UV / optical ﬁ lters. The X-ray monitoring shows that Mrk 817 was in a signi ﬁ cantly fainter state than in previous observations, with only a brief ﬂ are where it reached prior ﬂ ux levels. The X-ray spectrum is heavily obscured. The UV / optical light curves show signi ﬁ cant variability throughout the campaign and are well correlated with one another, but uncorrelated with the X-rays. Combining the Swift UV / optical light curves with Hubble Space Telescope UV continuum light curves, we measure interband continuum lags, τ ( λ ) , that increase with increasing wavelength roughly following τ ( λ ) ∝ λ 4 / 3 , the dependence expected for a geometrically thin, optically thick, centrally illuminated disk. Modeling of the light curves reveals a period at the beginning of the campaign where the response of the continuum is suppressed compared to later in the light curve — the light curves are not simple shifted and scaled versions of each other. The interval of suppressed response corresponds to a period of high UV line and X-ray absorption, and reduced emission line variability amplitudes. We suggest that this indicates a signi ﬁ cant contribution to the continuum from the broad-line region gas that sees an absorbed ionizing continuum.


INTRODUCTION
With just a handful of exceptions (Event Horizon Telescope Collaboration et al. 2019;Gravity Collaboration et al. 2018, 2020, 2021), the angular size of the inner regions of active galactic nuclei (AGNs) are too small to be spatially resolved.Piecing together the geometry and kinematics of the inner regions of AGNs therefore requires the use of additional techniques.Variability studies are particularly powerful, with small size scales achievable through high time resolution.In particular, reverberation mapping (Blandford & McKee 1982;Peterson 2014) uses time lags, τ , between light curves at different wavelengths to determine the size scale, R ≈ cτ , of emitting regions.By observing continuum and emission lines from X-rays through the near-infrared (IR) one can probe the locations of the X-ray corona, accretion disk, broad-line region (BLR), dusty torus and beyond (see Cackett et al. 2021, for a recent review).
A big step forward in reverberation mapping studies was the large, coordinated, multiwavelength AGN STORM campaign on NGC 5548 (De Rosa et al. 2015).During this cam- * Visiting Fellow at UCLan paign the Hubble Space Telescope (HST) performed daily ultraviolet (UV) spectroscopic monitoring of NGC 5548, with contemporaneous monitoring by Swift (Edelson et al. 2015) plus ground-based photometry (Fausnaugh et al. 2016) and spectroscopy (Pei et al. 2017).AGN STORM revealed a number of interesting and surprising results, including identification of a period where all the emission lines and highionization absorption lines decoupled from the continuum variations (dubbed the "BLR holiday"; Goad et al. 2016), suggesting the presence of a variable, obscuring disk wind (Dehghanian et al. 2019a,b).
AGN STORM also showed clear wavelength-dependent continuum reverberation lags spanning approximately 1000 -10000 Å and roughly following τ ∝ λ 4/3 (Edelson et al. 2015;Fausnaugh et al. 2016), the wavelength-dependence expected for a standard (e.g., Shakura & Sunyaev 1973) geometrically thin, optically thick accretion disk (e.g., Collier et al. 1999;Cackett et al. 2007).However, the magnitude of the lags was a factor of ∼3 larger than predicted using analytical models and reasonable estimates of the mass accretion rate (Edelson et al. 2015;Fausnaugh et al. 2016), a problem that is now commonly seen in continuum reverberation mapping experiments (e.g., Jiang et al. 2017;Cackett et al. 2018Cackett et al. , 2020;;Fausnaugh et al. 2018;Mudd et al. 2018;Edelson et al. 2019;Pozo Nuñez et al. 2019;Jha et al. 2022;Guo et al. 2022).A similar disk size problem was first identified from microlensing studies of gravitationally lensed quasars (e.g., Morgan et al. 2010).Kammoun et al. (2019Kammoun et al. ( , 2021a,b) ,b) address the (apparent) size discrepancy using more detailed models of a centrally illuminated, reverberating thin disk, though in the absence of any BLR contribution to the continuum emission, which photoionization models predict must be present at some level.
A common model for continuum reverberation lags is the lamppost model, where variations in X-ray emission drive the observed variability at longer wavelengths through thermal reprocessing in the disk.However, the X-ray variations in NGC 5548 were seen to not be simply related to the variability at longer wavelengths (Starkey et al. 2017;Gardner & Done 2017).Similarly, observations of other objects also show that the X-ray to UV correlation is typically weaker than the UV to optical correlation (e.g., Edelson et al. 2019;Cackett et al. 2020;Hernández Santisteban et al. 2020).Dynamic variability in the X-ray source can potentially explain the moderate X-ray to UV correlation (Panagiotou et al. 2022).However, in some cases the X-ray and UV are not correlated at all (e.g., Schimoia et al. 2015;Buisson et al. 2018;Morales et al. 2019), presenting a challenge to the simplest reprocessing scenario.
Another complication seen in AGN STORM was that the U band showed a lag in excess of an extrapolation of the other UV/optical bands (Edelson et al. 2015;Fausnaugh et al. 2016).This can be interpreted as the BLR producing significant bound-free and free-free continuum emission, the spectrum of which should peak at the Balmer jump, which lies in the U band (Korista & Goad 2001, 2019;Lawther et al. 2018;Netzer 2020Netzer , 2022)).U-band excess lags are almost universally seen (McHardy et al. 2014(McHardy et al. , 2018;;Edelson et al. 2017Edelson et al. , 2019;;Cackett et al. 2020;Hernández Santisteban et al. 2020), and spectral-timing analysis revealed a broad lag excess and discontinuity at the Balmer jump in NGC 4593 (Cackett et al. 2018).While the BLR diffuse continuum peaks locally at the Balmer and Paschen jumps, it contributes broadly across the UV/optical (e.g., Korista & Goad 2001;Netzer 2022).More advanced time lag analysis also suggests a significant contribution from a more distant reprocessor throughout the UV and optical as well (Chelouche et al. 2019;Cackett et al. 2022).A contribution to the lags from the BLR diffuse continuum emission could account for a significant portion (possibly all) of the apparent disk size disparity.
The AGN STORM 2 project is the next large, coordinated, multiwavelength reverberation mapping campaign.It is built around a large HST program (Peterson et al. 2020) to monitor the nearby Seyfert 1 galaxy Mrk 817 (z = 0.031455) every other day for approximately 15 months.Additional high-cadence contemporaneous monitoring data were obtained by Swift, NICER, optical and near-IR ground-based photometry and spectroscopy plus a smaller number of deeper observations by XMM-Newton and NuSTAR.Mrk 817 has a black hole mass of M = 3.85 × 10 7 M ⊙ (Bentz & Katz 2015), and is accreting at an Eddington ratio of approximately ṁE = 0.2.Kara et al. (2021), hereafter Paper I, describes the campaign in detail and presents the results from the first three months of the project.Initial observations at the beginning of the campaign discovered unexpected and variable obscuration in both the UV and X-ray (Kara et al. 2021, andalso Miller et al. 2021 for an independent analysis of the X-ray obscuration).Despite this, both UV/optical continuum reverberation and emission line reverberation were still observed.Homayouni et al. (2023, hereafter Paper II) presents the HST observations and UV emission line reverberation from the full campaign.Paper III (Partington et al. 2023) presents a detailed analysis of the X-ray spectral variability using NICER.
Here, in Paper IV, we present the Swift observations from the full campaign, and study the UV/optical continuum variability and reverberation.
In Section 2 we describe the data reduction, and in Section 3 we present our analysis, including the X-ray variability, UV/optical continuum reverberation, and an analysis of the variable UV/optical spectral energy distribution (SED).Finally, we discuss the implications of our results in Section 4.

DATA REDUCTION
The Neil Gehrels Swift Observatory (hereafter Swift) monitored Mrk 817 daily, concurrently with HST, with 1 ksec observations for ∼15 months from 2020 November 22 to 2022 February 24.Data were obtained both through a target of opportunity request and a Swift Key Project (proposal number 1720084, PI: Cackett).Swift monitoring is continuing as part of an extended campaign (proposal 1821087, PI: Gelbord), but we limit this analysis to those data that overlap with the HST project.There are occasional gaps of a few days in the Swift monitoring caused by limited visibility during orbital pole observing constraints.Toward the very end of the campaign Swift entered a safe mode due to the loss of a reaction wheel.This resulted in no observations being performed for 1 month between 2022 January 18 and 2022 February 18.
The X-ray light curves are produced using the Swift/XRT data products generator1 (Evans et al. 2007(Evans et al. , 2009)), with background-subtracted count rates obtained in the 0.3 -1.5 keV (soft, S) and 1.5 -10 keV (hard, H) bands per snapshot (spacecraft orbit).To crudely trace spectral changes, we calculate a hardness ratio, HR = (H − S)/(H + S).Fig. 1 shows the X-ray light curves and hardness ratio during the AGN STORM 2 campaign (right panels) and during the previous ∼15 months of monitoring by Morales et al. (2019) for comparison.A dramatic drop in the X-ray count rates, a factor ∼ 6 on average, is seen during the AGN STORM 2 campaign compared to the historical average.The X-ray count rates are given in Table 1.Dates are given as HJD − 2,450,000 throughout the paper.
The UVOT analysis follows the procedure outlined in previous work (Edelson et al. 2015(Edelson et al. , 2017(Edelson et al. , 2019;;Cackett et al. 2020;Hernández Santisteban et al. 2020).The data were processed with HEASOFT v6.29.The flux of Mrk 817 is measured for each epoch and filter using the UVOTSOURCE tool.We use a circular source region with a 5 ′′ radius, and background annulus from 40-90 ′′ .Any stars that fall within the background annulus are excluded.Data quality tests are used to screen out observations bearing evidence of target tracking errors or extended point-spread functions (PSFs), eliminating between 5 and 21 measurements per filter.We also use detector masks to screen out measurements that are likely to be significantly affected by areas of the detector with reduced sensitivity.The process of determining the detector mask is described in Hernández Santisteban et al. (2020).In this work we found that a less aggressive detector mask could be used as compared to previous work.Those prior efforts used the equivalent of the "Mid" small scale sensitivity (SSS) maps whereas we opt for the "Low" SSS masks that are now available as part of the Swift CALDB (Breeveld 2022).This masking process rejects between 3.4% (B) to 18.4% (UVM2) of the images.The resulting light curves contain between 346 (V) and 292 (UVM2) epochs.The Swift UVOT light curves are given in Table 1 and are shown in Fig. 2.
In addition to the Swift X-ray and UV/optical light curves, we also include the UV continuum light curves from HST in our analysis.The HST data analysis is described in Paper II (Homayouni et al. 2023) and the data can be obtained from the Mikulski Archive for Space Telescopes (MAST) at the Space Telescope Science Institute via doi:10.17909/n734-k698.

X-ray variability
The X-ray light curves (Fig. 1) show a significant change in both count rate and hardness compared to the previous Swift monitoring of Mrk 817.The count rates during AGN STORM 2 are on average a factor of 6 lower.Variability, especially in the soft band, is generally low aside from a notable and dramatic flare peaking on day 9329.During the flare, the 0.3 -10 keV count rate increases by a factor of ∼10 compared to the mean rate around day 9300, briefly (for a few days) exceeding the historical averages in both the soft and hard bands.Increases in count rate of this A portion is shown here for guidance regarding its form and content.S is the X-ray rate in the 0.3 -1.5 keV band, while H is the X-ray rate in the 1.5 -10 keV band.The X-ray rates are given as count rates, while the Swift/UVOT fluxes have units of 10 −15 erg cm −2 s −1 Å −1 .
magnitude over this timescale are seen in earlier monitoring of Mrk 817 (Morales et al. 2019), but it is more pronounced here given the overall lower fluxes and variability throughout the rest of the campaign and the higher monitoring cadence.Previous faint X-ray states for Mrk 817 have been observed -longer term X-ray monitoring presented in Winter et al. (2011) shows that ROSAT observations from the early 1990s found Mrk 817 a factor of 40 fainter than a 2009 XMM-Newton observation.For comparison, the 0.4 -8 keV X-ray flux observed by NICER ranged from 9 × 10 −13 to 2 × 10 −11 erg cm −2 s −1 during STORM 2 (Partington et al. 2023), while ROSAT observed a minimum of 8 × 10 −13 erg cm −2 s −1 (0.1 -2.4 keV) and XMM-Newton a maximum of 3.3 × 10 −11 erg cm −2 s −1 (0.3 -10 keV; Winter et al. 2011).
The average background-subtracted 0.3 -10 keV count rate during AGN STORM 2 is around 0.1 c s −1 , leading to typically less than 100 counts in each spectrum.With so few counts, we do not perform individual spectral fits.Instead, we examine the X-ray spectral variability using an Xray hardness-intensity diagram (HID), comparing the hardness ratio to the 0.3 -10 keV count rate (see Fig. 3).Data from AGN STORM 2 mostly fall in a different part of the HID than earlier observations.Previous X-ray variability studies of Mrk 817 have shown a softer-when-brighter behavior (Winter et al. 2011;Morales et al. 2019).To demonstrate how this changes the hardness ratio, we used XSPEC (Arnaud 1996) to calculate the expected count rates and hardness for power-law spectra with power-law indices ranging from Γ = 2.2 to 1.6 (in steps of 0.2), assuming Galactic absorption of N H = 1.5 × 10 20 cm −2 (Dickey & Lockman 1990) and varying the power-law nor-Figure 1. Swift X-ray light curve of Mrk 817 in the (a; top) total: 0.3 -10 keV, (b; upper middle) soft: 0.3 -1.5 keV, and (c; lower middle) hard: 1.5 -10 keV bands.Panel (d; bottom) shows the hardness ratio.Left-hand panels show the data from Morales et al. (2019), while the right-hand panels show the AGN STORM 2 campaign.There is a gap of ∼830 days between the two campaigns.Blue dashed lines indicate the historical average fluxes calculated from all Swift data taken before this campaign.A dramatic drop in flux is seen for all bands during AGN STORM 2. malization to roughly match the observed trend on the HID (purple triangles in Fig. 3).Note that a change in normalization simply shifts the points up and down, while a change in power-law index alters the hardness ratio.The softer-whenbrighter trend matches the historical Swift data, as expected given the spectral fitting performed by Morales et al. (2019).But, a simple power-law with just Galactic absorption does not match the rest of the variability seen in the HID.
Since fits to higher quality XMM-Newton, NuSTAR and NICER spectra (Kara et al. 2021;Miller et al. 2021;Partington et al. 2023) show the spectrum is highly obscured, we also investigate the impact of an obscurer on the hardness.Here, we assume Γ = 2.0, a power-law normalization of 5 × 10 −3 photons keV −1 cm −2 s −1 at 1 keV, and the same Galactic absorption.However, we also include a partial cov-ering absorber (zxipcf in XSPEC), with a covering factor of 0.9 and an ionization parameter of log ξ = 1.0.We vary the column density of the absorber from N H = 2.5 × 10 21 cm −2 to 2.5 × 10 23 cm −2 .The results are shown as orange stars in Fig. 3.At first, the increasing N H leads to a decreasing count rate and a hardening of the spectrum.But, above approximately N H = 3.5 × 10 22 cm −2 the spectrum softens because the increasing column density begins to decrease the count rates in the hard band above 1.5 keV.Thus, the softest spectra at the lowest observed count rates are due to the highest absorbing column.
While these models are just for illustration, it indicates that the main trend in the HID during AGN STORM 2 is consistent with significant changes in the obscurer, but to explain the full HID requires variability in the intrinsic flux as well.This is explored in significantly more detail in Paper III (Partington et al. 2023), which tracks the change in the X-ray obscurer using NICER spectral monitoring.The hardness ratio changes are similar to what is seen in NGC 5548 where changes in both intrinsic flux and obscuration are also seen (Mehdipour et al. 2016).

Time Series Analysis
All the light curves show clear variability throughout the campaign (see Fig. 2), but, the X-ray variability is quite different from the UV/optical.The UV/optical light curves show strong peaks and troughs that are seen at all wavelengths, with the longer wavelength variability features smoother than the shorter wavelength ones.This UV/optical behavior is typical of other continuum reverberation mapping campaigns.The X-ray behavior, however, is quite atypical.Usually there is some level of correlation between the X-ray and UV/optical (e.g., McHardy et al. 2018), and the X-rays vary more rapidly than the UV/optical (e.g., Gardner & Done 2017;Starkey et al. 2017).We observe a difference in Mrk 817 -there is no significant correlation and much of the structure in the UV/optical variability is not seen in the X-rays.
Before performing a time lag analysis, we qualitatively compare the X-ray, UVW2 and HST 1180 Å light curves.
The first illustrates the lack of correlation with the X-ray and the second illustrates that the UVW2 light curve is not simply a shifted and smoothed version of the 1180 Å light curve.We then measure the time lags between the different UV/optical bands using a variety of analysis techniques.We first use the standard interpolation cross-correlation function (ICCF) method (Gaskell & Peterson 1987;White & Peterson 1994;Peterson et al. 2004), then we apply more sophisticated approaches using the JAVELIN (Zu et al. 2011(Zu et al. , 2013) ) and PYROA (Donnan et al. 2021) techniques.We include the four HST continuum light curves from Paper II in addition to the six Swift UVOT light curves measured here.The central wavelengths for all the bands are given in Table 2.The Swift light curves have a higher cadence than the HST light curves, so we use the Swift/UVW2 band as the reference.

X-ray vs UVW2
In the top panel of Fig. 2, it is immediately apparent that there is little correlation between the X-ray and UVOT light curves.This lack of correlation was seen previously in Mrk 817 by Morales et al. (2019) and in Paper I. We calculate the cross-correlation function (CCF) between the X-ray and UVW2 light curves.The maximum correlation coefficient for a lag between −20 and 20 days is just 0.33 and no lag can be determined between the X-ray and UVW2 bands.To better display the relationship between the X-ray and UVW2 light curves we show a larger version of just these two light curves in Fig. 4, with the X-ray count rates on a log scale to better highlight the variability at low count rates.While there are some peaks in the X-ray light curve that correspond to a peak in the UVW2 light curve, as indicated by vertical dotted lines, the UVW2 variability does not match the variability in the Xrays generally.There appears to be better agreement between the UVW2 and X-ray light curves after around day 9310.Performing a CCF on just that portion of the light curves does give a better maximum correlation coefficient of ∼0.5, but there is no clear peak and the correlation coefficient is still too low to determine a lag.

1180 Å vs UVW2
An initial visual inspection of the light curves in Fig. 2 shows a different long-term trend in the two shortest wavelength HST light curves (1180 Å and the 1398 Å) compared to the longer wavelength Swift UVOT light curves.This is most evident when comparing the light curve peaks near days 9300 and 9490.In the shortest wavelength light curves these two peaks reach approximately the same flux (the second is brightest in 1180 Å), while at longer wavelengths the second peak is substantially fainter.Homayouni et al. (submitted) found that the UV emission lines could not simply be fit by shifting, smoothing, and scaling the 1180 Å continuum during AGN STORM 2. This is not unexpected at least from a photoionization point of view (Goad et al. 1993  Goad 2004; Goad & Korista 2015), since local gas physics suggest few lines (with the possible exception of He II and Fe Kα) will respond linearly to variations in the incident ionizing continuum flux, and even a 'linearized' echo model will break down in the face of large amplitude continuum variations (peak to peak variations of factors of several or more).However, splitting the light curves into different segments they found that the emission-line lags differed in each segment.
To assess whether the different long-term continuum trends we observe here may be associated with the time segments identified in Homayouni et al. (in prep), in Fig. 5 we compare the 1180 Å flux to the UVW2 flux, for times when the UVW2 observation was obtained within ±0.5 days of the 1180 Å observation.The different time segments show approximately the same slope (indicating a similar response to changes in ionizing flux), but there appears to be a vertical offset between them -this is most apparent between the sec- ond (blue) and last (gray) time segments.Aside from the first ∼150 days, all segments behave in a similar way.
We investigate this further by normalizing each of the light curves for direct comparison to the UVW2 light curve by subtracting the median and dividing by the standard deviation.In this format, light curves that are simply scaled versions of each other should overlap, and any deviations from this become apparent.Fig. 6 compares several normalized light curves to the normalized UVW2 light curve.For the shortest wavelength bands we see a discrepancy between the light curves during the first ∼150 days.At later times, the light curves are generally consistent with being scaled versions of each other.The variations are well correlated over the first part of the light curve, while they cannot be described by the same scaling.This is most prominent comparing the shortest wavelength (1180 Å) light curve to UVW2, but even between the Swift bands a discrepancy can be seen at the double trough around days 9240 -9250.The troughs are significantly deeper at the shortest wavelengths.
As we discuss later, these different long-term trends present a problem for modeling the light curves, and therefore we perform lag analysis on both the original and detrended light curves.Detrending is the process of subtracting a long-timescale trend from the light curve (e.g., Welsh 1999).We do this by subtracting a running Gaussian average with a width of σ = 20 days for each light curve independently.We initially tried a linear detrending, but this did not fully solve the scaling mismatch early in the light curve.We experimented with a range of different widths for the Gaussian, and chose the broadest width Gaussian that allows the 1180 Å and UVW2 light curves to be well-matched.

ICCF
We first calculate the interband lags using the ICCF technique.Briefly, we calculate the CCF between each of the light curves and the UVW2 reference light curve.The CCF is calculated from −20 to 20 days (but only shown from −4.5 to 4.5 days in Fig. 2 for clarity).The flux randomization/random-subset sampling (FR/RSS) method (as implemented by Peterson et al. 2004) is used to determine the uncertainties in the lags, with 10,000 light curve realizations.This both randomizes the flux at each epoch (FR) assuming a Gaussian distribution with a mean and standard deviation equal to the observed flux and its measurement uncertainty, and samples a subset of on average ∼2/3 of the data with replacement (RSS).For each realization the CCF is calculated and the peak and centroid of the CCF are determined, with the centroid calculated using only points that are greater than 0.8 of the maximum CCF value, R max .The median and 68% confidence intervals of the centroid and peak distributions are used to determine the lag peak (τ peak ), centroid (τ cent ) and their associated uncertainties.
The Swift light curves have a higher cadence than the HST light curves and so lead to better constrained lags.Of the Swift UVOT bands, the UVW2 band has the highest variability amplitude and shortest wavelength, and so we adopt it as the reference band relative to which we measure the lags of the other bands.The lags, along with the variability amplitude (F var ;Vaughan et al. 2003), the maximum correlation coefficient (R max ), and the filter central wavelengths are given in Table 2.All lags here are quoted in the rest frame, assuming a redshift of z = 0.031455 (Strauss & Huchra 1988).
The right-hand panels of Fig. 2 show the CCF for each band, while the histograms show the distribution of lag centroid values from the FR/RSS method.For the UV/optical bands, the lag centroid is shown as a function of wavelength in Fig. 7.The lags generally increase with wavelength, roughly following τ ∝ λ 4/3 , with a potential excess lag in the U-band and some scatter.For all the Swift bands, the lag peaks are shorter than the lag centroids, though both still generally increase with increasing wavelength.That the CCF peak lag is shorter than the centroid lag indicates that the CCF is asymmetric, which would indicate an asymmetric transfer function (since the CCF is the convolution of the auto-correlation function with the transfer function).Disk transfer functions are asymmetric (e.g., Cackett et al. 2007;Starkey et al. 2016), but this could also indicate emission from an extended region (Cackett et al. 2022).The difference between peak and centroid is particularly noticeable in the U band where the BLR diffuse continuum emission peaks locally.
As discussed earlier, the shortest wavelength light curves show a different long-term trend than the rest of the light curves.We therefore also determine the lags from the detrended light curves.We find this shortens the lags quite dramatically in most bands (e.g., more than a factor of 2 in U and B), indicating that there is a contribution to the lags on long timescales.The resulting lags are given in Tab. 2 and shown as open symbols in Fig. 7.The detrended centroid lags are consistent with the peak lags from the non-detrended light curves.The U-band excess is not observed in the detrended lags, suggesting the excess lag is caused by the variability on long timescales that is removed by detrending.
A number of previous studies show that lags can be timescale-dependent, with long-term variations significantly impacting the measured lag (e.g., McHardy et al. 2014McHardy et al. , 2018;;Pahari et al. 2020;Vincentelli et al. 2021).Moreover, recent work investigating frequency-dependent time lags in NGC 5548 showed that it was low-frequency (longtimescale) variations from large sizescales that dominate the CCF measurement (Cackett et al. 2022).The difference between the lags that we measure in Mrk 817 once detrended also supports this.These long-term trends are thought to be due to variability from more distant regions, or some other source of variability in the disk, and so need to be removed in order to isolate the short-term variations expected to be from inner disk reverberation.We searched for lags between the detrending functions themselves, but did not measure anything significant.
We also try calculating the lags by using the non-detrended light curves only after day 9330, ignoring the early part of the light curve where the scaling discrepancy occurs.The lag centroids in all bands are consistent within 1σ with lags from the full light curve.However, the U, B, and V -band lags all drop by approximately 0.9 days.We leave a more detailed investigation of lags during different periods of the light curves to future work.

JAVELIN
The JAVELIN analysis package (Zu et al. 2011(Zu et al. , 2013) ) uses the Markov Chain Monte Carlo (MCMC) method to model the variability of the reference light curve assuming a damped random walk to model the light curve.JAVELIN is particularly useful when there are gaps in the light curves, since it uses information on the variability properties of the light curve to interpolate between the gaps.JAVELIN has been shown to produce estimates of the uncertainties that are closer to the input of simulations than the ICCF method (Yu et al. 2020).
To measure lags between different bands, one first fits the reference band light curve with a damped random walk model.JAVELIN then takes the posteriors on the variability parameters from this fit and shifts, smooths and scales the light curve to fit the other band.The shifting and smoothing assumes a top-hat transfer function.For all bands with wavelengths longer than UVW2, we use the UVW2 as the reference light curve.For the bands shorter than UVW2 we use the band of interest as the reference, and UVW2 as the responding light curve, and then flip the sign of the lags.We fit pairs of light curves (wave band of interest plus reference band) rather than fitting all light curves simultaneously (with a different lag for each light curve) as we found it did not easily converge with so many light curves at one time.We find that when modelling the UVW2 and HST light curves the model overfits the data, with unrealistic variability on short timescales to try to match every variation in the light curve (see Fig. 8).This is indicative of the different longterm trends in the light curves -they break the assumption that the light curves are simply shifted, smoothed, and scaled versions of each other.Interestingly, if we omit the first portion of the light curve (before day 9330) then JAVELIN can fit the light curves without this problem.We also find that when modeling the detrended light curves we do not encounter this problem either, and find a good fit to the light curves and well-recovered lags in all bands (see Fig. 9).JAVELIN lags are given in Table 2 and shown in panel (b) of Fig. 7.The JAVELIN lags are much closer to the ICCF peak lags than the centroid lags.

PyROA
The PYROA analysis package (Donnan et al. 2021) takes a Bayesian MCMC approach to fitting the light curves.The light curves are modeled using a running optimal averageeach point in the light curve is an inverse-variance weighted average of the data within a window function.The window function reduces the weight of the data points far from the time of interest (see equation 1 in Donnan et al. 2021).The algorithm fits the model to determine the mean and rootmean square (rms) of each light curve as well as the width of the running optimal average window function and the lag between each of the light curves.Moreover, PYROA fits for additional variance to expand the uncertainties in each light curve, this accounts for cases where uncertainties in the data have been underestimated.In principle, it can be run to fit all light curves together, but, as described above, the differing long-term trends between the HST and the UVW2 band prevent achieving a good fit.We therefore fit each of the light curves individually, but find issues in those shortest bands -to achieve a reasonable fit PYROA must expand the uncertainties significantly, and still the best-fit model underpredicts some peaks and troughs (see Fig. 8).Similar to what we found with JAVELIN, the varying long-term trend breaks the assumption of the light curves simply being shifted, smoothed, and scaled versions of each other.
Table 2. Time lags (rest frame) calculated with respect to UVW2, along with the variability amplitude and maximum correlation coefficient.PYROA has the option to fit a variable background to each light curve (detrending).However, to be consistent with the other analysis techniques, we fit the detrended light curves.We find all detrended light curves can be fit together, resulting in good fits to the light curve (see Fig. 9) and welldetermined lags in each band.This method requires the shortest wavelength (1180 Å) light curve to be used as the reference and assumed to have zero lag, which differs from the other approaches that have used UVW2 as the reference.
In Table 2 we give the PYROA lags, and they are also shown in panel (c) of Fig. 7.For the lags from fits to the detrended light curves, we shift all lags by the 1180 Å to UVW2 lag for direct comparison to lags determined with other methods.

Spectral Analysis
We can use the light curves to determine the spectrum of the variable and constant components using the flux-flux analysis method (also sometimes referred to as the flux variation gradient method, see, e.g., McHardy et al. 2018;Hernández Santisteban et al. 2020;Cackett et al. 2020;Fian et al. 2022, for recent examples).We deredden the observed light curves assuming Galactic absorption of E(B−V ) = 0.022 mag and a Cardelli et al. (1989) extinction law with R V = 3.1.The flux densities are also corrected to the rest frame (through f λ /(1 + z) 3 ).We fit the light curves with a linear model using a dimensionless light curve X(t) that is normalized to have a mean of 0 and standard deviation of 1.The model light curve for each band is then a constant, A ν (λ), plus X(t) multiplied by a scale factor S ν (λ), In other words, the variability in each band is a shifted and scaled version of the dimensionless light curve X(t), and there is no change in the shape of the spectral energy distribution (SED) of the variable component.The light curves are fit simultaneously with X(t), A ν (λ), and S ν (λ) as free parameters.Since the HST and Swift data are not sampled at the same cadence, we only include data points within 0.5 days of the UVW2 observations.We do not correct for time lags, though lags should only add scatter to the flux-flux plot.
The scale factor S ν (λ) gives the rms spectrum of the variable component of the light curves.We determine the constant component of the spectrum, A ν (λ), by evaluating the bestfitting flux-flux relations at X(t) = X g defined by where the error envelope of the fit to the 1180 Å band intercepts f ν = 0 (see Fig. 10).The maximum and minimum spectral energy distributions are determined at X(t) = X B and X F respectively.We show the flux-flux relations in Fig. 10, and the resulting SED of Mrk 817 in Fig. 11.The best-fitting parameters are given in Tab. 3. The rms spectrum approximately follows the relation f ν ∝ λ −1/3 expected for an accretion disk, though more realistic disk models (e.g., Slone & Netzer 2012) give a spectrum that is closer to constant in f ν over the observed wavelength range for the black hole mass and mass accretion rate of Mrk 817.The constant component shows a strong increase at around 2000 Å that may be associated with a strong non-variable, or slowly varying, Fe II component and/or diffuse continuum.The host-galaxy flux below 3000 Å should be minimal compared to the AGN, while at longer wavelengths the host-galaxy contribution becomes important.That the variable SED follows f ν ∝ λ −1/3 and does not turn over significantly at the blue end suggests that intrinsic reddening of the continuum in Mrk 817 is not significant.This is in contrast to Jaffarian & Gaskell (2020) who determine intrinsic reddening of E(B − V ) = 0.55 for Mrk 817.Merritt (2022) also finds a lower intrinsic reddening of E(B −V ) = 0.1 to 0.2.

DISCUSSION AND SUMMARY
We monitored Mrk 817 for approximately 15 months with Swift in the X-ray and six UV/optical bands as part of the AGN STORM 2 campaign.The 0.3 -10 keV X-ray count rates are on average a factor of 6 fainter than archival observations, and show suppressed variability aside from a large flare (factor of 10 increase) which peaks close to the historical mean flux.Analysis of the X-ray hardness-intensity  diagram shows that the Swift X-ray spectra are consistent with being heavily obscured, with variability in the absorption throughout.This matches what is seen in higher quality XMM and NuSTAR spectra (Kara et al. 2021;Miller et al. 2021).Tracking of the variable X-ray spectrum with NICER is explored in more detail in Paper III (Partington et al. 2023).
The Swift UV/optical light curves are highly variable throughout the campaign.Despite the X-ray count rate being significantly fainter, the UV flux remains almost unchanged when compared to archival data.The X-ray band is poorly correlated with the UV/optical light curves throughout, with a maximum correlation coefficient of R max = 0.33 days.This was also seen during the previous Swift monitoring of Mrk 817 (Morales et al. 2019).During that previous campaign, X-ray obscuration does not appear to have been significant, while our current campaign had significant obscuration throughout.The lack of correlation may be explained if the obscuration seen by the continuum-emitting region is not what we see along our line of sight, or if X-ray variations are not significantly affecting the emitted optical/UV flux or vice versa.
The UV/optical light curves, both HST and Swift, are wellcorrelated with each other throughout.We measure interband continuum lags that generally increase with increasing wavelength.Interestingly, we find that the light curves show a period at the beginning where the strength of the variations in the continuum is suppressed compared to later periodsthe shortest wavelength light curve (1180 Å) cannot be simply shifted and scaled to match the longer wavelength light curves with one scale factor for the full campaign (see Fig. 5).While the slope of the relation between the two bands is approximately the same throughout, the normalization of the relation changes.This discrepant period can also be seen by comparing scaled versions of the light curves directly (Fig. 6).There, the significant double trough towards the beginning of the light curve is significantly less deep in the longer wavelength bands compared to 1180 Å, while variations in the latter part of the light curve are well matched.
This double trough occurs at the time in the first half of the light curve when the UV and X-ray absorption is strongest, as measured by the equivalent width of the broad Si IV absorption trough and the X-ray, N H , column density (Kara et al. 2021).We demonstrate this in Fig. 12 by comparing the difference in flux between the normalized UVW2 and 1180 Å light curves with the evolution of the broad Si IV absorption equivalent width (EW), calculated from the HST spectra following Kara et al. (2021) and to be presented in detail in a future paper.In the early part of the light curve, the growth of the discrepancy between the light curves follows the in-crease in absorption, and the reduction in the discrepancy follows the decrease in absorption.The discrepancy has a maximum approximately when the absorber is strongest, and the light curves come into agreement again shortly after the absorption reaches a minimum.The light curves remain similar after this, despite a large increase in absorption toward the very end of the campaign.
It is tempting to associate the discrepancy in fluxes at the beginning of the campaign with the presence of increased absorption.It is interesting that this early part of the light curve is also where the lag of the C IV emission line changes dramatically, dropping from around 12 days in the first time segment to 2 days in the second (Homayouni et al., submitted).As discussed in that paper, this anomalous behavior is potentially explained by the high obscuration early on -the appearance of an obscuring screen between the ionizing radiation and the BLR will cause the nearby material to stop responding first, giving rise to a long lag.The disappearance of this screen will weight the response to smaller radii again.Moreover, radiation absorbed by the obscurer must be reemitted, and Dehghanian et al. (2019b) predict that this reemitted flux is largely in enhanced diffuse continuum, and in the broad wings of the emission lines.This enhanced diffuse continuum emission could be appearing in the Swift UV bands.That we see anomalous behavior in the continuum at the same time as this anomalous behavior in the emission lines and the high obscuration potentially suggests a significant fraction of the continuum emission arises in the BLR at all wavelengths.This is similar to behavior in NGC 5548 where during the anomalous 'BLR holiday' when emissionline variations decorrelated from the continuum (Goad et al. 2016), the continuum bands also showed a change in correlation (Goad et al. 2019).This was used to argue a significant fraction of the continuum arises from the BLR, not the disk.Here too, the behavior we observe suggests a significant fraction of the continuum arises from the BLR, though careful modeling (e.g., Korista & Goad 2019;Netzer 2022) is needed to determine exactly how much.
Alternatively, it could simply be that there is additional underlying disk variability that is not associated with reverberation.Variability on long timescales (thousands of days) is usually not associated with reverberation (e.g., Breedt et al. 2009), but in this case the anomalous period is much shorter, just 100 or so days.However, recent work to create temperature maps from AGN light curves (Neustadt & Kochanek 2022) shows temperature fluctuations on timescales of tens to hundreds of days that are not associated with reverberation.What we are seeing here in Mrk 817 could also be temperature fluctuations in the disk not associated with reverberation.
Since the continuum variability breaks one of the fundamental assumptions of light curve modeling methods (that the light curves are blurred, shifted, and scaled versions of one another), such methods (JAVELIN and PYROA) do not do a good job fitting the original light curves.We overcome this by detrending the light curves to account for the suppressed response at the beginning of the campaign.This allows for good fits with both JAVELIN and PYROA (compare Fig. 8 and Fig. 9 for fits without and with detrending), and well-determined lags using these methods.The JAVELIN and PYROA lags are significantly shorter than the lag centroid determined using the ICCF method on the unadjusted light curves, and closer to the lag peak.The ICCF lag centroid from the detrended light curves more closely matches the JAVELIN and PYROA lags.The detrending we perform is higher-order than the linear or low-order polynomial more commonly used, but is required given the relatively sharp and short-term discrepancy in the continuum bands.While this allows for successful modeling of the light curves it may be removing some of the real lag signal on long timescales.
The difference between the lag centroid and lag peak from the unadjusted light curves indicates an asymmetric transfer function -that there is significant response on longer timescales.This is supported by the decrease in lag centroid once the light curves are detrended.An excess lag in the U band is seen in analysis of the unadjusted light curves in the lag centroids using the ICCF technique and in PYROA fits.This U-band excess is almost universally seen in other continuum reverberation-mapping and has been attributed to diffuse continuum emission from the BLR (Korista & Goad 2001, 2019;Lawther et al. 2018;Netzer 2020Netzer , 2022)).While it peaks in the U band at the Balmer jump, and also at the Paschen jump, the BLR diffuse continuum should affect all wavebands.Since the BLR emitting region is presumably more extended than the UV/optical part of the accretion disk, the timescale of the response from the BLR should be longer than from the accretion disk.It is interesting, that when longtimescale variations are removed the U-band excess disappears.This would again support the idea that significant continuum emission originates from the BLR.Of course, the Swift filters are broadband and so include emission lines too.Fig. 13 shows a broadband HST/STIS spectrum from our campaign compared to the Swift filter bandpasses.Prominent emission lines C III] λ1909, Mg II λ2800 and Hβ fall within the UVW2, UVW1, and B filters respectively.This will lengthen the lags in those bands, though simulations during other campaigns show this does not dominate (e.g., Fausnaugh et al. 2016).See a similar discussion for the case of Fairall 9 in Edelson et al. (in prep.).On the other hand, the HST continuum light curves are calculated over line-free integration windows (Homayouni et al. 2023).A full analysis of the lags using frequency-dependent methods (Cackett et al. 2022) and power spectral analysis is left to future work, as is a detailed modeling of the spectra to determine the strength of the expected BLR continuum lags following the methods of Korista & Goad (2019) and Netzer (2022).
We use a flux-flux analysis to separate the variable and constant components of the light curves.The variable spectrum approximately follows f ν ∝ λ −1/3 as expected if the variable component is dominated by a geometrically thin, optically thick accretion disk.The constant component shows a strong increase at ∼2000 Å that may be associated with strong non-variable (or slowly varying) Fe II component and/or diffuse continuum.At longer wavelengths the constant component can be attributed to the host-galaxy flux.
As noted in the Introduction, many previous continuum reverberation campaigns have found lags to be a factor of a few longer than expected given reasonable estimates for the mass and mass accretion rate.Removing long-timescale variations shortens the lags, and these shorter lags are generally consistent with the expected disk size.Equation 12 from Fausnaugh et al. (2016) gives the expected lag at the reference band, α.We use UVW2 as the reference band, and assume M = 3.85 × 10 7 M ⊙ and ṁE = 0.2 for Mrk 817, along with assuming an accretion efficient of η = 0.1 and a local ratio of external to internal heating of κ = 1.This gives α = 0.31 days.Our best-fitting τ ∝ λ 4/3 relations to the detrended lags range from α = 0.23 ± 0.04 (JAVELIN) to α = 0.53 ± 0.13 (ICCF), bracketing the expected disk size.Thus, the lags on short timescales are broadly consistent with reverberation from a standard disk.
Some alternative models for continuum reverberation lags invoke different geometries.One example is the model of Starkey et al. (2023), where there is a steep rim occurring near the disk's dust sublimation radius (the 'bowl' model).We fit this model jointly to the bright and faint disk SED (determined from the flux-flux analysis) and the PYROA lags (not detrended).This model fits the SED and lags well.The best-fitting lag relation is shown as a dashed line in panel (c) of Fig. 7.Note how the lag relation flattens off at longer wavelengths.The inclusion of ground-based optical light curves at longer wavelengths will allow for a better test of this model.
Future AGN STORM 2 papers will present photometric and spectroscopic ground-based optical and near-IR data to probe more distant material, and more sensitive X-ray spectra from NuSTAR, and XMM to better trace the X-ray obscurer.Extended monitoring of Mrk 817 with Swift, NICER, and ground-based monitoring continues and promises to offer further insights into this complex AGN.

Figure 2 .
Figure 2. Left: Swift (green) and HST (blue) light curves of Mrk 817 during the AGN STORM 2 campaign.Right: Cross-correlation functions calculated with respect to the light curve in the Swift/UVW2 band (solid lines).Normalized histograms show the ICCF centroid distribution, with the vertical solid and dashed lines showing the lag centroid and 1σ uncertainty range, respectively.

Figure 3 .
Figure 3. X-ray hardness-intensity diagram for Mrk 817.Black circles show data taken during the AGN STORM 2 campaign, while blue squares show data taken prior to this campaign.The variability patterns are clearly different.Error bars are omitted for clarity, but a representative error bar is shown.Purple triangles show the evolution of a power-law that is softer-when-brighter. Orange stars shown the evolution of a partially covered power-law with increasing column density from NH = 2.5 × 10 21 cm −2 to 2.5 × 10 23 cm −2 .Arrows indicate the direction in which the parameters increase.

Figure 4 .
Figure 4.A detailed comparison of the (a) X-ray and (b) UVW2 light curves of Mrk 817.The X-ray light curve is on a log scale to better highlight the variability at low count rates.Generally, the features of the two light curves do not match up, with the exception of a few peaks indicated by vertical dotted lines.

Figure 6 .
Figure 6.A comparison of the normalized UVW2 light curve (black) with normalized light curves (blue) at 1180 Å (top), 1739 Å, U and V (bottom).All light curves are normalized by subtracting the median and dividing by the standard deviation of the full light curve.No time shift was applied.

Figure 7 .
Figure 7. Lags as a function of rest wavelength with respect to the UVW2 band (vertical dotted line) for Swift (green) and HST (blue) wave bands for the three different lag determination methods.Left-hand panels (filled symbols) indicate lags calculated from the original light curves, while right-hand panels (open symbols) are lags determined from the detrended light curves.The solid lines show the best-fitting τ ∝ λ 4/3 relation to the lags using the original and detrended light curves.The dashed line in panel (c) shows the best-fitting lag relation from the 'bowl' model.

Figure 8 .Figure 9 .
Figure8.Fits to the 1180 Å (top) and UVW2 (bottom) light curves found using JAVELIN (left) and PYROA (right).JAVELIN can only achieve a good fit by introducing unrealistic large-amplitude, short-timescale variability.PYROA achieves a good fit by significantly inflating the 1180 Å error bars, but the model still does not match all the peaks and troughs in the light curves.The failure of both methods is a consequence of analyzing light curves that are not simply shifted, smoothed, and scaled versions of each other.

Figure 10 .
Figure 10.Flux vs. the model light curve X(t) for all wavebands.The best-fitting flux-flux relations are shown as solid lines.Xg indicates the value of X(t) where the error envelope of the fit to the shortest wavelength band (1180 Å; purple) intercepts fν = 0.The flux-flux relations at X(t) = Xg gives the value of the constant flux in each band, while the slope of the relations give the strength of the variable component.XF and XB indicate the faint and bright values of X(t).

Figure 11 .
Figure 11.The UV/optical SED of Mrk 817 during AGN STORM 2. The variable (rms, black circles) spectrum approximately follows fν ∝ λ −1/3 as expected for an accretion disk.The constant component is shown as orange squares.The purple circles show the maximum, mean and minimum spectral energy distribution.Error bars are plotted, but are mostly smaller than the symbols.

Figure 12 .
Figure 12.Top: The normalized UVW2 (red) and 1180 Å (blue) light curves.Bottom: The difference between the normalized UVW2 and 1180 Å fluxes (red) as compared to the strength of the UV absorption, as measured by the EW of the broad Si IV absorption trough (blue).

Figure 13 .
Figure 13.HST/STIS spectrum of Mrk 817 from 2021 April 18 compared to the Swift filter transmission curves.Several strong broad emission lines fall within the Swift filters.

Table 1 .
Swift photometry of Mrk 817 The lags measured using PYROA fits to the detrended light curves were measured relative to the shortest wavelength (1180 Å) light curve and fit simultaneously.The 1180 Å band therefore has a lag fixed to zero, but, to directly compare to other methods measuring lags relative to UVW2 we give the lags here offset by the 1180 Å to UVW2

Table 3 .
Best-fitting parameters from the flux-flux analysis All fluxes are fν in mJy and are rest-frame and extinction corrected.