# Multiwavelength campaign on Mrk 509. II. Analysis of high-quality Reflection Grating Spectrometer spectra

J. S. Kaastra, C. P. de Vries, K. C. Steenbrugge, R. G. Detmers, J. Ebrero, E.

Behar, S. Bianchi, E. Costantini, G. A. Kriss, M. Mehdipour, et al.

► To cite this version:

J. S. Kaastra, C. P. de Vries, K. C. Steenbrugge, R. G. Detmers, J. Ebrero, et al. Multiwavelength campaign on Mrk 509. II. Analysis of high-quality Reflection Grating Spectrometer spectra. Astronomy and Astrophysics - A&A, 2011, 534, 10.1051/0004-6361/201116870. insu-03623400

HAL Id: insu-03623400

https://insu.hal.science/insu-03623400

Submitted on 29 Mar 2022

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Multiwavelength campaign on Mrk 509

## II. Analysis of high-quality Reflection Grating Spectrometer spectra

J. S. Kaastra<sup>1,2</sup>, C. P. de Vries<sup>1</sup>, K. C. Steenbrugge<sup>3,4</sup>, R. G. Detmers<sup>1,2</sup>, J. Ebrero<sup>1</sup>, E. Behar<sup>5</sup>, S. Bianchi<sup>6</sup>, E. Costantini<sup>1</sup>, G. A. Kriss<sup>7,8</sup>, M. Mehdipour<sup>9</sup>, S. Paltani<sup>10</sup>, P.-O. Petrucci<sup>11</sup>, C. Pinto<sup>1</sup>, and G. Ponti<sup>12</sup>

Received 11 March 2011 / Accepted 11 July 2011

### ABSTRACT

**Aims.** We study the bright Seyfert 1 galaxy Mrk 509 with the Reflection Grating Spectrometers (RGS) of *XMM-Newton*, using for the first time the RGS multi-pointing mode of *XMM-Newton* to constrain the properties of the outflow in this object. We obtain very accurate spectral properties from a 600 ks spectrogram of Mrk 509 with excellent quality.

**Methods.** We derive an accurate relative calibration for the effective area of the RGS and an accurate absolute wavelength calibration. We improve the method for adding time-dependent spectra and enhance the efficiency of the spectral fitting by two orders of magnitude.

**Results.** Taking advantage of the spectral data quality when using the new RGS multi-pointing mode of *XMM-Newton*, we show that the two velocity troughs previously observed in UV spectra are resolved.

**Key words.** galaxies: active – quasars: absorption lines – X-rays: general

## 1. Introduction

Outflows from active galactic nuclei (AGN) play an important role in the evolution of the super-massive black holes (SMBH) at the centres of the AGN, as well as on the evolution of the host galaxies and their surroundings. In order to better understand the role of photo-ionised outflows, the geometry must be determined. In particular, our goal is to determine the distance of the photo-ionised gas to the SMBH, which currently has large uncertainties. For this reason we have started an extended monitoring campaign on one of the brightest AGN with an outflow, the Seyfert 1 galaxy Mrk 509 (Kaastra et al. 2011). The main goal of this campaign is to track the response of the photo-ionised gas to the temporal variations of the ionising X-ray and UV continuum. The response time immediately yields the recombination time scale and hence the density of the gas. Combining this with the ionisation parameter of the gas, the distance of the outflow to the central SMBH can be determined.

The first step in this process is to accurately determine the physical state of the outflow: what is the distribution of gas as a function of ionisation parameter, how many velocity components are present, how large is the turbulent line broadening, etc. Our campaign on Mrk 509 is centred around ten observations

with *XMM-Newton* spanning seven weeks in Oct.–Nov. 2009. The properties of the outflow are derived from the high-resolution X-ray spectra taken with the Reflection Grating Spectrometers (RGS, den Herder et al. 2001) of *XMM-Newton*. The time-averaged RGS spectrum is one of the best spectra ever taken with this instrument, and the statistical quality of this spectrum can be used to improve the current accuracy of the calibration and analysis tools. This creates new challenges for the analysis of the data. The methods developed here also apply to other time-variable sources. Therefore we describe them in some detail in this paper.

For this work we have derived a list of the strongest absorption lines in the X-ray spectrum of Mrk 509, and we perform some simple line diagnostics on a few of the most prominent features. The full time-averaged spectrum will be presented elsewhere (Detmers et al. 2011).

## 2. Data analysis

Table 1 gives some details on our observations. We quote here only exposure times for RGS. The total net exposure time is 608 ks. No filtering for enhanced background radiation was

<footnote n="1"><sup>1</sup> SRON Netherlands Institute for Space Research, Sorbonnelaan 2, 3584 CA Utrecht, The Netherlands
e-mail: j.s.kaastra@stron.nl</footnote>

<footnote n="2"><sup>2</sup> Sterrenkundig Instituut, Universiteit Utrecht, PO Box 80000, 3508 TA Utrecht, The Netherlands</footnote>

<footnote n="3"><sup>3</sup> Instituto de Astronomía, Universidad Católica del Norte, Avenida Angamos 0610, Casilla 1280, Antofagasta, Chile</footnote>

<footnote n="4"><sup>4</sup> Department of Physics, University of Oxford, Keble Road, Oxford OX1 3RH, UK</footnote>

<footnote n="5"><sup>5</sup> Department of Physics, Technion-Israel Institute of Technology, Haifa 32000, Israel</footnote>

<footnote n="6"><sup>6</sup> Dipartimento di Fisica, Università degli Studi Roma Tre, via della Vasca Navale 84, 00146 Roma, Italy</footnote>

<footnote n="7"><sup>7</sup> Space Telescope Science Institute, 3700 San Martin Drive, Baltimore, MD 21218, USA</footnote>

<footnote n="8"><sup>8</sup> Department of Physics and Astronomy, The Johns Hopkins University, Baltimore, MD 21218, USA</footnote>

<footnote n="9"><sup>9</sup> Mullard Space Science Laboratory, University College London, Holmbury St. Mary, Dorking, Surrey, RH5 6NT, UK</footnote>

<footnote n="10"><sup>10</sup> ISDC Data Centre for Astrophysics, Astronomical Observatory of the University of Geneva, 16 ch. d'Ecogia, 1290 Versoix, Switzerland</footnote>

<footnote n="11"><sup>11</sup> UJF-Grenoble 1 / CNRS-INSU, Institut de Planétologie et d'Astrophysique de Grenoble (IPAG), UMR 5274, Grenoble 38041, France</footnote>

<footnote n="12"><sup>12</sup> School of Physics and Astronomy, University of Southampton, Highfield, Southampton SO17 1BJ, UK</footnote>
<table><caption>**Table 1.** Observation log.</caption><thead><tr><th>Obs. Nr.</th><th>ID</th><th>Start date</th><th>Net exposure (ks)</th></tr></thead><tbody><tr><td>1</td><td>0601390201</td><td>2009-10-15</td><td>60</td></tr><tr><td>2</td><td>0601390301</td><td>2009-10-19</td><td>53</td></tr><tr><td>3</td><td>0601390401</td><td>2009-10-23</td><td>61</td></tr><tr><td>4</td><td>0601390501</td><td>2009-10-29</td><td>60</td></tr><tr><td>5</td><td>0601390601</td><td>2009-11-02</td><td>63</td></tr><tr><td>6</td><td>0601390701</td><td>2009-11-06</td><td>63</td></tr><tr><td>7</td><td>0601390801</td><td>2009-11-10</td><td>61</td></tr><tr><td>8</td><td>0601390901</td><td>2009-11-14</td><td>60</td></tr><tr><td>9</td><td>0601391001</td><td>2009-11-18</td><td>65</td></tr><tr><td>10</td><td>0601391101</td><td>2009-11-20</td><td>63</td></tr></tbody></table>

needed for these observations, because the background was very low and stable for the full duration of our campaign.

The campaign consisted of ten different observations. Each observation was pointed a bit differently to obtain slightly different positions of the spectra on the detectors (the multi-pointing mode of RGS; steps of 0, ±15" and ±30"). In this way the holes in the detector caused by bad CCD columns and pixels and CCD gaps, changed position over the spectra, allowing all spectral bins to be sampled. In addition, eventually this procedure will limit outliers in individual wavelength bins from isolated noisy CCD pixels, because the noise of these pixels will be spread over more wavelength bins.

After all exposures were separately processed using the standard RGS pipeline of the XMM-Newton data analysis system SAS version 9, noise from remaining noisy CCD columns and pixels was decreased even more using the following process. Two-dimensional plots of the spectral image (cross-dispersion position versus dispersion angle) and the CCD-pulse height versus spectral dispersion were plotted in the detector reference frame for each separate CCD node, but with all exposures combined. Because the spectral features will be smeared out in these plots, possible CCD defects like hot or dead columns and hot or dead pixels are clearly visible. In this way a number of additional bad columns and pixels were manually identified for each detector CCD node and were added to the SAS bad pixel calibration file. After this, all exposures were reprocessed with the new bad pixel tables.

### 3. Combination of spectra

To obtain an accurate relative effective area and absolute wavelength calibration, we need the signal-to-noise of the combined 600 ks spectrum. Therefore we first describe how the individual spectra are accurately combined, and discuss the effective area and wavelength scale later.

#### 3.1. Combination of spectra from the same RGS and spectral order

Detectors like the RGS yield spectra with lacking counts in parts of the spectrum owing to the presence of hot pixels, bad columns, or gaps between CCDs. This leads to problems when spectra taken at different times have to be combined into a single spectrum, in particular when the source varies in intensity and the lacking counts fall on different wavelengths for each individual spectrum. For RGS this is for example the case when the multi-pointing mode is used like in our present Mrk 509 campaign, or when data of different epochs with slightly different

<figure><img src="image_2.png" /><figcaption>**Fig. 1.** Illustration that spectra with different flux and different missing bins cannot be simply added. Both spectrum 1 and 2 have 1 s exposure but have different constant expected count rates of 400 and 200 counts s⁻¹. In spectrum 1 pixel A is missing, in spectrum 2 pixel B. The thick solid line in the total spectrum indicates the predicted number of counts by straightforwardly adding the response matrices for both spectra with equal weights.</figcaption></figure>

pointings are combined, or if bad columns have (dis)appeared between different observations because of the transient nature of some bad pixels.

Under the above conditions the SAS task *rgscombine* should not be used. We illustrate this with a simplified example (Fig. 1). Consider two spectra of the same X-ray source, labelled 1 and 2, with seven spectral bins each (Fig. 1). The source has a flat spectrum and the flux per bin in spectrum 1 is twice the flux of spectrum 2. In spectrum 1, bin A is missing (zero counts), and in spectrum 2, bin B is missing. The combined spectrum has 600 counts, except for bins A and B with 200 and 400 counts, respectively. However, when the response matrices of both observations are combined, it is assumed that bins A and B were on for 50% of the time, hence the model predicts 300 counts for those bins. Clearly, the data show a deficit or excess at those bins, which an observer could easily misinterpret as an additional astrophysical absorption or emission feature at bins A and B.

How can this problem be solved? One possibility is to fit all spectra simultaneously. However, when there are many different spectra (like the 40 spectra obtained from two RGS detectors in two spectral orders for ten observations that we have for our Mrk 509 data), this can be a cumbersome procedure because the memory and CPU requirements become very demanding. Another option is to rigorously discard all wavelength bins where even during short periods (a single observation or a part of an observation) data are lacking. This solution will cause a significant loss of diagnostic capability, because many more bins are discarded and likely several of those bins will be close to astrophysically interesting features.

Here we follow a different route. It is common wisdom (and this is also suggested by the SAS manual) not to use fluxed spectra for fitting analyses. The problem is the lack of a well-defined redistribution function for that case. We will show below in Sect. 4 that we can obtain an appropriate response matrix for our case, which allows us to make an analysis with fluxed spectra under the conditions given in that section.

We first create individual fluxed spectra using the SAS task *rgsfluxer*. We use exactly the same wavelength grid for each
observation. We then average the fluxed spectra using for each spectral bin the exposure times as weights. This is repeated for all bins having 100% exposure and for all spectra that are to combined.

