Reducing Suzaku Data Using Xselect
Before class
- In order to handle Suzaku data, you will need to have the HEASARC Calibration Database (CALDB) setup on the machine you are using. Go to http://heasarc.gsfc.nasa.gov/docs/heasarc/caldb/caldb_intro.html
- Download and install the CALDB for the Suzaku mission. (Note: Step 2 in installation process - use 'export CALDB=/path/to/caldb' instead of 'setenv CALDB /path/to/caldb'.
Step 3 - download all Suzaku related files from caldb supported missions webpage.)
- Make sure that the lines 'export CALDB=/path/to/caldb' and 'source $CALDB/software/tools/caldbinit.sh' have been added to your '.bashrc' or '.bash_aliases' file in your home directory. (These steps were part of the CALDB installation instructions on their website)
- After CALDB is ready, download an observation from the Yoshino et al. (2009) paper by going to the suzaku database to search the Suzaku archive.
- Retrieve the data using the buttons on the webpage ("Create download script" or "Retrieve")
- Create a data directory within your suzaku directory and save the *.tar file there (it will be large ~2 GB).
- Unpack the *.tar file using 'tar -xvf (filename).tar'.
- Make sure SOAImage DS9 is installed on your machine. For Linux users: 'sudo apt-get install saods9'
will do the trick. For others, the website is http://ds9.si.edu/site/Home.html
- Section 5 of the ABC Guide is a good place to start before messing around with any of the downloaded data.
- Be sure to bring your laptop to class.
Reprocessing using xselect
- Make sure LHEASOFT is initialized (heainit).
- After downloading and unpacking the Suzaku data, a new directory with the ObsID number should have been created.
- Much of the following can be found in the XIS Data Analysis section of the Suzaku ABC Guide: http://heasarc.gsfc.nasa.gov/docs/suzaku/analysis/abc/node9.html
- In the directory of your chosen observation, reprocess the data using the command 'aepipeline'.
- Note: The output directory must not be a subdirectory of the input directory. Run aepipeline in the directory containing the hxd/, xis/, /auxil directories.
(Screencap example)
>aepipeline
>Input Directory[] ../502047010/
>Output Directory[] ../reprocessed/xis
>Stem for FITS input files [i.e. ae00000000000][ae502047010]
>Entry stage (1:2) [1]
>Exit stage (1:2) [2]
>Instrument (ALL,HXD,GSO,PIN,XIS,XIS0,XIS1,XIS2,XIS3)[XIS]
- A lengthy report should be output along with all reprocessed files. Typical time for reprocessing a single observation is about 10-15 minutes.
- Should see something like this at the end:
============================================================
Running SUZAKU AE pipeline
Task: aepipeline Version: 1.1.0 Release Date: 2011-04-01
Final return code = 0
Exit with no errors - Tue Aug 16 12:56:26 CDT 2016
Report written to : $PATH/reprocessed/xis/ae502047010_aepipeline_report.txt
Extracting products
- The primary tool for extracting data products (spectra, lightcurves, exposure maps) from XIS data is xselect, which is part of the general HEAsoft distribution. xselect can apply filters which select user-defined times, sky regions, or particular event flags. It then uses the filtered events to create a (binned) spectrum (as well as generating the necessary calibration files), a lightcurve, or an exposure map.
- Useful xselect guides for the following steps can be found here and here.
- Use 'xselect' to load events files, extract data, plot image, draw regions, extract spectra.
- xsel> read events "ae*xi1*3x3*cl.evt ae*xi1*5x5*cl.evt" (don't put in asterisks, use full filename)
- xsel> select mkf "SAA_HXD==0 && T_SAA_HXD>436 && ELV> 5 && DYE_ELV>20 && COR>8"
- xsel> select events "(STATUS<524287)&&(STATUS%(2**17)<2**16)"
- xsel> extract all
- xsel> plot image
# You may see a bright region at the center of the CCD or in other locations on the CCD.
# draw exlusion regions (250 arcsec in radius) around bright sources and save regions in ds9 format
- xsel> filter region excluded.reg
- xsel> extract spectrum
- xsel> save spec xis1_diffuse
# The data will be rebinned using xsl_suzaku_xis_rebinspec
- > Group ( or rebin ) the spectra before outputting? >[no]
Create RMF and ARF and Non X-ray Background
- Run the RMF generator for XIS (xisrmfgen)
- Run the ARF generator for XIS (see below)
xissimarfgen clobber=yes pointing=AUTO source_mode=UNIFORM source_rmin=0 source_rmax=20 num_region=1 region_mode=SKYREG num_photon=2000000 detmask=none estepfile=sparse
Instrument Name (XIS0,XIS1,XIS2,XIS3)[XIS1]
region file #1[exclude.reg] exclude.reg
output arf file #1[xis1_diffuse.arf] xis1_diffuse.arf
limit mode (ACCURACY,NUM_PHOTON)[MIXED]
calculation accuracy for each energy bin[0.005]
input PHA or EVENT file to get observation mode[xis1_diffuse.pha] xis1_diffuse.pha
input GTI file[xis1_diffuse.pha] xis1_diffuse.pha
input attitude file[ae502047010.att] ae502047010.att (replace number with you ObsID)
input rmf file[xis1_diffuse.rmf] xis1_diffuse.rmf
- Run the Non X-ray background generator to create a background file
xisnxbgen
output NXB file[nxb.pi]
input PHA or EVENT file to get observation mode[xis1_diffuse.pha]
region mode (DETFITS,SKYFITS,DETREG or SKYREG)[SKYREG]
region file for output NXB spectrum[exclude.reg]
input orbit file[ae502047010.orb]
input attitude file[ae502047010.att]
Rebin the Spectrum using GRPPHA
If you plot your spectrum at this point, you will notice it has many points with large error bars.
By grouping our spectrum into a fewer number of larger energy bins, we can improve our statistics without losing much resolution.
Here I show how to resize the energy bins such that each bin contains at least 50 counts.
- Run the GRRPHA start the rebinning (or regrouping) process
- To ensure 50 counts per bin, we simply set the minimum count requirement to 50.
- As an extra helpful step, let's put the location of the associated files in the header of the spectral file.
>chkey BACKFILE (filename of background file)
>chkey RESPFILE (filename of .rmf file you made)
>chkey ACNRFILE (filename of .arf file you made)
>exit
- Now you're all done and should be able to load you spectral file into XSPEC with no problem.
What you need to hand in
- Save a sample of the set of commands used in XSELECT.
- Record number of counts (or count rate) before and after removing bright sources in XSELECT.
- Save images before and after removing bright sources.
- Load your spectra (for both observations 502047010 and your own) into XSPEC and reproduce Figure 3, Table 3, and Table 5 of the paper (as you did for the first assignemnt). Make sure to record all final parameter values and their associated errors.
- Calculate the solid angle of the CCD area before and after removing bright sources (in steradians).
You will need this number to compare the normalizations in you spectral fitting to those in the paper.
- Use a FITS file viewer (fv) to examine some of the files you created. For example:
You don't need to submit anything for this step, but it will make future steps of the project much easier if you take a look at the contents of these files and understand what they are.