For each individual chip (MOS) or quadrant (pn) the mosspectra or pnspectra routine extracts the spectra from both the user specified region of interest (which may be the full FOV) and the corner, and does so for both the observation and the FWC data. These four spectra, extracted from each chip, are required to construct the QPB spectrum of the region of interest; that construction is done by mosback and pnback.
It should be noted that mosspectra and pnspectra extracts spectra and, if the withimages parameter set, images as well. The energy band parameters, elow and ehigh, specify the energy band of the images; in all cases the spectra are extracted for the entire XMM-Newton band.
There are several different layers of event filtering done within mosspectra and pnspectra. First, the PATTERN=12 and ((FLAG & 0x766aa000) == 0) filters are applied for the MOS, and the PATTERN filter (user selected to be either 0 or =4) and ((FLAG & 0xcfa0000) == 0) filter is applied for the pn. Second, the user specified energy selection is applied for images. Third, if the P-bkgregBdet.fits file exists, events in the point source regions are excluded. Finally, if the file indicated by the region parameter exists, the events are further filtered by region. Of course, all of these selections are done simultaneously, with a rather complex selection expression. If the file indicated by the region parameter does not exist, or is empty, then the spectrum and images will be extracted from the entire FOV.
The calls to mosspectra and pnspectra can be simple, relying on default file names, for example:
elow=350 ehigh=1100 ccds="T T T F F F T"
or the input/output file names can be more expressly specified:
elow=350 ehigh=1100 ccds="T T T F T F T"
For the pn
elow=350 ehigh=1100 quads="T T T T"
In these rather lengthy calls, quite a few input parameters can be ignored if the user is willing to accept the default names for the output files. As a result, we can divide the parameters into required parameters and more cosmetic ones. The essential input parameters are the event file name (in the case of the pn, the OOT event file name as well), the ccds to be included, and the flags for source removal, withsrcrem, region specification, withregion, and image production withimages. For source removal one needs to specify the .fits format source region file maskdet=P-bkregtdet.fits and masksky=P-bkregtsky.fits. For region specification one needs to specify the regionfile parameter. For image construction one needs to specify the energy limits for those images, elow and ehigh.
In these calls, region=regm1.txt is an ascii file containing region descriptors in detector coordinates for the region of interest. The format of the region descriptor files is discussed below. If the selection is to exclude point sources then cheese or an equivalent must have previously been run.
One must specify which CCDs (for MOS) or quadrants (for pn) are to be included, as a string of booleans; “T” for including a CCD or quadrant, and “F” to excluding a CCD or quadrant. (Note that this is a change from previous versions of ESAS.) Be sure to mark as excluded chips that are in an anomalous state or chips that are not operating, such as MOS1 CCD#6 after it was lost to a micrometeorite strike. It is necessary to exclude CCD#1 if it is in small window or timing modes. It is also necessary to exclude chips with no valid events.
For the pn the pixel pattern can be set, pattern=0 will select single pixel events while pattern<=4 will select both single and double pixel events. As discussed above, both of these choices have their advantages, and one may want to extract both spectra for some types of analysis. One could set the pixel pattern for the MOS, but it must be set to 12 for the current version of ESAS.
One can also specify the names of many of the output files, cornerfile, imagefile, expmap, spmask, specfile, rmffile, and arffile, but that is not necessary.
It should be noted that both espfilt and mosspectra/pnspectra extract the event list for the corner data. We strongly suggest that the P-corevc.fits file produce by espfilt be removed from the working directory before running mosspectra/pnspectra because we need the filtering of the corner data to be consistent between the current observation and an existing database of corner data. We can't guarantee that the espfilt filtering in future versions will remain consistent as that routine has different needs.
The output of each run of mosspectra is the following lists of files. The first list contains files created with withimage=no:
The output files listed above are for the entire energy range (spectroscopic files) or for the 0.3-8.0 keV range (imaging files). These files are always produced for the same energy ranges no matter what the specified elow and ehigh. This second list contains output images that are created when mosspectra or pnspectra are run in imaging mode (withimages=yes, elow!=0 and/or ehigh!=0):