For bins with lacking data (like bins A and B of Fig. 1) we have to follow a different approach. If the total exposure time of spectrum k is given by $t_k$, and the effective exposure time of spectral bin j in spectrum k is given by $t_{kj}$, we clearly have $t_{kj} < t_k$ for “problematic” bins j, and we will include in the final spectrum only data bins with $t_{kj} > f t_k$, with $0 \le f \le 1$ a tunable parameter discussed below. However, because of the variability of the source, the average flux level of the included spectra k for problematic bin j may differ from the flux level of the neighbouring bins j-1 and j+1 which are fully exposed. To correct for this, we assume that the spectral shape (but not the overall normalisation) in the local neighbourhood of bin j is constant in time. From these neighbouring bins (with fluxes $F_{j-1}$ and $F_{j+1}$) we estimate the relative contribution R to the total flux for the spectra k that have sufficient exposure time $t_{kj}$ for bin j, i.e.

$$R = \frac{\sum_{k, t_{kj} > f t_k} t_k F_{j-1}}{\sum_k t_k F_{j-1}}, \qquad (1)$$

and similar for the other neighbour at j+1. We interpolate the values for R linearly at both sides to obtain a single value at the position of bin j. The flux for bin j is now estimated as

$$F_j = \frac{\sum_{k, t_{kj} > f t_k} t_k F_j}{R \sum_k t_k}. \qquad (2)$$

Example: for bin A in Fig. 1 we have $R = 200 \times 1/(400 \times 1 + 200 \times 1) = 1/3$, and hence using the flux measurement in spectrum 2, we have $F_A = (200 \times 1)/((1/3) \times 2) = 300$ counts s⁻<fnref n="1" />, as it should be.

This procedure gives reliable results as long as the spectral shape does not change locally; because there is less exposure at bin j, the error bar on the flux will obviously be larger. However, when there is reason to suspect that the bin is at the location of a spectral line that changes in equivalent width, this procedure cannot be applied!

To give the user more flexibility, we have introduced the minimum exposure fraction f in (1). For f = 0, we obtain the best results for spectra with constant shape (because every bit of information that is available is used). On the other hand, if f = 1, only those data bins will be included that have no bad bins in any of the observations to be combined. The advantage in that case is that there is no bias in the stacked spectrum, but a disadvantage is that a significant part of the spectrum may be lost, for example near important diagnostic lines. This can be a problem in particular for the multi-pointing mode, the purpose of which is to have different wavelengths fall on different parts of the spectrum and thus to have a measurement of the spectrum at all wavelengths. We illustrate this for the region near the chip gap between CCD 5 and 6 of RGS2 (see Fig. 2). For f < 1 some data points have large error bars owing to the low effective exposure of some bins that contain missing columns, and the corresponding low number of counts N yields large relative errors (~N⁻⁰.⁵). In our analysis we use f = 0 throughout.

Finally, in the combined spectrum it is still possible because of the binning and randomisation procedures within the SAS task rgsfluxer, that despite careful screening for bad pixels, a

<figure><img src="image_3.png" /><figcaption>Fig. 2. Spectral region near the gap between CCD 5 and 6 of RGS2, containing the 1s–3p line of O viii at 16.55 Å from the outflow. From top to bottom we show the fluxed spectra (arbitrarily scaled and shifted along the flux axis) for three values of f. Using the conservative setting f = 1, a major part of the spectrum is lost. With f = 0 no data are lost but of course between 16.3 and 16.55 Å the error bars are slightly larger because of the shorter exposure time in that wavelength region.</figcaption></figure>

few bad bins remain in the fluxed spectrum, often adjacent or close to discarded bins. For this reason, we check for any bins that are more than 3σ below their right or left neighbouring bin (taking the statistical errors of both into account). Typically, the algorithm finds a few additional bad bins in an individual observation, which we also discard from our analysis. Only for very strong isolated emission lines with more than 1500 counts in a single observation our method would produce false rejections near the bending points of the instrumental spectral redistribution function, because then the spectral changes for neighbouring bins are stronger than 3σ statistical fluctuations, but our spectra of Mrk 509 do not contain such sharp and strong features.

We have implemented the procedures presented in this section in the programme rgs combine that is available within the publicly available SPEX distribution<fnref n="1" />.

Finally, we note that there is in principle another route to combine the spectra. This would be to run rgscombine but to modify by a user routine the column AREASCAL so that the count rates are properly corrected for the missing bins. It can be shown that in the combined spectrum AREASCAL must be scaled by 1/R, with R derived as described above, in order to obtain robust results. It requires the development of similar tools as rgs幣 combine, however, to implement this modification.

## 3.2. Combination of spectra from different RGS or spectral order

In the previous section we showed how to combine spectra from the same RGS and spectral order, but for different observations. However, we also intend to combine RGS1 and RGS2 spectra, and spectra from the first and second spectral order. We do this by simply averaging the fluxed spectra, using for each bin the statistical errors on the flux as weight factors. Because of the lower effective area in the second spectral order, second-order spectra are allotted less weight than first order spectra in this

<footnote n="1">¹ www.sron.nl/spex</footnote>
way, their weights are typically between 20% (near 18 Å) and 50% (near 8 Å) of the first-order spectral weights.

In Sect. 4 we show how to create a response matrix for the fluxed RGS spectra. The same weights that are used to determine the relative contributions of the different spectra to the combined spectrum are also used to weigh the contributions from the corresponding redistribution functions. To avoid discontinuities near the end points of second-order spectra or near missing CCDs, we pay attention to small effective area corrections, as outlined in Sect. 5.

## 4. Response matrix

We have explained above that for time-variable sources standard SAS tasks like *rgscombine* cannot be used to combine the ten individual spectra of Mrk 509 or any other source into a single response matrix. For that reason, we have combined fluxed spectra as described in the sections above. The only other feasible alternative would be to fit the ten individual spectra simultaneously. But with two RGS detectors, two spectral orders and ten observations, this adds up to 40 individual spectra. The memory occupied by the corresponding response matrices is 2.0 Gbyte. Although our fitting program SPEX is able to cope with this, fitting becomes cumbersome and error searches extremely slow, owing to the huge number of matrix multiplications that have to be performed.

For our combined fluxed spectra, fitting is much faster because we have only a single spectrum and hence only need one response matrix. Because we use fluxed spectra, we can use a simple response matrix with unity effective area, and the spectral redistribution function given by the redistribution part of the RGS matrix. Unfortunately, the RGS response matrix produced by the SAS *rgsrmfgen* task combines the effective area and redistribution part into a single data file. Furthermore, because of the multi-pointing mode that we used and because of transient bad columns, the matrix for each of the ten observations will be slightly different.

Therefore, we have adopted the following approach. For a number of wavelengths (7 to 37 Å, step size 2 Å) we have fitted the RGS response to the sum of three or four Gaussians. This gives a quasi-diagonal matrix resulting in another speed-up of spectral analysis. For these fits to the redistribution function we have omitted the data channels with incomplete exposure (near chip boundaries, and at bad pixels). The parameters of the Gaussians (normalisation, centre, and width) were then modelled with smooth analytical functions of wavelength. We paid most attention to the peak of the redistribution function, where most counts are found.

The following parameterisation describes the RGS redistribution functions well (all units are in Å):

$$R(\lambda', \lambda) = \sum_{i=1}^{4} \frac{N_i}{\sqrt{2\pi}\sigma_i} e^{-(\lambda - \lambda')^2/2\sigma_i^2}, \quad (3)$$

$$\sigma_i = a_i + b_i\lambda + c_i\lambda^2, \quad (4)$$

$$i = 1: N_1 = 1 - N_2 - N_3 - N_4, \quad (5)$$

$$i = 2, \text{ first order only: } N_i = d_i + e_i\lambda + f_i\lambda^2 + g_i\lambda^3, \quad (6)$$

$$i = 2-4, \text{ second order only: } N_i = d_i + e_i\lambda + f_i\lambda^2 + g_i\lambda^3, \quad (7)$$

$$i = 3, \text{ first order RGS1 only: } N_3 = -0.065 + 2.5/\lambda^{0.7}, \quad (8)$$

$$i = 3, \text{ first order RGS2 only: } N_3 = -0.075 + 2.5/\lambda^{0.7}. \quad (9)$$

<table><caption>**Table 2.** Parameters of the RGS redistribution function.</caption><thead><tr><th>RGS Order</th><th>RGS1 -1</th><th>RGS2 -1</th><th>RGS1 -2</th><th>RGS2 -2</th></tr></thead><tbody><tr><td>a<sub>1</sub></td><td>0.0211</td><td>0.0237</td><td>0.0100</td><td>0.0118</td></tr><tr><td>a<sub>2</sub></td><td>0.0514</td><td>0.055</td><td>0.018</td><td>0.027</td></tr><tr><td>a<sub>3</sub></td><td>0.0105</td><td>0.016</td><td>-0.0572</td><td>0.017</td></tr><tr><td>a<sub>4</sub></td><td>-</td><td>-</td><td>0.404</td><td>0.339</td></tr><tr><td>b<sub>1</sub></td><td>0.00028</td><td>0.00032</td><td>0.00031</td><td>0.00035</td></tr><tr><td>b<sub>2</sub></td><td>0.00039</td><td>0.00058</td><td>0.00075</td><td>0.00080</td></tr><tr><td>b<sub>3</sub></td><td>0.021</td><td>0.020</td><td>0.021</td><td>0.00066</td></tr><tr><td>b<sub>4</sub></td><td>-</td><td>-</td><td>-0.01</td><td>-</td></tr><tr><td>c<sub>3</sub></td><td>-0.000405</td><td>-0.000346</td><td>-0.000692</td><td>-</td></tr><tr><td>d<sub>2</sub></td><td>0.1068</td><td>0.1314</td><td>-1.1022</td><td>0.0084</td></tr><tr><td>d<sub>3</sub></td><td>-</td><td>-</td><td>1.5276</td><td>1.2276</td></tr><tr><td>d<sub>4</sub></td><td>-</td><td>-</td><td>0.3190</td><td>-0.1211</td></tr><tr><td>e<sub>2</sub></td><td>0.0125</td><td>0.0086</td><td>0.289</td><td>0.0153</td></tr><tr><td>e<sub>3</sub></td><td>-</td><td>-</td><td>-0.223</td><td>-0.140</td></tr><tr><td>e<sub>4</sub></td><td>-</td><td>-</td><td>-0.017</td><td>0.0833</td></tr><tr><td>f<sub>2</sub></td><td>-0.00024</td><td>-0.00017</td><td>-0.0215</td><td>-0.00024</td></tr><tr><td>f<sub>3</sub></td><td>-</td><td>-</td><td>0.016</td><td>0.0075</td></tr><tr><td>f<sub>4</sub></td><td>-</td><td>-</td><td>-0.0014</td><td>-0.0080</td></tr><tr><td>g<sub>2</sub></td><td>-</td><td>-</td><td>0.00053</td><td>-0.000009</td></tr><tr><td>g<sub>3</sub></td><td>-</td><td>-</td><td>-0.00044</td><td>-0.00015</td></tr><tr><td>g<sub>4</sub></td><td>-</td><td>-</td><td>0.00011</td><td>0.00022</td></tr></tbody></table>

<figure><img src="image_4.png" /><figcaption>**Fig. 3.** Comparison of the redistribution function for RGS2, first order as delivered by the SAS (thin solid line) to our approximation using three Gaussians (thick lines), for four different photon wavelengths.</figcaption></figure>

The relevant parameters are given in Table 2, omitting parameters that are not used (zero). We cut off the redistribution function beyond ±1 Å from the line centre. We have compared these approximations to the true redistribution function (see Figs. 3, 4), and found that our model accurately describes the core down to a level of about 1% of the peak of the redistribution function. Also, the flux outside the ±1 Å band is less than ~1% of the total flux for all wavelengths. It should be noted that the above approximation is more accurate than the calibration of the redistribution itself. Currently, the width of the redistribution is known only to about 10% accuracy<fnref n="2" />.

We finally remark that Fig. 3 seems to suggest that the response also contains the second-order spectra, for instance for

<footnote n="2">² See also Kaastra et al. (2006), Table 2, where equivalent widths based on different representations of the redistribution function are compared, and a comparison to Chandra LETGS data is made as well.</footnote>
<figure><img src="image_5.png" /><figcaption>Fig. 4. As Fig. 3, but only for photons at 18 Å.</figcaption></figure>

