{'fraction_non_alphanumeric': 0.04388755437252483, 'fraction_numerical': 0.02872816983704473, 'mean_word_length': 4.306062693765071, 'pattern_counts': {'":': 2, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The XMM-Newton survey in the H-ATLAS field

Wide area X-ray and far infrared surveys are a fundamental tool to investigate the link between AGN growth and star formation, especially in the low-redshift universe (z<1). The Herschel Terahertz Large Area survey (H-ATLAS) has covered 550 deg^2 in five far-infrared and sub-mm bands, 16 deg^2 of which have been presented in the Science Demonstration Phase (SDP) catalogue. Here we introduce the XMM-Newton observations in H-ATLAS SDP area, covering 7.1 deg^2 with flux limits of 2e-15, 6e-15 and 9e-15 erg/s/cm^2 in the 0.5--2, 0.5--8 and 2--8 keV bands, respectively. We present the source detection and the catalogue, which includes 1700, 1582 and 814 sources detected by Emldetect in the 0.5--8, 0.5--2 and 2--8 keV bands, respectively; the number of unique sources is 1816. We extract spectra and derive fluxes from power-law fits for 398 sources with more than 40 counts in the 0.5--8 keV band. We compare the best-fit fluxes with the catalogue ones, obtained by assuming a common photon index of Gamma=1.7; we find no bulk difference between the fluxes, and a moderate dispersion of s=0.33 dex. Using wherever possible the fluxes from the spectral fits, we derive the 2--10 keV LogN-LogS, which is consistent with a Euclidean distribution. Finally, we release computer code for the tools developed for this project.


Introduction
Over more than one decade, there has been growing evidence for a coeval growth of galaxies and their central black holes (see review by Alexander & Hickox 2012). A tight correlation between the masses of the black hole and the galaxy bulge has been found (e.g. Ferrarese & Merritt 2000;Gebhardt et al. 2000;Zubovas & King 2012). Theoretical models suggest that feedback processes are at work to set the link (Di Matteo et al. 2005;Hopkins et al. 2006); some models also suggest a fundamental role of mergers in setting up AGN (Hopkins et al. 2008). Nuclear obscuration and intense star formation may characterize the initial phases of AGN activity (Silk & Rees 1998;Menci et al. 2008;Lamastra et al. 2013).
AGN growth seems to happen in two major modes: the radiative and the kinetic mode, the first operating close to the Eddington limit and with high radiation efficiency, the latter at lower rates (see review by Fabian 2012). Similarly, galaxies build their stellar mass either through starburst episodes (with star formation happening on short timescales), or through secular star formation. The growth of both AGN and galaxy should ultimately be driven by the supply of cold gas (Kauffmann & Heckman 2009;Mullaney et al. 2012a).
It has been suggested that the specific SFR (i.e., the SFR divided by the stellar mass of the galaxy) may also be involved in the AGN growth/star formation link, because a correlation was observed between AGN luminosity and specific SFR (Lutz et al. 2010); however the latter correlation seems to hold only for the most active systems at redshift z 1 (Mullaney et al. 2012b;Rovilos et al. 2012). Similar uncertainties shroud a possible correlation between AGN luminosity and nuclear obscuration (Georgakakis et al. 2006;Rovilos & Georgantopoulos 2007;Trichas et al. 2009;Rovilos et al. 2012) and the effectiveness of colour-magnitude diagrams to inspect the evolutionary status of the host galaxies of AGN Cardamone et al. 2010;Pierce et al. 2010).
The situation in the local universe is mostly unclear, as the aforementioned studies were based on deep, pencil-  (Eales et al. 2010), covering ∼ 550 deg 2 with both the SPIRE and PACS instruments in five far-infrared and sub-mm bands (100,160,250,350 and 500 µm). The 250 µm source catalogue of the Science Demonstration Phase (SDP) is presented in Rigby et al. (2011), covering a contiguous area of ∼ 16 deg 2 which lies within one of the regions observed by the Galaxy And Mass Assembly (GAMA) survey (Driver et al. 2009;Baldry et al. 2010).
In this paper, we present XMM-ATLAS i.e. the XMM-Newton observations and source catalogue in the H-ATLAS area. XMM-Newton observed 7.1 deg 2 within the H-ATLAS SDP area, making the XMM-ATLAS one of the largest contiguous areas of the sky with both XMM-Newton and Herschel coverage.
The only other wide X-ray survey with size and Herschel coverage comparable to XMM-ATLAS is the 11 deg 2 XMM-LSS (Pierre et al. 2004;Chiappetti et al. 2013) which was observed with SPIRE and PACS by the HerMES project (Oliver et al. 2012). The Stripe-82 survey covered 10.5 deg 2 with XMM-Newton 1 (LaMassa et al. 2013), though the pointings are not contiguous and it only has SPIRE coverage (Viero et al. 2014). The 2 deg 2 COSMOS survey, observed by both XMM-Newton (Cappelluti et al. 2009) and Chandra (Elvis et al. 2009;Civano 2013), was also covered by HerMES with SPIRE only (Oliver et al. 2012).
For the bright sources in the XMM-ATLAS catalogue, we extract spectra and derive fluxes from the spectral fits. The latter fluxes are used to build the Log N -Log S, thus removing as much as possible any bias which might come from using a single count-rate-to-flux conversion factor as done for the catalogue.
In Sect. 2, we describe the observations and data reduction; in Sect. 3, we illustrate the source detection; in Sect. 4 we present the source catalogue in the 0.5-2, 0.5-8 and 2-8 keV bands; in Sect. 5 we derive spectra for the bright sources and compare the fluxes from the spectral fits with those from the catalogue; in Sect. 6 we compute the Log N -Log S using, where available, the fluxes from the spectral fits. Finally, in Sect. 7 we present our conclusions.

Observations and data reduction
The XMM-ATLAS field is centred at 9h 4m 30.0s +0d 34m 0s, and covers 7.101 deg 2 , with a total exposure time of 336 ks (in the MOS1 camera). The observations were performed in mosaic mode, i.e. shifting the pointing by 15 ′ every ∼ 10 ks. A total of 93 pointings were done, divided in 3 obsids of 31 pointings each.
The SAS (version 13.0) tools emproc and epproc were used to produce a single event file per obsid per camera. Such an event file can be directly used to obtain images and exposure maps of the part of the mosaic covered in the obsid. However, the file needs to splitted in order to produce images and exposure maps of individual pointings (see Sect. 3.4).
We extracted lightcurves in the 10-13 keV interval with a 100 s bin size to check for high-background periods, which were identified and removed by doing a 3σ-clipping of the lightcurve, as done in Ranalli et al. (2013, hereafter R13) for the XMM-CDFS. After cleaning, the total exposure is 293 ks (MOS1).
The obsid, dates and exposure times before and after the high-background cleaning, are listed in Table 1; note that these times refer to the mosaic-mode obsid. The average exposure time for any location in the final mosaic is 3.0 ks (in the 0.5-8 keV band and after the high-background cleaning); the maximum exposure is 11 ks. A histogram of the exposure times is shown in Fig. 1.
To check if astrometric corrections were needed, we performed an initial source detection run with the SAS ewavelet program (with a 5σ threshold) on the PN data of each of the three obsids, and cross-correlated the resulting lists with the sample of QSO from the Sloan Digital Sky Survey (SDSS DR7; Schneider et al. 2010). The search radius was 15 ′′ , and most matches were found within 5 ′′ . We found that obsid 0725290101 (for which 26 matches were found) needed no correction; obsid 0725300101 (35 matches) had a shift of 0.58 ′′ and obsid 0725310101 (39 matches) of 1.14 ′′ . Event and attitude files were corrected (see Table1) before proceeding further. Images for the MOS1, MOS2 and PN cameras were accumulated for each obsid and for each of the 0.5-2, 2-8 and 0.5-8 keV bands with a pixel size of 4 ′′ and summed together. Some energy intervals corresponding to known instrumental spectral lines (Kuntz & Snowden 2008, see also R13) were excluded: 1.39-1.55 keV (Al); 1.69-1.80 keV (Si, MOS only); 7.35-7.60 and 7.84-8.28 keV (Cu complex 2 , PN only). Images of the entire mosaic were obtained by summing the images and exposure maps from the three obsids; those relative to the 0.5-8 keV band are shown in Fig. 2.

Source detection
Sources were detected with a two-stage process, with a first pass at low significance to get a list of candidate detec-tions, and a second pass to rise the significance threshold and derive accurate source parameters. Between the two passes, and because the second pass needs an input catalogue, we identify the sources detected in more than one band. The detection method is based on the one used by Cappelluti et al. (2009) and R13, which is a variant on the standard XMM-Newton detection procedure, adapted to the much larger area of XMM-ATLAS.

First detection pass
In the first pass, the SAS wavelet detection program ewavelet was run separately on each of the 0.5-2, 2-8 and 0.5-8 keV images of the entire mosaic, with a significance threshold of 4σ and the default wavelet scales (minimum 2 pixels, maximum 8 pixels, with a pixel size of 4 ′′ ).

Matching sources detected in more than one band
Sources detected in more than one band were identified with the likelihood ratio (LR) technique. Given a distance r between two candidate counterparts, normalised by the uncertainty on the position, LR(r) is defined as the ratio between the probability of having a real counterpart at r over the probability of having a spurious counterpart at r Article number, page 3 of 10 A&A proofs: manuscript no. atlas (Pineau et al. 2011) 3 . Similarly, the association reliability is defined as the probability P (H true |r) of the association being true (H true ) conditioned on r (the relationship between LR and reliability is explicited in Pineau et al. 2011, eq. 11 and Appendix C).
While the LR is usually applied to search for counterparts in independent bands (e.g., optical counterparts of X-ray sources), here the bands are not independent (we compare the 0.5-8 keV list to the 2-8 keV one; and the 0.5-8 keV list to the 0.5-2 keV one). In this setting, and taking the latter case as an example, we are testing if the position of the source in both bands is close enough (within errors) to declare that they are the same source, against the possibility that the source of the additional 2-8 keV photons is significantly different from that of the 0.5-2 keV photons. In a shallow survey such as XMM-ATLAS, the main advantage in using the LR method over a nearest-neighbour match is that LR gives a likelihood for the match, which may help in follow-up studies, e.g. when searching for optical counterparts.
The match candidates were selected on the basis of their positional errors; the probability of association (items 24 and 25 in the list in Sect. 4) was calibrated by estimating a spurious LR histogram. Source IDs were assigned at this stage; matched sources were assigned a single ID and considered as a single sources from here onwards.

Second detection pass, general settings
In the second pass, we used the SAS EMLDetect program to validate the detection, refine the coordinates and obtain maximum-likelihood estimates of the source counts, count rates and fluxes.
EMLDetect is at its core a PSF fitting code. Originally developed for ROSAT (Cruddace et al. 1988;Hasinger et al. 1993), its current version 4 has been improved and optimized for XMM-Newton. In particular, we mention the ability to operate on several individual, overlapping pointings at the same time, and properly account for variations in PSF shape and in vignetting (as the telescope is moved between pointings, a source may be present in more than one pointing, but may fall on different detector coordinates). Rather than working on a single image containing the entire mosaic (like ewavelet), EMLDetect runs on images of individual pointings (see Sect. 3.4).
Although EMLDetect can run on different energy bands at the same time, we did not use this feature, because of the large number of pointings and of EMLDetect limitations (see below), but rather we ran it three times, one per each band. The bands are the same as for ewavelet. In all runs, we used the same input list of sources, made of all matched sources and all unmatched sources, regardless of the bands in which they were detected in the first pass.
The EMLDetect minimum likelihood was set at L = 4.6, as in R13, which corresponds to a false-detection probability of 1.01 × 10 −2 . Together with the 4σ threshold for ewavelet, for the final catalogue this yields a joint significance between 4σ and 5σ, but which cannot be further con- 3 Pineau et al. (2011) also developed an Aladin plugin, which we used for this paper, available at saada.u-strasbg.fr/docs/fxp/plugin/ 4 The XMM SAS reference manual for EMLDetect; xmm.esac.esa.int/sas/13.0.0/doc/emldetect/node3.html strained without simulations (see discussion in R13, where a joint significance of 4.8σ was estimated; however this number should not be immediately applied to XMM-ATLAS because of the different statistical properties of the background, due to the different depth of this survey vs. the XMM-CDFS).
The 8 keV upper threshold was chosen to improve the signal/noise ratio of detections. While quantities such as counts, rates and fluxes are quoted in the catalogue for the 0.5-8 and 2-8 keV bands, fluxes in the 0.5-10 and 2-10 keV bands can be immediately obtained by assuming the same Γ = 1.7 model spectrum, which yields the following conversion factors for fluxes F : F (0.5 − 10)/F (0.5 − 8) = 1.13 and F (2 − 10)/F (2 − 8) = 1.20.
All EMLDetect parameters, except for what mentioned above (coordinate fitting 5 , likelihood threshold, energy bands and conversion factors) were left at their default values. The inputs to EMLDetect are images, exposure maps (see Sect. 3.4), background maps (see Sect. 3.5) and the list of candidate sources from Sect. 3.2.

Splitting a mosaic in individual pointings
To use EMLDetect, we had to split each mosaic-mode obsid event file into the individual pointings; for this purpose we used the SAS tool emosaic_prep. This tool did not set the RA_PNT and DEC_PNT keywords in the individual pointings, which were needed for further processing; however, the coordinates were obtained by inspecting the attitude files.
Images and exposure maps were extracted from each pointing's event file in the same bands used for ewavelet. The SAS task eexpmap was used to compute the exposure maps; they are in units of s, and include corrections for vignetting and bad pixels. Non-vignetted exposure maps were also computed, to be used when producing background maps (Sect. 3.5).
Since the PSF shapes and vignetting are very similar among the three XMM-Newton EPIC cameras, for each pointing we summed together the images from MOS1, MOS2 and PN; then we did the same for the exposure and background maps (see below).

Background maps
Background maps for the individual pointings were obtained with the same method used by the XMM-COSMOS team (Cappelluti et al. 2009). All input sources were excised from the pointing images, producing so-called "cheese images", in a number of one per pointing per energy band. A model made of a flat (i.e. non-vignetted, but including chip gaps and dead pixels) and a vignetted component (representing the particle and cosmic backgrounds, respectively) was fit to the cheese images to obtain the background maps.

Running EMLDetect on a wide mosaic
EMLDetect can detect sources on a limited number of overlapping pointings; however, the number of individual pointings in XMM-ATLAS is too large to be analysed together. Therefore, we divided the ATLAS field in a grid. For each cell in the grid (for example, the rectangle in Fig. 3), we identified the pointings whose FOV intersected the cell (filled circles in Fig. 3), and ran EMLDetect on them together. In this way, the number of pointings was within the limit allowed by EMLDetect. From the resulting detection list, we only kept the sources whose coordinates fell into the cell. We checked that no source appears twice, or was lost, by searching for source pairs within 3 ′′ from the cracks. We repeated this procedure for each of the 0.5-8, 0.5-2, and 2-8 keV bands. The final catalogue is the union of the detections from all cells. This approach is similar to the one adopted by LaMassa et al. (2013).
The programme which runs EMLDetect in the cells, griddetect, is available (see Appendix A).

Inspection of close groups
Very close groups of sources with separation much shorter than the PSF width may arise in particular conditions because EMLDetect is fitting the source positions and the detection runs are done separately for the three energy bands. For example, let A and B be two sources from the input catalogue which are present in the same EMLDetect detection cell 6 . If at the input location of A there are not enough counts for a significant detection by EMLDetect, the programme may try and fit the coordinates until incorrectly assigning them to B's position; this will then prevent B from getting a detection at the same position and in the same band. This might happen in one energy band but not in another, depending on the details of the two sources (e.g., input coordinates, location of the photons, hardness ratio). Therefore, the same EMLDetect coordinates would be shared by sources A and B, while their ewavelet coordinates would still be different.
In order to screen and correct for this effect, we have looked for close groups of sources whose EMLDetect coordinates were closer than their 5σ error. We identified 27 groups containing 47 sources in total, and visually inspected all of them. For 22 groups, we shuffled the source ids to have the EMLDetect positions match the ewavelet ones. Five groups looked like genuine different sources in crowded areas.

Systematic error on astrometry
To find whether there is any residual systematic error in the XMM-ATLAS astrometry, we cross-correlated the final catalogue with the SDSS QSOs (DR7; Schneider et al. 2010). We found a bulk shift of 0.83 ′′ in RA and −0.29 ′′ in DEC (XMM-ATLAS coordinate minus SDSS coordinate; root mean square deviation = 2.1 ′′ ). We subtracted the above values from the XMM-ATLAS coordinates ("RA" and "DEC" columns only, see next Sect.), which should therefore not present any further shift.
In addition, we list a number of 175, 103 and 47 sources detected in the above bands by ewavelet but not confirmed by EMLDetect; in the following we refer to them as supplementary sources. The number of unique supplementary sources is 234.
All coordinates are in the J2000 reference system. The RA and DEC columns are registered to the reference frame of the SDSS-DR7 QSOs (Schneider et al. 2010). All other coordinate columns are not registered and present a shift; see Sect. 3.8.
The catalogues are available in electronic form from the Centre de Donneés Astronomiques de Strasbourg (CDS), and from the XMM-ATLAS website 7 , where we will publish updates should they become available.
The column description is as follows; the symbols (ML) and (W) mark whether the column was derived from running EMLDetect or ewavelet, respectively.

Spectra
To investigate the effects of the assumption of a single model spectrum (power-law with Γ = 1.7, see Sect. 3), we extracted spectra for 555 sources with more than 40 counts in the 0.5-8 keV band 10 . The extraction regions are circles, whose radii were chosen by maximizing the signal/noise ratio for each source. The background regions are annuli, of inner and outer radii equal to 1.5 and 2 times the circle radius, respectively. In the case of close sources, the overlapping area was excised from the source and background regions. The programme which defines the regions, autoregions, is available (see Appendix A).
Spectra were extracted using the cdfs-extract tool (see Appendix A), which takes care of identifying the available combinations of event files and source regions. cdfs-extract is a wrapper around the SAS tools evselect, rmfgen and arfgen to extract spectra and compute the response and ancillary matrices. The MOS and PN spectra were then summed and the response matrices averaged using the FTOOLs mathpha, addrmf and addarf.
The spectra were automatically analysed with the same method and software (automatic XSPEC fits of unbinned spectra using C-statistic) used for the 3XMM-DR4 sources (Corral et al. 2014). A simple power-law model was fit to the data and used to derive the fluxes in the 0.5-10 and 2-10 keV bands. The fit was successful for 446 sources 11 The mean Γ is 1.7 ± 0.6, consistently with the model assumed in Sect. 4. The histogram of best-fit slopes is shown in Fig. 5. The presence of a number of flat-and inverted-spectra objects can be noticed; e.g., there are 56 sources (13% of 446) with Γ ≤ 1.0.
The comparison between the 0.5-10 keV fluxes from the spectral fits and from the catalogue (the latter ones converted from 0.5-8 to 0.5-10 keV) is shown in Fig. 6. The distribution of the points around the 1-to-1 line is somewhat asymmetrical for EMLDetect fluxes 7 × 10 −14 erg s −1 cm −2 , with a larger dispersion above the line than below; this is likely due to the combination of the distribution of spectral slopes with the XMM-Newton effective area.
A linear fit to the logarithms of fluxes shown in Fig. 6, obtained by imposing a slope of 1, yielded a normalisation: corresponding to the fluxes from spectral fits being on average (9 ± 4)% brighter than those from the catalogue. A dispersion s = 0.31 may be given as the estimate of the standard deviation: where ν = 1 is the number of free parameters and N is the number of data points, F spec is the flux from the spectral fit and F cat that from the catalogue.

LogN-LogS
The sky coverage (sky area as function of flux) for the XMM-ATLAS survey in the 2-8 keV band was derived with  the SAS esensmap programme, which creates a sensitivity map by computing count rate upper limits for each pixel. The exposure and background maps described in Sect. 3 were used as input. The coverage was then converted to the 2-10 keV band (Fig. 7). We compute the differential counts by binning the sources according to their fluxes: where S is the central flux of the bin; ∆S is the bin width; and for each source i, A i is the coverage at the source's flux. The sum is performed on all sources with flux S i ∈ [S−∆S/2, S+∆S/2]. The error on the counts in any bin can be computed by assuming gaussianity or, for bins with less than 50 sources, with the Gehrels (1986) approximation.
In Fig. 8 we show the 2-10 keV differential Log N -Log S of the ATLAS sources detected in the 2-8 keV band. Two estimates are shown, from two different sets of fluxes: 1. "spectral Log N -Log S": fluxes from the spectral fits (Sect. 5) for 387 sources with hard detection, spectrum, and best-fit flux larger than 10 −14 erg s −1 cm −2 (the threshold chosen for the faintest bin); plus fluxes from the catalogue (converted to the 2-10 keV band) for the remaining sources (i.e. those without spectra or without a successful fit); 2. "catalogue Log N -Log S": fluxes from the catalogue for all the 814 hard sources (also converted to the 2-10 keV band).
It can be noticed that the spectral Log N -Log S extends to brighter fluxes than the catalogue one, by a factor 2, which is consistent with the use for a few sources of a Γ flatter than 1.7.
For comparison, we also plot in Fig. 8 the best-fit model from Georgakakis et al. (2008), which was derived from a joint analysis of several surveys, some of which are much deeper than XMM-ATLAS. The model has a broken powerlaw shape, with a break flux at 1.2 × 10 −14 erg s −1 cm −2 , very close the XMM-ATLAS flux limit (at 1.3 × 10 −14 erg s −1 cm −2 the coverage is 5.3% of the nominal area, and becomes ill-defined at fainter fluxes). Consistently, the XMM-ATLAS Log N -Log S does not show such a break.
A linear fit (weighted least squares) to the spectral Log N -Log S yielded Log N = (−2.47 ± 0.05)Log S − 18.0 ± 0.7 (errors at 1σ), consistent within errors with Georgakakis et al. (2008) and with a Euclidean distribution. A fit to the catalogue Log N -Log S yielded Log N = (−2.37 ± 0.08)Log S − 20.09 ± 1.03, which is only consistent with Euclidean counts at a 2σ level.
We derived the catalogues with a two-step procedure. First, the ewavelet SAS task was used to identify candidate sources with a significance equivalent to 4σ, and to find their coordinates. Next, we used the SAS EMLDetect tool to further check the significance of the sources, and obtain counts, count rates and fluxes. The final catalogues contain 1700, 1582 and 814 sources in the 0.5-2, 0.5-8 and 2-8 keV bands, respectively, with a total of 1816 unique sources. A list of supplementary sources, detected by ewavelet but not confirmed by EMLDetect, is also provided.
To investigate the effect of assuming a common spectral model for all sources to convert count rates to fluxes, we extracted spectra for each source with at least 40 counts and fitted them with a power-law model. We found that on average, the fluxes from the spectral fits are (9 ± 4)% brighter than those from assuming a common power-law photon index of Γ = 1.7. Also, the average best-fit spectral slope is Γ = 1.7 ± 0.6.
We derived the 2-10 keV differential Log N -Log S for the XMM-ATLAS sources, which spans the 10 −14 -10 −12 erg s −1 cm −2 flux interval. Using the fluxes from the spectral fits (for sources with spectra; and fluxes from the catalogue for all other sources) produces a Log N -Log S which is less noisy and more consistent with Euclidean counts than using fluxes from the catalogue. A weighted linear fit yielded Log N = (−2.47 ± 0.05)Log S − 18.0 ± 0.7 (errors at 1σ); this is consistent within errors with previous studies, e.g. Georgakakis et al. (2008).
Finally, we release the software tools which have been developed or enhanced to accomplish the analysis in this paper: griddetect, a programme to run EMLDetect over a very wide mosaic; autoregions, to define extraction regions for spectra and aperture photometry; and cdfs-extract, to extract spectra for multiple sources from multiple observations. Appendix A: Released software For the software described below, more information and instructions for use can be found on the author's website 12 and source repository 13 . 12 members.noa.gr/piero.ranalli 13 github.com/piero-ranalli cdfs-extract and autoregions Given a number of event files and a list of source and background positions, the cdfs-extract programme checks if the source and background are in the field of view of any observation, and it extracts products accordingly. The observations may or may not overlap.
The extracted products are spectra (source and background) and responses (source and, optionally, background RMFs and ARFs), or aperture photometry, or lightcurves.
The programme takes as input two text files, containing: a list of event files, exposure maps and (optional) images; a list of source and background positions and radii (the camera may optionally be specified, allowing the same source to have different positions/radii for different cameras).
Spectra and responses can be summed if the user wants, producing a single spectral file for each source and each camera.
The list of source and background positions can be either be manually written, or automatically produced by autoregions. If the sources are not too close to each other and the background has no large variations on scales 20-30 ′′ then annuli can be used as background regions and their positions and radii can be automatically generated (i.e., the user is dealing with a shallow survey such as XMM-ATLAS, XXL or XMM-COSMOS; conversely, deep surveys such as the XMM-CDFS feature close groups of sources and complex spatial patterns in the background which make automatic procedures unreliable).
Given a catalogue of sources, stored in a database (e.g.: PostgreSQL) and containing source counts and background surface brightnesses (i.e., the EMLDetect output), the autoregions programme computes extraction regions by maximizing the expected signal/noise ratio. Overlapping regions are identified, and where possible, the overlapping areas are excised.
Besides this work, the programmes described above have been, or are being used, in several papers, e.g. the obscured AGN in XMM-COSMOS (Lanzuisi et al. 2015), the XMM-CDFS spectral survey (Comastri et al., in prep.), the XXL brightest AGN spectral survey (Fotopoulou et al., in prep.).
Both cdfs-extract and autoregions are written in (modern-style) Perl using the Perl Data Language (PDL) libraries, and are free software released under the terms of the GNU Affero GPL license 14 .
griddetect and associated libraries The motivation for griddetect, and how it works, have already been described in Sect. 3.6 (see also Fig. 3).
Here we also mention that the XMM-Newton SAS provides a tool (emosaicproc), whose functionality is partly duplicated by griddetect. The main difference between the tools may be summarized as follows: emosaicproc automatically computes the grid, and requires less data preparation by the user if a single mosaic-mode obsid is to be processed, but only works on a single obsid; griddetect needs the user to define the grid cracks, but it is easier to add pointings from different obsids, and it can also compute background maps.
griddetect works on individual pointings, splitted from mosaic-mode event files; it also computes background maps according to the Cappelluti et al. (2009) method. The input comprises: the grid specification: a rotation angle, and the x and y coordinates (rotated RA and DEC) of the grid lines; the list of pointings with their coordinates. The output is a series of two catalogues per detection cell: one containing the detected sources, and another one containing only the sources within 3 ′′ from the cracks (used to check if there are missing or repeated sources, arising because of numeric effects placing them alternatively on the two sides of the crack).
Together with griddetect, we also release a set of associated libraries which may be of more general purpose: XMMSAS::Extract and XMMSAS::Detect. These are objectoriented Perl packages which present a high-level interface to some SAS and FTOOLS commands. They can be called by Perl programmes to filter event files and extract images and exposure maps using either pre-defined filters (e.g., the instrumental lines excluded in Sect. 2) or user-defined ones; and to compute background maps, source masks and call EMLDetect.
griddetect and its associated libraries are written in (modern-style) Perl using the Moose object system and the Perl Data Language (PDL) libraries, and are free software released under the terms of the GNU Affero GPL license.