9 Å photons, apart from the main peak near 9 Å, there are sec-
ondary peaks at 18, 27, and 36 Å. These peaks are, however, not
the genuine higher order spectra, but they correspond to higher
order photons that by chance end up in the low-energy tail of
the CCD redistribution function. For instance, a photon with in-
trinsic energy 1.38 keV would be seen in first order at 9 Å, but
in second order at 18 Å. A small fraction of these second order
events end up in the CCD redistribution tail and are not detected
near 1.38 keV but near 0.69 keV. Because their (second-order)
measured wavelength is 18 Å, they are identified as first-order
events (energy 0.69 keV, wavelength 18 Å). As can be seen from
Fig. 3, this is only a small contribution, and we can safely ignore
them.

**5. Effective area corrections**

The statistics of our stacked 600 ks spectrum of Mrk 509 is ex-
cellent, with statistical uncertainties down to 2% per 0.1 Å per
RGS in first order. In larger bins of 1 Å width, the quality is
even better by a factor of ~3. These statistical uncertainties are
smaller than the accuracy to which the RGS effective area has
been calibrated. A close inspection of the first- and second-order
spectra of our source for both RGS detectors showed that there
are some systematic flux differences of up to a few percent at
wavelength scales larger than a few tenths of an Å (Figs. 5, 6),
consistent with the known accuracy of the effective area calibra-
tion. These differences sometimes correlate with chip boundaries
(like at 34.5 Å), but not always. A preliminary analysis shows the
same trends for stacked RGS spectra of the blazar Mrk 421.

While a full analysis is underway, we use here a simple ap-
proach to correct these differences and obtain an accurate rela-
tive effective area calibration. We model the differences purely
empirically with the sum of a constant function and a few
Gaussians with different centroids, widths, and amplitudes, as
indicated in Figs. 5, 6. We then attribute half of the deviations
to RGS1 and the other half to RGS2. In this way there is bet-
ter agreement between the different RGS spectra, in particular
across spectral regions where because of the failure of one of
the chips the flux would otherwise show a discontinuity at the
boundary between a region with two chips and a region with
only one chip. Because the effective area of the second-order
spectra has been calibrated with less accuracy than the first-order

<figure><img src="image_6.png" /></figure>

<figure><img src="image_7.png" /></figure>

<figure><img src="image_8.png" /><figcaption>Fig. 5. Flux ratio between RGS1 and RGS2 for parts of the spectrum that are detected by both RGS. Different symbols indicate different combinations of CCD chips for both RGS detectors. Open symbols: RGS1 chips 1, 3, 5, 9; filled symbols: RGS1 chips 2, 4, 6, 8. Triangles: RGS2 chips 1, 3, 5, 7, 9; circles: RGS2 chips 2, 6, 8. The solid line is a simple fit to the ratio’s using a constant plus Gaussians.</figcaption></figure>

spectra, we adjust the second-order spectrum to match the first-
order spectrum.
<figure><img src="image_9.png" /><figcaption>Fig. 6. As Fig. 5, but for second-order spectra compared to first-order spectra. Owing to the specific geometry of missing CCDs (CCD7 for RGS1, CCD4 for RGS2) we compare all fluxes to the first order of RGS2. Open symbols: second-order chips 1, 3, 5, 7, 9; filled symbols: second-order chips 2, 4, 6, 8. Triangles: first-order chips 1, 3, 5, 7, 9; circles: first-order chips 2, 6, 8.</figcaption></figure>

We obtain the following corrections factors:

$$r_{11}(\lambda) = 1.02 + G(\lambda, -0.108, 5, 2) + G(\lambda, 0.099, 7.5, 0.6) + G(\lambda, 0.055, 17.4, 0.6) + G(\lambda, 0.069, 24.4, 1.3) + G(\lambda, -0.042, 27.3, 0.7) + G(\lambda, 0.037, 31.3, 1.8), \quad (10)$$

$$r_{12}(\lambda) = 0.997 + G(\lambda, 0.103, 11.9, 1.4) + G(\lambda, 0.085, 18.1, 2.2), \quad (11)$$

$$r_{22}(\lambda) = 0.995 + G(\lambda, -0.882, 5.0, 0.7) + G(\lambda, -0.063, 15.2, 0.9). \quad (12)$$

Here $r_{ij}$ is the flux of RGS i order j relative to RGS2 order 1 as shown in Figs. 5, 6, and $G(\lambda, N, \mu, \sigma) \equiv Ne^{-(\lambda - \mu)^2/2\sigma^2}$. With these definitions, the fluxes need to be multiplied by correction

<figure><img src="image_10.png" /><figcaption>Fig. 7. Adopted effective area corrections for RGS1 (solid lines) and RGS2 (dashed lines), in first- and second-spectral order.</figcaption></figure>

factors $a_{ij}$ to obtain the corrected values as follows:

$$a_{11} = (1 + 1/r_{11})/2 \quad (13)$$

$$a_{21} = (1 + r_{11})/2 \quad (14)$$

$$a_{12} = (1 + r_{11})/2r_{12} \quad (15)$$

$$a_{22} = (1 + r_{11})/2r_{22}. \quad (16)$$

The above approach may fail whenever the small discrepancy between one spectrum and the other is caused by a single RGS, and not by both. Then there will be a systematic error in the derived flux with the same Gaussian shape as used for the correction factors, but with half its amplitude. This is compensated largely, however, by our approach where we fit the true underlying continuum of Mrk 509 by a spline, and in our analysis we make sure that we do not attribute real broad lines to potential effective area corrections. The adopted effective area corrections (the inverse of the $a_{ij}$ factors) are shown in Fig. 7. Note that for wavelength ranges with lacking CCDs the effective area corrections are based on the formal continuation of the above equations, and because of that may differ from unity. However, this is still consistent with the absolute accuracy of the RGS effective area calibration.

## 6. Wavelength scale

### 6.1. Aligning both RGS detectors

The zero-point of the RGS wavelength scale has a systematic uncertainty of about 8 mÅ (den Herder et al. 2001). According to the latest insights, this is essentially caused by a slight tilting of the grating box because of Solar irradiance on one side of it, which causes small temperature differences and hence inhomogeneous thermal expansion. The thermal expansion changes the incidence angle of the radiation on the gratings and hence the apparent wavelength. The details of this effect are currently under investigation. Owing to the varying angle of the satellite with respect to the Sun during an orbit and the finite thermal conductivity time-scale of the relevant parts, the precise correction will also depend on the history of the satellite orbit and pointing.
<table><caption>**Table 3.** Strongest absorption lines observed in the spectrum of Mrk 509.</caption><thead><tr><th>Ion</th><th>Transition</th><th>EW<sup>a</sup><br>(mÅ)</th><th>λ<sub>obs</sub><sup>b</sup><br>Å</th><th>λ<sub>lab</sub><sup>c</sup><br>Å</th><th>v<sup>d</sup><br>(km s<sup>-1</sup>)</th><th>Reference<sup>e</sup></th></tr></thead><tbody><tr><td>Fe xxI</td><td>2p-3d</td><td>3.0 ± 0.8</td><td>12.664 ± 0.008</td><td>12.2840 ± 0.0020</td><td>-990 ± 200</td><td>Brown et al. (2002)</td></tr><tr><td>Fe xix</td><td>2p-3d</td><td>8.5 ± 1.2</td><td>13.979 ± 0.005</td><td>13.516 ± 0.005</td><td>-20 ± 150</td><td>Phillips et al. (1999)</td></tr><tr><td>Fe xviii</td><td>2p-3d</td><td>5.6 ± 0.8</td><td>14.680 ± 0.005</td><td>14.207 ± 0.010</td><td>-330 ± 230</td><td>Phillips et al. (1999)</td></tr><tr><td>Mg xI</td><td>1s-2p</td><td>3.6 ± 0.7</td><td>9.465 ± 0.005</td><td>9.1688 ± 0.0000</td><td>-590 ± 150</td><td>Flemberg (1942)</td></tr><tr><td>Ne x</td><td>1s-2p</td><td>9.8 ± 0.9</td><td>12.539 ± 0.002</td><td>12.1346 ± 0.0000</td><td>-300 ± 40</td><td>Erickson (1977)</td></tr><tr><td>Ne ix</td><td>1s-3p</td><td>2.5 ± 0.9</td><td>11.921 ± 0.009</td><td>11.5440 ± 0.0020</td><td>-480 ± 240</td><td>Peacock et al. (1969)</td></tr><tr><td>Ne ix</td><td>1s-2p</td><td>13.2 ± 1.1</td><td>13.897 ± 0.003</td><td>13.4470 ± 0.0020</td><td>-260 ± 70</td><td>Peacock et al. (1969)</td></tr><tr><td>Ne viii</td><td>1s-2p</td><td>5.6 ± 0.8</td><td>14.118 ± 0.006</td><td>13.654 ± 0.005</td><td>-100 ± 160</td><td>Peacock et al. (1969)</td></tr><tr><td>Ne vii</td><td>1s-2p</td><td>4.0 ± 0.8</td><td>14.282 ± 0.006</td><td>13.8140 ± 0.0010</td><td>-130 ± 130</td><td>Behar & Netzer (2002)</td></tr><tr><td>O viii</td><td>1s-5p</td><td>2.4 ± 0.9</td><td>15.332 ± 0.010</td><td>14.8205 ± 0.0000</td><td>+30 ± 190</td><td>Erickson (1977)</td></tr><tr><td>O viii</td><td>1s-4p</td><td>5.2 ± 0.8</td><td>15.692 ± 0.006</td><td>15.1762 ± 0.0000</td><td>-120 ± 110</td><td>Erickson (1977)</td></tr><tr><td>O viii</td><td>1s-3p</td><td>13.4 ± 1.2</td><td>16.546 ± 0.002</td><td>16.0059 ± 0.0000</td><td>-190 ± 40</td><td>Erickson (1977)</td></tr><tr><td>O viii</td><td>1s-2p</td><td>31.8 ± 1.4</td><td>19.615 ± 0.001</td><td>18.9689 ± 0.0000</td><td>-110 ± 20</td><td>Erickson (1977)</td></tr><tr><td>O vii</td><td>1s-5p</td><td>2.7 ± 0.9</td><td>18.022 ± 0.013</td><td>17.3960 ± 0.0020</td><td>+460 ± 230</td><td>Engström & Litzén (1995)</td></tr><tr><td>O vii</td><td>1s-4p</td><td>10.3 ± 1.3</td><td>18.382 ± 0.004</td><td>17.7683 ± 0.0007</td><td>+40 ± 60</td><td>Engström & Litzén (1995)</td></tr><tr><td>O vii</td><td>1s-3p</td><td>14.8 ± 1.0</td><td>19.265 ± 0.003</td><td>18.6284 ± 0.0004</td><td>-70 ± 50</td><td>Engström & Litzén (1995)</td></tr><tr><td>O vii</td><td>1s-2p</td><td>32.7 ± 2.1</td><td>22.335 ± 0.002</td><td>21.6019 ± 0.0003</td><td>-140 ± 20</td><td>Engström & Litzén (1995)</td></tr><tr><td>O vii</td><td>1s-2p</td><td>21.2 ± 2.3</td><td>22.771 ± 0.005</td><td>22.0194 ± 0.0016</td><td>-90 ± 70</td><td>Schmidt et al. (2004)</td></tr><tr><td>O v</td><td>1s-2p</td><td>15.8 ± 2.9</td><td>23.120 ± 0.005</td><td>22.3700 ± 0.0100</td><td>-260 ± 140</td><td>Gu et al. (2005)</td></tr><tr><td>N vii</td><td>1s-2p</td><td>19.0 ± 2.3</td><td>25.625 ± 0.004</td><td>24.7810 ± 0.0000</td><td>-110 ± 50</td><td>Erickson (1977)</td></tr><tr><td>N vii</td><td>1s-2p</td><td>23.8 ± 2.8</td><td>29.773 ± 0.004</td><td>28.7875 ± 0.0002</td><td>-70 ± 40</td><td>Engström & Litzén (1995)</td></tr><tr><td>N vi</td><td>1s-2p</td><td>7.6 ± 2.3</td><td>30.402 ± 0.014</td><td>29.414 ± 0.004</td><td>-240 ± 150</td><td>Beiersdorfer et al. (1999)</td></tr><tr><td>C vii</td><td>1s-4p</td><td>5.7 ± 1.9</td><td>27.933 ± 0.015</td><td>26.9898 ± 0.0000</td><td>+150 ± 160</td><td>Erickson (1977)</td></tr><tr><td>C vii</td><td>1s-3p</td><td>16.2 ± 2.8</td><td>29.438 ± 0.007</td><td>28.4656 ± 0.0000</td><td>-90 ± 70</td><td>Erickson (1977)</td></tr><tr><td>C vii</td><td>1s-2p</td><td>49.3 ± 3.0</td><td>34.890 ± 0.002</td><td>33.7360 ± 0.0000</td><td>-70 ± 20</td><td>Erickson (1977)</td></tr><tr><td>C v</td><td>1s-3p</td><td>17.1 ± 3.2</td><td>36.174 ± 0.005</td><td>34.9728 ± 0.0008</td><td>-30 ± 40</td><td>Edlén & Löfstrand (1970)</td></tr><tr><td>Fe xvii G</td><td>2p-3d</td><td>2.5 ± 0.8</td><td>15.021 ± 0.008</td><td>15.0140 ± 0.0010</td><td>+160 ± 160</td><td>Brown et al. (1998)</td></tr><tr><td>Ne x G</td><td>1s-2p</td><td>1.6 ± 0.8</td><td>12.125 ± 0.010</td><td>12.1346 ± 0.0000</td><td>-210 ± 240</td><td>Erickson (1977)</td></tr><tr><td>Ne ix G</td><td>1s-2p</td><td>4.2 ± 0.9</td><td>13.454 ± 0.006</td><td>13.4470 ± 0.0020</td><td>+180 ± 150</td><td>Peacock et al. (1969)</td></tr><tr><td>O viii G</td><td>1s-2p</td><td>8.2 ± 1.1</td><td>18.966 ± 0.005</td><td>18.9689 ± 0.0000</td><td>-30 ± 80</td><td>Erickson (1977)</td></tr><tr><td>O vii G</td><td>1s-3p</td><td>5.7 ± 1.1</td><td>18.624 ± 0.010</td><td>18.6284 ± 0.0004</td><td>-70 ± 170</td><td>Engström & Litzén (1995)</td></tr><tr><td>O vii G</td><td>1s-2p</td><td>16.6 ± 2.2</td><td>21.604 ± 0.004</td><td>21.6019 ± 0.0003</td><td>+30 ± 50</td><td>Engström & Litzén (1995)</td></tr><tr><td>O vii G</td><td>1s-2p</td><td>4.5 ± 1.8</td><td>22.025 ± 0.013</td><td>22.0194 ± 0.0016</td><td>+70 ± 180</td><td>Schmidt et al. (2004)</td></tr><tr><td>C vii G</td><td>1s-2p</td><td>8.8 ± 2.5</td><td>33.743 ± 0.013</td><td>33.7360 ± 0.0000</td><td>+80 ± 170</td><td>Erickson (1977)</td></tr><tr><td>O i G</td><td>1s-2p</td><td>29.1 ± 2.8</td><td>23.521 ± 0.003</td><td>23.5113 ± 0.0018</td><td>+130 ± 50</td><td>Kaastra et al. (2010)</td></tr><tr><td>N i G</td><td>1s-2p</td><td>22.2 ± 4.3</td><td>31.302 ± 0.009</td><td>31.2857 ± 0.0005</td><td>+160 ± 80</td><td>Sant'Anna et al. (2000)</td></tr></tbody></table>

**Notes.** (a) Equivalent width. (b) Observed wavelength using the nominal SAS wavelength scale for RGS1, with RGS2 wavelengths shifted downwards by 6.9 mÅ. (c) Laboratory wavelength (experimental or theoretical) with best estimate of uncertainty. (d) Outflow velocity; for lines from the AGN relative to the systematic redshift of 0.034397; for lines from the ISM (labelled “G” in the first column) to the LSR velocity scale. Observed errors and errors in the laboratory wavelength have been combined. The velocities are based on the observed wavelengths of Col. 4 but corrected for the orbital motion of the Earth, and have in addition been adjusted by adding 1.8 mÅ to the observed wavelengths (see Sect. 6.4.6). (e) References for the laboratory wavelengths.

Because corrections for this effect are still under investigation, we take here an empirical approach. We start with aligning both RGS detectors. We have taken the nine strongest spectral lines in our Mrk 509 spectrum that can be detected on both RGS detectors, and have determined the difference between the average measured wavelength for both RGS detectors in the combined spectrum. We found that the wavelengths measured with RGS2 are 6.9 ± 0.7 mÅ longer than the wavelengths measured with RGS1 (Fig. 8).

Therefore, we have re-created the RGS2 spectra by sampling them on a wavelength grid similar to the RGS1 wavelength grid, but shifted by +6.9 mÅ. Using this procedure, spectral lines always end up in the same spectral bins. This allows us to stack RGS1 and RGS2 spectra by simply adding up the counts for each spectral bin, without a further need to re-bin the counts when combining both spectra.

After applying this correction, we stacked the spectra of both RGS detectors and compared the first- and second-order spectra. We found that the second-order centroids agree well with the

first-order centroids (to within an accuracy of 3 mÅ) and therefore did not apply a correction.

## 6.2. Strongest absorption lines

To facilitate the derivation of the proper wavelength scale, we have compiled a list of the strongest spectral lines that are present in the spectrum of Mrk 509 (Table 3). We have measured the centroids $\lambda_0$ and equivalent widths EW of these lines by fitting the fluxed spectra $F(\lambda)$ locally in a 1 Å wide band around the line centre using Gaussian absorption lines, superimposed on a smooth continuum for which we adopted a quadratic function of wavelength. We took care to re-formulate this model in such a way that the equivalent width is a free parameter of the model and not a derived quantity based on the measured continuum or line peak:

$$F(\lambda) = c \left\{ 1 + b(\lambda - \lambda_0) + a(\lambda - \lambda_0)^2 - \frac{EW}{\sigma\sqrt{2\pi}} e^{-(\lambda - \lambda_0)^2 / 2\sigma^2} \right\}.$$
<figure><img src="image_11.png" /><figcaption>**Fig. 8.** Wavelength difference RGS2-RGS1 for the nine strongest lines. The dashed line indicates the weighted average of 6.9 ± 0.7 mÅ.</figcaption></figure>

(17)

Because in this paper we focus entirely on absorption lines, we report here *EWs* for absorption lines as positive numbers. Where needed we added additional Gaussians to model the other strong but narrow absorption or emission lines that are present in the same 1 Å wide intervals around the line of interest. The Gaussians include the instrumental broadening. For the strongest 14 lines we could leave the width of the Gaussians a free parameter; for the others we constrained the width to a smooth interpolation of the width from these stronger lines.

For illustration purposes, we show the full fluxed spectrum (after all corrections that we derived in this paper have been applied) in Fig. 9. A more detailed view of the spectrum including realistic spectral fits is given in Paper III of this series (Detmers et al. 2011).

### 6.3. Doppler shifts and velocity scale

The spectra as delivered by the SAS are not corrected for any Doppler shifts. We have estimated that the time-averaged velocity of the Earth with respect to Mrk 509 is −29.3 km s⁻¹ for the present Mrk 509 data. Because the angle between the lines of sight towards the Sun and Mrk 509 is close to 90° during all our observations, the differences in Doppler shift between the individual observations are always less than 1.0 km s⁻¹, with an rms variation of 0.5 km s⁻¹. Therefore these differences can be ignored (less than 0.1 mÅ for all lines). The orbital velocity of *XMM-Newton* with respect to Earth is less than 1.2 km s⁻¹ for all our observations and can also be neglected.

We need a reference frame to determine the outflow velocities of the AGN. For the reference cosmological redshift we choose here 0.034397 ± 0.000040 (Huchra et al. 1993), because this value is also recommended by the NASA/IPAC Extragalactic database NED, although the precise origin of this number is unclear; Huchra et al. (1993) refer to a private communication to Huchra et al. in 1988.

Because we do not correct the RGS spectra for the orbital motion of the Earth around the Sun, we will instead use an effective redshift of 0.03450 ± 0.00004 to calculate predicted wavelengths. This effective redshift is simply the combination of the 0.034397 cosmological value with the average −29.3 km s⁻¹ of the motion of the Earth away from Mrk 509.

For Galactic foreground lines it is common practice to use velocities in the Local Standard of Rest (LSR) frame, and we will adhere to that convention for Galactic lines. The conversion from LSR to Heliocentric velocities for Mrk 509 is given by $v_{LSR} = v_{Helio} + 8.9 \text{ km s}^{-1}$, cf. Sembach et al. (1999).

### 6.4. Absolute wavelength scale

The correction that we derived in Sect. 6.1 aligns both RGS detectors and spectral orders, but there is still an uncertainty (wavelength offset) in the absolute wavelength scale of RGS1. We estimate this offset here by comparing measured line centroids in our spectrum to predicted wavelengths based on other X-ray, UV, or optical spectroscopy of Mrk 509. We consider five different methods:

1. lines from the outflow of Mrk 509;

2. lines from foreground neutral gas absorption;

3. lines from foreground hot gas absorption;

4. comparison with a sample of RGS spectra of stars;

5. comparison with *Chandra* LETGS spectra.

#### 6.4.1. Lines from the outflow of Mrk 509

The outflow of Mrk 509 has been studied in the past using high-resolution UV spectroscopy with FUSE (Kriss et al. 2000) and HST/STIS (Kraemer et al. 2003). A preliminary study of the COS spectra taken simultaneously with the *Chandra* LETGS spectra in December 2009, within a month from the present *XMM-Newton* observations, shows that there are no major changes in the structure of the outflow as seen through the UV lines. Hence, we take the archival FUSE and STIS data as templates for the X-ray lines. Kriss et al. (2000) showed the presence of seven velocity components labelled 1–7 from high to low outflow velocity. Component 4 may have sub-structure (Kraemer et al. 2003) but we ignore these small differences here. The outflow components form two distinct troughs, a high-velocity component from the overlapping components 1–3 and a low-velocity component from the overlapping components 4–7.

Note that our analysis of ISM lines in the HST/COS spectra for our campaign (Kriss et al. 2011) shows that the wavelength scale for the FUSE data (Kriss et al. 2000) needs a slight adjustment. As a consequence, we subtract 26 km s⁻¹ from the velocities reported by Kriss et al. (2000), in addition to the correction to a different host galaxy redshift scale.

In Table 4 we list the column-density weighted or equivalent width weighted average velocities. We also give the typical ionisation parameter $\xi$ for which the ion has its peak concentration, based upon the analysis of archival *XMM-Newton* data of Mrk 509 by Detmers et al. (2010).

In principle, equivalent-width weighted line centroids are preferred to predict the centroids of the unresolved X-ray lines. Because for most of the X-ray lines the optical depths are not very high, using just the column-density weighted average will not make much difference, however.

The strong variation of average outflow velocity as a function of $\xi$ that is apparent in Table 4, in particular between O vi and N v, shows that caution must be taken. Therefore, we consider here only X-ray lines from ions that overlap in ionisation parameter with the ions in Table 4. We list those lines in Table 5. For C v and O v we have interpolated the velocity between the O vi and N v velocity according to their log $\xi$ value. The weighted average shift $\Delta\lambda \equiv \lambda_{\text{obs}} - \lambda_{\text{pred}}$ is −5.3 ± 3.6 mÅ.
<figure><img src="image_12.png" /><figcaption>**Fig. 9.** Fluxed, stacked spectrum of Mrk 509. Only the lines used in Table 3 have been indicated. See Detmers et al. (2011) for a more detailed figure.</figcaption></figure>

### 6.4.2. Lines from foreground neutral gas absorption

Our spectrum (see Table 3) contains lines from the neutral as well as the hot phase of the ISM. Here we discuss the neutral phase. The spectrum shows two strong lines from this phase, the OI and NII 1s-2p lines. Other lines are too weak to be used for wavelength calibration purposes.

The sight line to Mrk 509 is dominated by neutral material at LSR velocities of about +10 km s⁻¹ and +60 km s⁻¹, as seen for instance in the NaI D₁ and D₂ lines, and the CaII H and K lines (York et al. 1982). Detailed 21 cm observations (McGee & Newton 1986) show four components: two almost equal components at -6 and +7 km s⁻¹, a weaker component (6% of the total HI column density) at +59 km s⁻¹ and the weakest component at +93 km s⁻¹ containing 0.7% of the total column density.

The strongest X-ray absorption line from the neutral phase is the OI 1s-2p transition. The rest-frame wavelength of this line has been determined as 23.5113 ± 0.0018 Å (Kaastra et al. 2010). Based on the velocity components of McGee & Newton (1986), we have estimated the average velocity for this line as

well as the UV line at 1302 Å, assuming an oxygen abundance of 5.75 × 10⁻⁴ (proto-solar value: Lodders 2003), adopting that ~50% of all neutral oxygen is in its atomic form. We predict for the λ23.5 Å line an LSR velocity of +24 km s⁻¹, and for the λ1302 Å line a velocity of +40 km s⁻¹. For a two times higher column density, these lines shift by no more than +6 and +1 km s⁻¹, respectively. For comparison, the measured centroid of the λ1302 Å line (Collins et al. 2004, Fig. 6) is +40 km s⁻¹, in close agreement with the prediction. A systematic uncertainty of ±10 km s⁻¹ on the predicted λ23.5 Å line seems therefore to be justified. Taking this into account, we expect the OI line at 23.515 ± 0.002 Å.

Unfortunately, the Galactic OI λ23.5 Å line is blended by absorption from lines of two other ions in the outflow of Mrk 509, OIV and CaXV. We discuss those lines below.

**Contamination by OIV:** The OIV 1s-2p²P transition, which has a laboratory wavelength of 22.741 ± 0.004 Å (Gu et al. 2005), contaminates the Galactic OI line. In fact, the situation is more
<table><caption>**Table 4.** Outflow velocities in km s⁻¹ derived from UV lines.</caption><thead><tr><th>Feature</th><th>log ξ<sup>a</sup></th><th>Comp. 1–3</th><th>Comp. 4–7</th><th>Comp. 1–7</th><th>w<sup>b</sup></th><th>Ref.<sup>c</sup></th></tr></thead><tbody><tr><td>H<sub>1</sub> λ1026</td><td></td><td>-317</td><td>+6</td><td>-56</td><td>N</td><td>FUSE</td></tr><tr><td>H<sub>1</sub> λ1026</td><td></td><td>-330</td><td>+48</td><td>-89</td><td>EW</td><td>FUSE</td></tr><tr><td>O<sub>VI</sub> λ1032/38</td><td>+0.4</td><td>-329</td><td>+44</td><td>-28</td><td>N</td><td>FUSE</td></tr><tr><td>O<sub>VI</sub> λ1032/38</td><td></td><td>-338</td><td>+64</td><td>-78</td><td>EW</td><td>FUSE</td></tr><tr><td>N<sub>V</sub> λ1239/43</td><td>-0.1</td><td>-344</td><td>+21</td><td>-166</td><td>N</td><td>STIS</td></tr><tr><td>C<sub>IV</sub>λ1548/51</td><td>-0.6</td><td>-328</td><td>+1</td><td>-197</td><td>N</td><td>STIS</td></tr><tr><td>C<sub>III</sub> λ977.02</td><td>-1.4</td><td>-347</td><td>-16</td><td>-224</td><td>N</td><td>FUSE</td></tr><tr><td>C<sub>III</sub> λ977.02</td><td></td><td>-339</td><td>-27</td><td>-231</td><td>EW</td><td>FUSE</td></tr></tbody></table>

**Notes.** (a) Ionisation parameter in 10⁻⁹ W m. (b) N: weighted average using column densities; EW: weighted average using equivalent widths. (c) FUSE: Kriss et al. (2000), STIS: Kraemer et al. (2003).

<table><caption>**Table 5.** Wavelength differences (observed minus predicted, in mÅ) for selected X-ray lines of the outflow.</caption><thead><tr><th>Line</th><th>log ξ<sup>(a)</sup></th><th>v<sup>(b)</sup><br>(km s<sup>-1</sup>)</th><th>Δv<sup>(c)</sup><br>(km s<sup>-1</sup>)</th><th>λ<sub>obs</sub> - λ<sub>pred</sub><sup>(d)</sup><br>mÅ</th></tr></thead><tbody><tr><td>N<sub>V</sub> λ28.79</td><td>+0.7</td><td>-28</td><td>50</td><td>-5 ± 7</td></tr><tr><td>O<sub>VI</sub> λ22.02</td><td>+0.4</td><td>-28</td><td>10</td><td>-6 ± 5</td></tr><tr><td>C<sub>V</sub> λ34.97</td><td>+0.1</td><td>-110</td><td>100</td><td>+8 ± 13</td></tr><tr><td>O<sub>V</sub> λ22.37</td><td>0.0</td><td>-138</td><td>40</td><td>-11 ± 12</td></tr><tr><td>N<sub>V</sub> λ29.41</td><td>-0.1</td><td>-166</td><td>10</td><td>-10 ± 15</td></tr><tr><td>average</td><td></td><td></td><td></td><td>-5.3 ± 3.6</td></tr></tbody></table>

**Notes.** (a) Ionisation parameter in 10⁻⁹ W m. (b) Adopted velocity based on UV lines. (c) Adopted systematic uncertainty in velocity based on the differences in centroids for the UV lines. (d) Statistical uncertainty observed line centroid, uncertainty in laboratory wavelength (Table 3) and the adopted systematic uncertainty in velocity have been added in quadrature.

<table><caption>**Table 6.** Wavelengths (Å) of the O IV 1s–2p transitions; all transitions are from the ground state to 1s2s²2p².</caption><thead><tr><th><sup>2</sup>D<sub>3/2</sub></th><th><sup>2</sup>P<sub>1/2</sub></th><th><sup>2</sup>P<sub>3/2</sub></th><th><sup>2</sup>S<sub>1/2</sub></th><th>Reference</th></tr></thead><tbody><tr><td>22.777</td><td>22.729</td><td>22.727</td><td>22.571</td><td>HULLAC<sup>a</sup></td></tr><tr><td>22.755</td><td>22.739</td><td>22.736</td><td>22.573</td><td>Cowan code<sup>b</sup></td></tr><tr><td>22.77</td><td>22.74</td><td>22.74</td><td>22.66</td><td>AS2 (Autostructure)<sup>c</sup></td></tr><tr><td>22.78</td><td>22.75</td><td>22.75</td><td>22.65</td><td>HF1 (Cowan code)<sup>c</sup></td></tr><tr><td>22.73</td><td></td><td>22.67</td><td>22.46</td><td>R-matrix<sup>d</sup></td></tr><tr><td>–</td><td>22.741 ± 0.004</td><td></td><td>–</td><td>experiment<sup>e</sup></td></tr><tr><td>22.777</td><td>22.741</td><td>22.739</td><td>22.571</td><td>Adopted value</td></tr><tr><td>0.010</td><td>0.004</td><td>0.004</td><td>0.025</td><td>Adopted uncertainty</td></tr></tbody></table>

**Notes.** (a) E. Behar (2001, priv. comm.). (b) A.J.J. Raassen (2001, priv. comm.) (c) García et al. (2005). (d) Pradhan et al. (2003). (e) Gu et al. (2005).

complex, because the main O IV 1s–2p multiplet has four transitions. In Table 6 we summarise the theoretical calculations and experimental measurements of the wavelengths of these lines. The adopted values are based on the single experimental measurement and the HULLAC calculations, while the adopted uncertainties are based on the scatter in the wavelength differences.

In the present case, both the O IV 1s–2p<sup>2</sup>D<sub>3/2</sub> and 1s–2p<sup>2</sup>P<sub>1/2</sub> and <sup>2</sup>P<sub>3/2</sub> transitions of the outflow blend with the Galactic O I line, with relative contributions of 37, 42, and 21%, respectively. The precise contamination is hard to determine, because these are the strongest O IV transitions and the other O IV transitions are

too weak to determine the column density. Based on the absorption measure distribution of other ions with similar ionisation parameter, we estimate that the total equivalent width of these three O IV lines is 3.6 ± 2.0 mÅ (Detmers et al. 2011). The same modelling predicts that the O IV concentration peaks at log ξ = -0.6, at almost the same ionisation parameter as for C IV. The optical depths of all X-ray lines of O IV is less than 0.1, hence we use the column-density weighted average line centroid of C IV (-197 km s⁻¹) for O IV. With this, we predict a wavelength for the combined <sup>2</sup>D and <sup>2</sup>P transitions of O IV of 23.523 ± 0.004 Å.

**Contamination by Ca xv:** The other contaminant to the Galactic O I 1s–2p line is the Ca xv 2p–3d (<sup>3</sup>P<sub>0</sub>–<sup>3</sup>D<sub>1</sub>) λ22.730 Å transition of the outflow. This is the strongest X-ray absorption line for this ion. Based on the measured column density of Ca xv in the outflow, and assuming that the Ca xv column density is similar, we expect an equivalent width of 4.9 ± 2.3 mÅ for this line, about 10% of the strength of the O I blend.

The rest-wavelength of this transition is somewhat uncertain, however. Kelly (1987) gives a value of 22.725 Å, without errors, and refers to Bromage & Fawcett (1977), who state that their theoretical wavelength is within 5 mÅ from the observed value of 22.730 Å, and that the line is blended. Although not explicitly mentioned, their experimental value comes from Kelly & Palumbo (1973) (cited in the Bromage & Fawcett paper). Kelly & Palumbo (1973) give a value of 22.73 Å, but state it is for the <sup>3</sup>P<sub>2</sub>–<sup>3</sup>D<sub>3</sub> transition, which is a misclassification according to Fawcett & Hayes (1975). These latter authors list as their source Fawcett (1971), who gives the value of 22.73, but no accuracy. In Fawcett (1970) the typical accuracy of the plasma measurements is limited by Doppler motions of about 10⁻⁴c. If we assume that this accuracy also holds for the data in Fawcett (1971), the estimated accuracy should be about 2 mÅ. Given the rounding of Fawcett (1970), an rms uncertainty of 3 mÅ is more appropriate. However, there is some level of blending with other multiplets. Blending is probably caused by other 2p–3d transitions in this ion, most likely transitions between the <sup>3</sup>P–<sup>3</sup>D, <sup>3</sup>P–<sup>3</sup>P and <sup>1</sup>D–<sup>1</sup>F multiplets (Aggarwal & Keenan 2003). A comparison of the theoretical wavelengths of Aggarwal & Keenan (2003) with the experimental values of Kelly (1987) for all lines of the <sup>3</sup>P–<sup>3</sup>D multiplet shows a scatter of 6 mÅ, apart from an offset of 145 mÅ.

Given all this, we adopt here the original measurement of Fawcett (1971), but with a systematic uncertainty of 5 mÅ. As Ca xv has a relatively large ionisation parameter (log ξ = 2.5), we expect that like other highly ionised species in Mrk 509 it is dominated by the high-velocity outflow components, which have a velocity of about -340 km s⁻¹ (see Table 4). With a conservative 200 km s⁻¹ uncertainty (allowing a centroid up to halfway between the two main absorption troughs), we may expect the line at 23.488 ± 0.017 Å.

**Centroid of the O I blend:** The total equivalent width of the O I blend is 29.1 ± 2.8 mÅ (see Table 3). The velocity dispersion of the contaminating O IV and Ca xv lines is an order of magnitude higher than the low velocity dispersion of the cold Galactic gas, and both contaminants have optical depth lower than unity. The total blend is thus the combination of broad and shallow contaminants with deep and narrow O I components. Thus the contribution from O I itself is obtained by simply subtracting the contributions from O IV and Ca xv from the total measured equivalent width of the blend. This yields an
<table><caption>**Table 7.** Decomposition of the O vi profile of Sembach et al. (2003) into Gaussian components.</caption><thead><tr><th>Nr</th><th>v<sub>LSR</sub><br>(km s<sup>-1</sup>)</th><th>σ<br>(km s<sup>-1</sup>)</th><th>Column<br>(10<sup>16</sup> m<sup>-2</sup>)</th></tr></thead><tbody><tr><td>1</td><td>-245</td><td>59</td><td>214</td></tr><tr><td>2</td><td>-126</td><td>16</td><td>23</td></tr><tr><td>3</td><td>-64</td><td>13</td><td>19</td></tr><tr><td>4</td><td>+26</td><td>44</td><td>440</td></tr><tr><td>5</td><td>+152</td><td>24</td><td>26</td></tr></tbody></table>

O I equivalent width of $20.6 \pm 4.2$ mÅ. Taking into account the contribution of the contaminants, we expect the centroid of the blend to be at $23.5115 \pm 0.0032$ Å. This corresponds to an offset $\Delta\lambda = 9.9 \pm 4.5$ mÅ.

N I: The other strong X-ray absorption line from the neutral phase of the ISM is the N I 1s–2p line. We adopt the same LSR velocity as for the unblended O I line, $+24$ km s$^{-1}$. This is consistent with the measured line profile of the N I $\lambda$1199.55 Å line, which shows two troughs at about 0 and $+50$ km s$^{-1}$ (Collins et al. 2004). The shift derived from the N I line is therefore $+12.2 \pm 8.9$ mÅ.

We note, however, that for N I we can only use RGS2, because RGS1 shows some instrumental residuals near this line. The nominal wavelength for RGS1 is 26 mÅ higher than for RGS2. It is therefore worthwhile to do a sanity check. For this we have determined the same numbers from archival data of Sco X-1. That source was observed several times with significant offsets in the dispersion direction, so that the spectral lines fall on different parts of the CCDs or even on different CCD chips. We measure wavelengths for O I and N I in Sco X-1 of $23.5123 \pm 0.0015$ and $31.2897 \pm 0.0030$ Å, respectively. Sco X-1 has a heliocentric velocity of $-114$ km s$^{-1}$ (Steeghs & Casares 2002). Given its Galactic longitude of $0.7$, we expect the local foreground gas to have negligible velocity. This is confirmed by an archival HST/GHRS spectrum, taken from the HST/MAST archive, and showing a velocity consistent with zero, to within $5$ km s$^{-1}$ for the N I $\lambda$1199.55 Å line from the ISM. This then leads to consistent observed offsets for the 1s–2p transitions of O I and N I in Sco X-1 of $1.0 \pm 2.3$ mÅ and $4.0 \pm 3.0$ mÅ, respectively.

Combining both the O I and the N I line for Mrk 509, we obtain a shift of $+10.3 \pm 4.0$ mÅ.

### 6.4.3. Lines from foreground hot gas absorption

Our spectrum also contains significant lines from hot, ionised gas along the line of sight, in particular from O vi, O vii, O viii, and C vi. Sembach et al. (2003) give a plot of the O vi line profile. This line shows clear high-velocity components at $-247$ and $-143$ km s$^{-1}$. Unfortunately, no column density of the main Galactic component is given by Sembach et al. (2003). Therefore we have fitted their profile to the sum of 5 Gaussians (Table 7). The column-density weighted centroid for the full line is at $-56$ km s$^{-1}$ in the LSR frame. We estimate an uncertainty of about $8$ km s$^{-1}$ on this number.

Note that a part of the high-velocity trough in the blue is contaminated by a molecular hydrogen line at $1031.19$ Å, which falls at $v_{LSR} = -206$ km s$^{-1}$. This biases component 1 of our fit for the hot foreground galactic component by about $10$ km s$^{-1}$. This component in C iv, Si iv, and N v in the COS spectra is at a

<table><caption>**Table 8.** Line shifts $\Delta\lambda \equiv \lambda_{\text{obs}} - \lambda_{\text{pred}}$ in mÅ for the X-ray absorption lines from the hot interstellar medium.</caption><thead><tr><th>Transition</th><th>Δλ<sup>a</sup><br>(mÅ)</th><th>Δλ<sup>b</sup><br>(mÅ)</th><th>Error<sup>c</sup><br>(mÅ)</th><th>Error<sup>d</sup><br>(mÅ)</th></tr></thead><tbody><tr><td>Fe xvii 2p–3d</td><td>9</td><td>5</td><td>8</td><td>13</td></tr><tr><td>Ne x 1s–2p</td><td>-8</td><td>-11</td><td>10</td><td>13</td></tr><tr><td>Ne ix 1s–2p</td><td>9</td><td>6</td><td>7</td><td>11</td></tr><tr><td>O vii 1s–3p</td><td>-3</td><td>-8</td><td>10</td><td>16</td></tr><tr><td>O viii 1s–2p</td><td>0</td><td>-5</td><td>5</td><td>14</td></tr><tr><td>O vii 1s–2p</td><td>-2</td><td>-8</td><td>5</td><td>15</td></tr><tr><td>O vi 1s–2p</td><td>8</td><td>2</td><td>13</td><td>13</td></tr><tr><td>C vi 1s–2p</td><td>11</td><td>1</td><td>13</td><td>26</td></tr></tbody></table>

Notes. (a) Using $v_{LSR} = -56$ km s$^{-1}$. (b) Using $v_{LSR} = +26$ km s$^{-1}$.

(c) Only statistical error. (d) Including uncertainty of $\pm 200$ km s$^{-1}$ except for O vi.

velocity of $v_{LSR} = -245$ km s$^{-1}$ (Kriss et al. 2011), and therefore we adopt that value here.

While this velocity can be readily used for predicting the observed wavelength of the O vi 1s–2p line, the uncertainty for other X-ray lines is larger, because the temperatures or ionisation states of the dominant components 1 and 4 may be different. Moreover, O vi is the most highly ionised ion available in the UV band, while most of our X-ray lines from the ISM have a higher degree of ionisation. Therefore, without detailed modelling of all these components, we conservatively assume here for all ions other than O vi an error of $200$ km s$^{-1}$ on the average outflow, corresponding to the extreme cases that the bulk of the column density is in either component 1 or 5.

The Galactic O vii 1s–2p line at $21.6$ Å suffers from some blending by the N vii 1s–3p line from the outflow. That last line, with a predicted equivalent width of $4.5$ mÅ, has a relatively high ionisation parameter, $\log \xi = 1.4$. Therefore we do not know exactly what its predicted velocity should be, and we conservatively assume a value of $-100 \pm 200$ km s$^{-1}$, spanning the full range of outflow velocities. With that, the predicted wavelength of the N vii outflow line is $21.624 \pm 0.014$ Å, while the predicted wavelength of the O vii line is $21.5993 \pm 0.0006$ Å. The predicted wavelength of the blend then is $21.606 \pm 0.004$ Å.

In Table 8 we list the lines that we use and the derived line shifts $\Delta\lambda$. The weighted average is $+1.7 \pm 2.6$ mÅ when we only include statistical errors, and $+2.8 \pm 4.9$ mÅ if we include the systematic uncertainties.

We make here a final remark. Combining all wavelength scale indicators including the one above (Sect. 6.4.6), we obtain an average shift of $-1.6$ mÅ. Using this number, the most significant lines of Table 8 (O vii and O viii 1s–2p) clearly show a velocity much closer to the dominant velocity component 4 ($+26$ km s$^{-1}$, Table 7) than to the column-density weighted velocity of the O vi line at $-56$ km s$^{-1}$. This last number is significantly affected by the high-velocity clouds, which apparently are less important for the more highly ionised ions. Therefore, in Table 8 we also list in Col. 3 the wavelength shifts under the assumption that all lines except O vi are dominated by component 4. With that assumption, and taking now only the statistical errors into account, the weighted average shift is $-1.7 \pm 2.8$ mÅ.

### 6.4.4. Comparison with a sample of RGS spectra of stars

Preliminary analyses (González-Riestra, priv. comm.) of a large sample of RGS spectra of stellar coronae indicate that there is a
correlation between the wavelength offsets and the solar aspect angle (SAA) of the satellite (correlation coefficient about 0.6). At a mean SAA of 90°, the average Δλ for RGS1 is 2.3 mÅ, while for RGS2 it is 7.3 mÅ. The scatter for an individual observation is 6 and 7 mÅ, respectively. The difference between RGS1 and RGS2 is fairly consistent with the 6.9±0.7 mÅ that we adopted for the present work. Because our observation campaign on Mrk 509 spans the full visibility window, the average SAA angle is 90°; it varied between 108°.5 for the first observation to 73°.3 for the last observation. The wavelengths in our spectrum (averages of the original RGS1 wavelengths and the RGS2 wavelengths minus 6.9 mÅ) should then be off by +1.4±6.5 mÅ.

The above estimate can be refined further. It appears that there is also a correlation of the wavelength offset with the temperature parameters T2007 and T2031 of the grating boxes on RGS1 and RGS2, respectively. However, these temperatures do not correlate well with the SAA. Hence, following González-Riestra et al. (priv. comm.) and using their data on 38 spectra of stellar coronae, we obtain the following correlations:

$$ \text{RGS1:}\Delta\lambda = 4.92 - 0.49(\text{SAA} - 90^{\circ}) - 12.8(\text{T2007} - 20.7), \quad (18) $$

$$ \text{RGS2:}\Delta\lambda = 8.32 - 0.55(\text{SAA} - 90^{\circ}) - 11.8(\text{T2031} - 20.7), \quad (19) $$

where the SAA is expressed in degrees, and the temperatures in °C. The scatter around this relation is 4.1 and 4.8 mÅ for RGS1 and RGS2, respectively. This scatter is significantly smaller than the scatter using only the correlation with SAA mentioned above.

We apply this now to the 10 individual observations of Mrk 509. We have determined the individual line centroids of the six strongest lines (C VI 1s–2p, O VII 1s–2p and 1s–3p, O VII 1s–2p, Ne IX 1s–2p all from the outflow, and O I 1s–2p from the foreground). We then take the difference with the wavelength in the combined observation, and averaged these residuals. We show the results in Table 9 and Fig. 10.

The model gives an improvement: the rms residuals (after correction for the mean statistical errors on the data points of 2.3 mÅ) are reduced from 5.4 to 4.6 mÅ. This is fully consistent with the remaining residuals in the set of coronal spectra discussed above. It is also clear that the remaining residuals are non-statistical, and although on average the model gives an improvement, in some individual cases the opposite is true, for instance for observations 3, 7 and 10.

Keeping this in mind, we can use the model to predict the absolute wavelength scale. We predict absolute offsets Δλ of –2.76 and +0.10 mÅ for RGS1 and RGS2, respectively. In our extraction procedure, we have subtracted 6.9 mÅ from the RGS2 wavelengths; doing the same for the predicted RGS offset, and averaging the offsets for RGS1 and RGS2, the model predicts a total offset of –4.8 mÅ. We only need to apply a small correction for the velocity of the Earth. It can be assumed that the sample of stars has, on average, zero redshift because of the motion of Earth, because usually each source can be observed twice a year with opposite signs of the Doppler shift. Our data of Mrk 509 were taken with a rather extreme Earth velocity of –29.3 km s⁻¹. At a typical wavelength of 20 Å, this corresponds to a correction factor of 2.0 mÅ. We finally obtain a predicted offset of –2.8 ± 4.5 mÅ where the error is the average systematic residual found for the sample of coronae mentioned before.

<table><caption>**Table 9.** Average line shifts for the six strongest lines, relative to the total spectrum.</caption><thead><tr><th>Obs</th><th>λ-λ<sup>a</sup><br>(mÅ)</th><th>SAA<br>(°)</th><th>T2007<br>(°C)</th><th>T2031<br>(°C)</th><th>λ-λ<sup>b</sup><br>(mÅ)</th></tr></thead><tbody><tr><td>1</td><td>-6.2 ± 3.0</td><td>108.5</td><td>21.38</td><td>21.48</td><td>-10.60</td></tr><tr><td>2</td><td>-12.2 ± 2.9</td><td>104.1</td><td>21.26</td><td>21.38</td><td>-6.97</td></tr><tr><td>3</td><td>+3.9 ± 1.9</td><td>100.7</td><td>21.32</td><td>21.42</td><td>-5.80</td></tr><tr><td>4</td><td>+2.4 ± 2.2</td><td>94.7</td><td>21.24</td><td>21.33</td><td>-1.68</td></tr><tr><td>5</td><td>-3.6 ± 2.1</td><td>90.9</td><td>21.43</td><td>21.51</td><td>-1.98</td></tr><tr><td>6</td><td>-3.0 ± 2.1</td><td>86.7</td><td>21.51</td><td>21.54</td><td>-0.48</td></tr><tr><td>7</td><td>0.0 ± 2.3</td><td>82.7</td><td>21.28</td><td>21.40</td><td>3.90</td></tr><tr><td>8</td><td>+7.3 ± 2.3</td><td>78.7</td><td>21.32</td><td>21.43</td><td>5.52</td></tr><tr><td>9</td><td>+7.6 ± 2.1</td><td>75.0</td><td>21.24</td><td>21.35</td><td>8.42</td></tr><tr><td>10</td><td>+0.3 ± 2.3</td><td>72.7</td><td>21.24</td><td>21.34</td><td>9.68</td></tr><tr><td>all<sup>c</sup></td><td>≡0</td><td>89.5</td><td>21.32</td><td>21.42</td><td>≡0</td></tr></tbody></table>

**Notes.** (a) Observed wavelength difference for individual observations. (b) Predicted wavelength difference for individual observations using (18)–(19); results for RGS1 and RGS2 have been weighted averaged (not all lines present in each RGS). (c) Combined spectrum.

<figure><img src="image_13.png" /><figcaption>**Fig. 10.** Top panel: wavelength difference for the six strongest lines in each observation relative to the lines in the average spectrum (data points) and model based on Eqs. (18), (19) (histogram). Bottom panel: residuals of the data points relative to the model in the upper panel.</figcaption></figure>

### 6.4.5. Comparison with Chandra LETGS spectra

We have also measured the wavelengths of the 1s–2p and 1s–3p lines of O VII and O VIII in the Chandra LETGS spectrum of Mrk 509 taken 20 days after our last XMM-Newton observation. LETGS has the advantage above RGS that it measures both positive and negative spectral orders, hence allow us to determine the zero-point of the wavelength scale more accurately. Table 10 lists the wavelengths measured by both instruments. The average wavelength offset of RGS relative to LETGS is –6.9 ± 2.4 mÅ. The above number only includes the statistical uncertainties. We have extracted an LETGS spectrum of Capella, taken around the same time as the Mrk 509 observation. The ten strongest lines in the spectrum of Capella between 8–34 Å show a scatter with rms amplitude of 6 mÅ compared to the laboratory wavelengths, but no systematic offset larger than 2 mÅ. We therefore add a systematic uncertainty of 6/√4 = 3 mÅ in quadrature to the statistical uncertainty of the average Δλ for the four lines in Mrk 509 that we use here.
<table><caption>**Table 10.** Comparison of measured wavelengths from the RGS and LETGS.</caption><thead><tr><th>Transition</th><th>RGS<br>(Å)</th><th>LETGS<br>(Å)</th><th>RGS - LETGS<br>(mÅ)</th></tr></thead><tbody><tr><td>O viii 1s-3p</td><td>16.5460 ± 0.0023</td><td>16.552 ± 0.004</td><td>-6 ± 5</td></tr><tr><td>O vii 1s-3p</td><td>19.2649 ± 0.0029</td><td>19.269 ± 0.007</td><td>-4 ± 8</td></tr><tr><td>O viii 1s-2p</td><td>19.6146 ± 0.0012</td><td>19.619 ± 0.004</td><td>-4 ± 4</td></tr><tr><td>O vii 1s-2p</td><td>22.3354 ± 0.0018</td><td>22.346 ± 0.004</td><td>-11 ± 4</td></tr></tbody></table>

<table><caption>**Table 11.** Overview of wavelength scale indicators.</caption><thead><tr><th>Indicator</th><th>Δλ ≡ λ<sub>obs</sub> - λ<sub>pred</sub><br>(mÅ)</th></tr></thead><tbody><tr><td>1. Lines from the outflow of Mrk 509</td><td>-5.3 ± 3.6</td></tr><tr><td>2. Lines from foreground neutral gas<sup>a</sup></td><td>+10.3 ± 4.0</td></tr><tr><td>3. Lines from foreground neutral gas<sup>b</sup></td><td>+6.5 ± 3.4</td></tr><tr><td>4. Lines from foreground hot gas absorption<sup>c</sup></td><td>+2.8 ± 4.9</td></tr><tr><td>5. Lines from foreground hot gas absorption<sup>d</sup></td><td>-1.9 ± 4.9</td></tr><tr><td>4. Comparison with a sample of RGS spectra of stars</td><td>-2.8 ± 4.5</td></tr><tr><td>5. Comparison with Chandra LETGS spectra</td><td>-7.3 ± 3.8</td></tr><tr><td>All indicators combined<sup>a,c</sup></td><td>-1.0 ± 1.8</td></tr><tr><td>All indicators combined<sup>b,c</sup></td><td>-1.2 ± 1.8</td></tr><tr><td>All indicators combined<sup>a,d</sup></td><td>-1.6 ± 1.8</td></tr><tr><td>All indicators combined<sup>b,d</sup></td><td>-1.8 ± 1.8</td></tr></tbody></table>

**Notes.** (a) As described in Sect. 6.4.2. (b) Ignoring the blending by Ca xv of the O I line. (c) Using the O vi centroid velocity. (d) Using the velocity of dominant component 4 in O vi.

We only need to make a small correction of -0.4 mÅ corresponding to the higher speed of Earth away from Mrk 509 (-29.3 km s⁻¹) during the XMM-Newton observation as compared to the Chandra observation (-23.3 km s⁻¹). This all leads to an offset of -7.3 ± 3.8 mÅ.

### 6.4.6. Summary of results on the wavelength scale

We now summarise our findings from the previous sections (Table 11). All estimates agree within the error bars, except for the lines from the neutral foreground gas, which is off by about 3σ. This number is dominated by the fairly complex O I blend. Possibly there are larger systematic uncertainties on this number than we assumed. The major factor here is the blending with Ca xv. If we assume that the equivalent width of the contaminating Ca xv line is zero, the predicted blend centroid decreases by 4.4 mÅ, towards better agreement with the other indicators. The O iv blend has a much smaller impact, because its centroid is already close to the centroid of the Galactic O I line.

We note that a lower value of the predicted equivalent width of the Ca xv line may be caused by a somewhat lower Ca abundance; alternatively, if the density is higher than about 10¹⁶ m⁻³, the population of Ca xv in the ground state decreases significantly (Bhatia & Doschek 1993), leading also to a reduced equivalent width of this absorption line.

All five methods used here have their advantages and disadvantages, and we have done the best we can to estimate the uncertainties for each of the methods. The five methods are for the major part statistically independent, and this allows us to use a weighted average for the final wavelength correction. Ignoring the blending by Ca xv to the Galactic O I line, and using +26 km s⁻¹ for the outflow velocity of the hot Galactic gas, this wavelength shift is -1.8 ± 1.8 mÅ. Within their statistical

<figure><img src="image_14.png" /><figcaption>**Fig. 11.** Average outflow velocity as measured through individual lines with statistical errors smaller than 100 km s⁻¹. The dashed lines show the seven velocity components as seen in archival FUSE data (Kriss et al. 2000).</figcaption></figure>

uncertainties, all individual indicators are consistent with this value, except for the lines from foreground neutral gas, which are off by 8.3 ± 3.8 mÅ. We do not have an explanation for that deviation.

In our analysis, we apply the wavelength corrections by shifting the wavelength grids in our program rgs_fmat.

## 7. AGN outflow dynamics

To show how the optimised wavelength calibration improves the scientific results, we give a brief analysis of the velocity structure of the AGN outflow as measured in X-rays through two Rydberg series of oxygen ions. A full analysis of the spectrum is given by Detmers et al. (2011).

Using the measured outflow velocities for individual lines, we can immediately derive some interesting astrophysical conclusions (Fig. 11).

Most of the lines are in between the high-velocity components 1–3 and the lower velocity components 4–7 as found in the O vi lines (Kriss et al. 2000). This shows that there are multiple velocity components present in the X-ray absorption lines. At longer wavelengths these lines are closer to the low velocity components, showing that there is a higher column density in those components. However, for the shortest wavelength lines, in particular the 1s–2p transitions of Ne ix and Ne x, the centroid is in the range of the high-velocity components 1–3. Because the shorter wavelength lines originate from ions with a higher ionisation parameter, there is a correlation between the ionisation parameter and the outflow velocity.

The relative deviation of the 17.8 Å line (O vii 1s–4p) with respect to the other lines, including the 1s–2p and 1s–3p lines of the same ion, can be easily explained: according to preliminary modelling, the optical depth at line centre for the 1s–2p, 1s–3p and 1s–4p lines of O vii is 8, 1.4 and 0.5, respectively. Thus, if the O vii column density of the low velocity component is higher than that of the high-velocity component, the strongest low-velocity line components (like 1s–2p, 1s–3p) will saturate while the high-velocity components of these transitions will not saturate, hence effectively these strong lines will be blueshifted relative to the weaker 1s–4p line, consistent with what is observed.
<table><caption>**Table 12.** Parameters of the velocity components for O viii in the outflow of Mrk 509. Numbers in parenthesis were kept fixed.</caption><thead><tr><th rowspan="2">Parameter</th><th rowspan="2">Model 1</th><th colspan="2">Model 2</th></tr><tr><th>comp. 1–3</th><th>comp. 4–7</th></tr></thead><tbody><tr><td>v (km s<sup>-1</sup>)</td><td>-115 ± 17</td><td>(-329)</td><td>(+46)</td></tr><tr><td>σ (km s<sup>-1</sup>)</td><td>113 ± 7</td><td>45 ± 8</td><td>71 ± 15</td></tr><tr><td>N<sub>ion</sub> (10<sup>20</sup> m<sup>-2</sup>)</td><td>10.7 ± 1.3</td><td>6.9 ± 2.6</td><td>4.3 ± 1.5</td></tr><tr><td></td><td></td><td colspan="2">total: 11.2 ± 2.0</td></tr><tr><td>χ<sup>2</sup></td><td>4.21</td><td colspan="2">3.01</td></tr><tr><td>d.o.f.</td><td>5</td><td colspan="2">4</td></tr></tbody></table>

<figure><img src="image_15.png" /><figcaption>**Fig. 12.** Equivalent width and line centroid for the 1s–2p to 1s–5p lines of O viii, plotted versus the principal quantum number *n* of the upper level. The predicted values for model 1 are shown as dashed lines, those for model 2 as solid lines.</figcaption></figure>

We have elaborated on the line diagnostics for two of the most important ions in the outflow of Mrk 509, O viii and O vii, to see if we can detect both velocity components.

For O viii we have measured velocities and equivalent widths for the 1s–2p to 1s–5p lines (Table 3). We have tried different models. The first model consists of a single Gaussian absorption line, with free centroid, width and column density. Model 2 has two Gaussian components, with the centroids frozen to the values given in Table 4 as derived from the O vi troughs, but with the widths and column densities free parameters. The results are shown in Table 12 and Fig. 12. Both models give a good fit and cannot be distinguished on statistical grounds. The total column densities for both models are the same within their error bars, and also the sum of the width of the Gaussians for Model 2 is consistent with the width of the single Gaussian for Model 1. Apparently, as far as the determination of total line width and column density is concerned, the detailed column density distribution as a function of velocity is not very important. This can be understood because the strongest line with the best statistics (1s–2p) has a high optical depth (12.7 and 4.9 for the two components in model 2). The line core is thus black, the line shape rather “rectangular” and to lowest order approximation the width of the line is given by the sum parts of the spectrum where the core is black.

For Model 2 the total width for each of the components agrees well with the total width of components 1–3 and 4–7 of the O vi line. Thus, O viii originates from multiple components,

<table><caption>**Table 13.** Parameters of the velocity components for O vii in the outflow of Mrk 509. Numbers in parenthesis were kept fixed.</caption><thead><tr><th rowspan="2">Parameter</th><th rowspan="2">Model 1</th><th colspan="2">Model 2</th></tr><tr><th>comp. 1–3</th><th>comp. 4–7</th></tr></thead><tbody><tr><td>v (km s<sup>-1</sup>)</td><td>-102 ± 17</td><td>(-329)</td><td>(+46)</td></tr><tr><td>σ (km s<sup>-1</sup>)</td><td>96 ± 9</td><td>80(&gt;60)</td><td>51 ± 8</td></tr><tr><td>N<sub>ion</sub> (10<sup>20</sup> m<sup>-2</sup>)</td><td>5.9 ± 0.7</td><td>0.7(-0.1, +0.6)</td><td>6.9 ± 1.6</td></tr><tr><td></td><td></td><td colspan="2">total: 7.8 ± 1.4</td></tr><tr><td>χ<sup>2</sup></td><td>22.57</td><td colspan="2">12.93</td></tr><tr><td>d.o.f.</td><td>5</td><td colspan="2">4</td></tr></tbody></table>

but the fastest outflow components have a higher column density than the slower outflow components.

We have performed a similar analysis for the 1s–2p to 1s–5p lines of O vii (Table 13). The velocity broadening is consistent with what we obtained for O viii, although there is somewhat larger uncertainty. For O vii, however, the low velocity components 4–7 have clearly the highest column density, similar to what was found for O vi (Kriss et al. 2000).

## 8. Statistics

Local continuum fits to RGS spectra in spectral bands that have few lines yield in general $\chi^2$ values that are too low. This is an artefact of the SAS procedures related to the rebinning of the data. Data have to be binned from the detector pixel grid to the fixed wavelength grid that we use in our analysis. However, the bin boundaries of both grids do not match. As a consequence of this process, the natural Poissonian fluctuations on the spectrum as a function of detector pixel are distributed over the wavelength bin coinciding most with the detector pixel and its neighbours. In addition, there is a small smoothing effect caused by pointing fluctuations of the satellite. Owing to this tempering of the Poissonian fluctuations, $\chi^2$ values will be lower for a “perfect” spectral fit.

We have quantified the effect by fitting a linear model $F_\lambda = a + b\lambda$ to fluxed spectra in relatively line-poor spectral regions, in 1 Å wide bins in the 7–10, 17–18 and 35–38 Å ranges. The median reduced $\chi^2$ is 0.72, with a 67% confidence range between 0.65 and 0.79. Over the full 7–38 Å range, we have at least 400 counts (and up to 3000 counts) in each bin of ~0.02 Å width. Therefore, the Poissonian distribution is well approximated by the Gaussian distribution, and the usage of chi-squared statistics is well justified.

The rebinning process conserves the number of counts, hence the nominal error bars (square root of the number of counts) are properly determined. The lower reduced $\chi^2$ is caused by the smoothing effect on the data. For correct inferences about the spectrum, such a bias in $\chi^2$ is not appropriate. Because we cannot change the observed flux values, we opt to multiply the nominal errors on the fluxes by $\sqrt{0.72} = 0.85$ to obtain acceptable values for ideal data and models.

As a final check we have made a more robust estimate of the effect. For RGS1, the wavelength channel number $c_\lambda$ as a function of dispersion angle channel $c_\beta$ can be approximated well with

$$c_{\lambda} = 5.3708506 + 0.66942769c_{\beta} + 1.12824091 \times 10^{-4}c_{\beta}^{2}. \quad (20)$$

Locally, if the spectrum on the $\beta$-grid is given by a set of random variables $X_j$ and the spectrum on the wavelength grid is given by
<figure><img src="image_16.png" /><figcaption>Fig. 13. Relative contribution per wavelength bin to the reduced $\chi^2$. Calculated and shown is the ratio Var[Y_i]/E[Y_i] (see text). The thick line is a low-resolution spline approximation showing the trends in the average value.</figcaption></figure>

$Y_i$, we have

$$Y_i = \sum_j f_{ij} X_j, \qquad (21)$$

for a small number of bins j around the corresponding β-channel given by (20). It is important to note here that while the $X_j$ variables are statistically independent, the $Y_i$ variables in general are not. Typically, the $f_{ij}$ factors are proportional to the overlap of wavelength bin j with β-bin i. The clue is now that from elementary statistical considerations we have for the expected value of $Y_i$ and the variance

$$E[Y_i] = \sum_j f_{ij} E[X_j], \qquad (22)$$

$$\mathrm{Var}[Y_i] = \sum_j f_{ij}^2 \mathrm{Var}[X_j]. \qquad (23)$$

For instance, if the single β-bins j were exactly redistributed over two adjacent λ-bins, there would be two f-values, each = 0.5, and we have Var[Y_i]/E[Y_i] = 0.5Var[X_j]/E[X_j], where the factor 0.5 comes from $0.5^2 + 0.5^2$. We exactly made this calculation exactly using the grids related through (20), and show our result in Fig. 13.

# 9. Conclusion

## 9.1. Wavelength scale and spectral resolution

By using five different methods, we have obtained a consistent wavelength scale with an accuracy of about 1.8 mÅ, four times better than the nominal wavelength accuracy of RGS. The one slightly deviant diagnostic that remains is the neutral gas in our galaxy (O1 and N1), which is off from the mean by $8.8 \pm 3.8$ mÅ (2.3σ). The systematics from blending (for O1) and the lack of sufficiently reliable RGS data for N1 may result into slightly larger uncertainties than we have estimated.

Our work shows that in cases like ours a dedicated effort to improve the wavelength scale is rewarding. As we showed, at this level of accuracy, Doppler shifts caused by the orbit of Earth

around the Sun become measurable. The improved accuracy also allows us to use X-ray lines as tools to study the dynamics of the outflow and the Galactic foreground at a level beyond the nominal resolution of the instrument (see Sect. 7).

## 9.2. Effective area corrections

The corrections that we have derived for the relative effective area of both RGS detectors as well as for the relative effective area of both spectral orders are at the few percent level but should be taken into account for the high statistical quality spectrum that we consider here. This is because there are data gaps for each individual RGS, but each time at a different wavelength range. Without this correction, there would be artificial jumps at the boundaries of these regions of the order of a few percent. This leads any spectral fitting package to attempt to compensate for this by enhancing or decreasing astrophysical absorption lines or edges, in the hunt for the lowest $\chi^2$ value.

A disadvantage of our method is of course that the “true” effective area and hence absolute flux is known only to within a few percent, and the deviations are wavelength-dependent. In our subsequent spectral fitting (Detmers et al. 2011) we compensate for this by using a spline for the AGN continuum. This is clearly justified, as one might worry about the intrinsic applicability of e.g. pure power-law or blackbody components when the flux can be measured down to the percent level accuracy. The “true” continua may contain all kinds of features including e.g. relativistically broadened lines (e.g. Branduardi-Raymont et al. 2001; Sako et al. 2003) that can be discerned only in the highest-accuracy data, such as the present ones.

## 9.3. Combination of spectra

The reduction of the combined response matrices of our 40 spectra with 2 Gb of memory into a single spectrum and response file of only 8 Mb, a reduction by more than two orders of magnitude, allows us to make complex spectral fits. In the most sophisticated models used by Detmers et al. (2011) the number of free parameters approaches 100, and without this efficient response matrix the analysis would have been impossible.

## 9.4. Final remarks

Through the high statistical quality of our data, the binning problems mentioned in Sect. 8 became apparent. In many RGS spectra that have been obtained during the lifetime of XMM-Newton, the statistical quality of the spectra is not good enough to detect this effect. Still, this could imply that when users obtain a fit with reduced chi-squared of order unity, the fit is formally not acceptable because an ideal fit would yield a smaller reduced chi-squared. Clearly, more work needs to be done here to alleviate the problem, but the discretisation of wavelength in the detector corresponding to the natural size of the CCD pixels limits the possibilities. Even in the best observations there is always some small scatter in the satellite pointing, making some rebinning necessary.

Overall, however, the calibration of RGS is at a fairly advanced stage. Only for exceptionally good spectra like the Mrk 509 spectrum that we discussed here the sophisticated tools developed in this paper are needed, although our improvements can be beneficial for the analysis of weaker sources as well. Our
tools are publicly available as auxiliary programmes (rgsflux-combine, rgs_fmat) in the SPEX distribution.

**Acknowledgements.** We thank Charo González-Riestra (ESA) for providing the data on the RGS spectra of stars in the context of the wavelength scale calibration. This work is based on observations obtained with XMM-Newton, an ESA science mission with instruments and contributions directly funded by ESA Member States and the USA (NASA). SRON is supported financially by NWO, The Netherlands Organization for Scientific Research. K. Steenbrugge acknowledges the support of Comité Mixto ESO – Gobierno de Chile. Ehud Behar was supported by a grant from the ISF. G. Kriss gratefully acknowledges support from NASA/XMM-Newton Guest Investigator grant NNX09AR01G. M. Mehdipour acknowledges the support of a Ph.D. studentship awarded by the UK Science and Technology Facilities Council (STFC). P.-O. Petrucci acknowledges financial support from CNES and the French GDR PCHE. Ponti acknowledges support via an EU Marie Curie Intra-European Fellowship under contract No. FP7-PEOPLE-2009-IEF-254279. G. Ponti and S. Bianchi acknowledge financial support from contract ASI-INAF No. I/088/06/0.

## References

Aggarwal, K. M., & Keenan, F. P. 2003, A&A, 407, 769

Behar, E., & Netzer, H. 2002, ApJ, 570, 165

Beiersdorfer, P., López-Urrutia, J. R. C., Springer, P., Utter, S. B., & Wong, K. L. 1999, Rev. Sci. Instr., 70, 276

Bhatia, A. K., & Doschek, G. A. 1993, Atomic Data and Nuclear Data Tables, 53, 195

Branduardi-Raymont, G., Sako, M., Kahn, S. M., et al. 2001, A&A, 365, L140

Bromage, G. E., & Fawcett, B. C. 1977, MNRAS, 178, 605

Brown, G. V., Beiersdorfer, P., Liedahl, D. A., Widmann, K., & Kahn, S. M. 1998, ApJ, 502, 1015

Brown, G. V., Beiersdorfer, P., Liedahl, D. A., et al. 2002, ApJS, 140, 589

Collins, J. A., Shull, J. M., & Giroux, M. L. 2004, ApJ, 605, 216

den Herder, J. W., Brinkman, A. C., Kahn, S. M., et al. 2001, A&A, 365, L7

Detmers, R. G., Kaastra, J. S., Costantini, E., et al. 2010, A&A, 516, A61

Detmers, R. G., Kaastra, J. S., Steenbrugge, K. C., et al. 2011, A&A, 534, A38 (Paper III)

Edlén, B., & Löfstrand, B. 1970, J. Phys. B Atom. Mol. Phys., 3, 1380

Engström, L., & Litzén, U. 1995, J. Phys. B At. Mol. Phys., 28, 2565

Erickson, G. W. 1977, J. Phys. Chem. Ref. Data, 6, 831

Fawcett, B. C. 1970, J. Phys. B At. Mol. Phys., 3, 1152

Fawcett, B. C. 1971, J. Phys. B At. Mol. Phys., 4, 981

Fawcett, B. C., & Hayes, R. W. 1975, MNRAS, 170, 185

Flemberg, H. 1942, Ark. Mat. Astron. Fys., 28, 1

García, J., Mendoza, C., Bautista, M. A., et al. 2005, ApJS, 158, 68

Gu, M. F., Schmidt, M., Beiersdorfer, P., et al. 2005, ApJ, 627, 1066

Huchra, J., Latham, D. W., da Costa, L. N., Pellegrini, P. S., & Willmer, C. N. A. 1993, AJ, 105, 1637

Kaastra, J. S., Werner, N., Herder, J. W. A. D., et al. 2006, ApJ, 652, 189

Kaastra, J. S., Raassen, T., & de Vries, C. P. 2010, in The Energetic Cosmos: from Suzaku to ASTRO-H, 70

Kaastra, J. S., Petrucci, P.-O., Cappi, M., et al. 2011, A&A, 534, A36 (Paper I)

Kelly, R. L. 1987, Atomic and ionic spectrum lines below 2000 Angstroms. Hydrogen through Krypton (New York: AIP, ACS and NBS)

Kelly, R. L., & Palumbo, L. J. 1973, in Naval Research Lab., NLR reoprt 7599

Kraemer, S. B., Crenshaw, D. M., Yaqoob, T., et al. 2003, ApJ, 582, 125

Kriss, G. A., Green, R. F., Brotherton, M., et al. 2000, ApJ, 538, L17

Kriss, G. A., Arav, N., Kaastra, J. S., et al. 2011, A&A, 534, A41 (Paper VI)

Lodders, K. 2003, ApJ, 591, 1220

McGee, R. X., & Newton, L. M. 1986, Proc. Astron. Soc. Austr., 6, 358

Peacock, N. J., Speer, R. J., & Hobby, M. G. 1969, J. Phys. B At. Mol. Phys., 2, 798

Phillips, K. J. H., Mewe, R., Harra-Murnion, L. K., et al. 1999, A&AS, 138, 381

Pradhan, A. K., Chen, G. X., Delahaye, F., Nahar, S. N., & Oelgoetz, J. 2003, MNRAS, 341, 1268

Sako, M., Kahn, S. M., Branduardi-Raymont, G., et al. 2003, ApJ, 596, 114

Sant'Anna, M. M., Stolte, W. C., Öhrwall, G., et al. 2000, Advanced Light Source report, http://www.als.lbl.gov/als/compendium/AbstractManager/uploads/00029.pdf, 524, 1

Schmidt, M., Beiersdorfer, P., Chen, H., et al. 2004, ApJ, 604, 562

Sembach, K. R., Savage, B. D., & Hurwitz, M. 1999, ApJ, 524, 98

Sembach, K. R., Wakker, B. P., Savage, B. D., et al. 2003, ApJS, 146, 165

Steeghs, D., & Casares, J. 2002, ApJ, 568, 273

York, D. G., Songaila, A., Blades, J. C., et al. 1982, ApJ, 255, 467