INSTRUCTIONS FOR XTE PCA DATA REDUCTION _______________________________________ These instructions show how to make lightucrves, spectra and responses for weak sources observed by RXTE, for Standard2 data, Layer 1 of each PCU only (combined Left and Right sides). The instructions work for ftools v5.1 (anything else is not guaranteed as of 12/31/01) The instructions are illustrated with a complete example of data reduction for NGC 4593 (observed Sep 01). Prepare the Data ________________ 1. Make working directories, e.g. * mkdir /home/yaqoob/xte/ngc4593 and mkdir /home/yaqoob/xte/ngc4593/analysis 2. Get the `production' .tar files and put them into /home/yaqoob/xte/ngc4593/P60134-03-01 where the last dir name is taken from the rootnames of the .tar files. For NGC 4593, they are: 60134-03-01-000.tar.gz 60134-03-01-00.tar.gz 60134-03-01-01.tar.gz 60134-03-01-02.tar.gz 60134-03-01-03.tar.gz 60134-03-01-04.tar.gz 60134-03-01-05.tar.gz 60134-03-01-06.tar.gz 60134-03-01-07.tar.gz 60134-03-01-08.tar.gz 60134-03-01-09.tar.gz 60134-03-01-10.tar.gz 60134-03-01-11.tar.gz NOTE: If it is archival data simply get it from the HEASARC archives. If it is not then get it from legacy.gsfc.nasa.gov:/xte/data/archive/PGPData by anonymous ftp. The files will have names of the form 60134-03-01-00.tar.pgp After downloading decrypt the files at the unix prompt (one by one) by >pgp keycode Get the keycode from the email that came with the data (note that it may not look like the key code appears on the screen when you cut and paste). * Now gunzip all the files and untar each files using tar -xvf * Now delete all .tar files with `rm -fr *.tar' You should now end up with just a new directory called /home/yaqoob/xte/ngc4593/P60134-03-01/P60134 * Go into the above directory. In here you should have a directory for each obsid. In this case: drwx------ 16 yaqoob users 4096 Jul 12 17:03 60134-03-01-00 drwx------ 16 yaqoob users 4096 Jul 12 17:04 60134-03-01-000 drwx------ 16 yaqoob users 4096 Jul 12 17:08 60134-03-01-01 drwx------ 16 yaqoob users 4096 Jul 13 12:53 60134-03-01-02 drwx------ 16 yaqoob users 4096 Jul 13 12:54 60134-03-01-03 drwx------ 16 yaqoob users 4096 Jul 13 12:55 60134-03-01-04 drwx------ 16 yaqoob users 4096 Jul 13 12:56 60134-03-01-05 drwx------ 16 yaqoob users 4096 Jul 12 17:11 60134-03-01-06 drwx------ 16 yaqoob users 4096 Jul 12 17:13 60134-03-01-07 drwx------ 16 yaqoob users 4096 Jul 12 17:15 60134-03-01-08 drwx------ 16 yaqoob users 4096 Jul 12 17:15 60134-03-01-09 drwx------ 16 yaqoob users 4096 Jul 12 17:16 60134-03-01-10 drwx------ 16 yaqoob users 4096 Jul 13 12:57 60134-03-01-11 Now you need to set up a master index file (FMI) as follows. * Copy an FMI from any of the above directories into /home/yaqoob/xte/ngc4593/P60134-03-01/P60134 i.e. * cp 60134-03-01-00/FMI . (assuming you are in /home/yaqoob/xte/ngc4593/P60134-03-01/P60134) Now do * recofmi overwrite=yes . 3. Go into /home/yaqoob/xte/ngc4593/ and Download by ftp from legacy.gsfc.nasa.gov the following -auxilliary data files: xte/software/rex/aux.tar -latest SAA history file: xte/calib_data/pca_bkgd/pca_saa_history.gz -Background model files for `FAINT' mode of background subtraction: xte/calib_data/pca_bkgd/Faint do: * ftp>bin * ftp>prompt * ftp>mget *.mdl Exit ftp and you should be in /home/yaqoob/xte/ngc4593/ Untar aux.tar as follows: * tar -xvf aux.tar This will create a directory /home/yaqoob/xte/ngc4593/aux with a bunch of files in it. * gunzip the pca_saa_history and mv it into /home/yaqoob/xte/ngc4593/aux (overwrite the one already in /home/yaqoob/xte/ngc4593/aux; this way we make sure we have the latest SAA history file). mv all the .mdl files into aux/ * mv *.mdl aux/ 4. Set up the correct background model. XTE time is divided into four epochs, epoch 1 to epoch 5: (see also http://heasarc.gsfc.nasa.gov/docs/xte/pca_news.html#backsub) Epoch 1 - Beginning of mission through 3/21/96 18:33 Epoch 2 - 3/21/96 18:34 through 4/15/96 23:05 Epoch 3 - 4/15/96 23:06 through 3/22/99 17:38 Epoch 4 - 3/22/99 17:39 through 5/13/00 00:00 Epoch 5 - 5/13/00 00:00 and following... We select background model (*.mdl) files according to the epoch of the observation. **NOTE A BACKGROUND MODEL DOES NOT EXIST FOR EPOCH5** **WE MUST USE FILES FOR EPOCH 4, WHICH DO NOT WORK FOR PCU0 ** **IN EPOCH 5. For epoch 5 data don't use PCU0 for the moment (as of 12/31/01). Establish the epoch of your data. For NGC 4593 it is epoch 5. Find the files in the aux directory: * ls *e4*.mdl gives pca_bkgd_faint240_e4v19991214.mdl pca_bkgd_faintl7_e4v19991214.mdl For epoch 1 you would do ls *e1*.mdl etc. Go into the aux directory * cd aux * Edit the model.files in there and change the two file names to correspond to point to the above two .mdl files: more model.files: aux/pca_bkgd_faint240_e4v19991214.mdl aux/pca_bkgd_faintl7_e4v19991214.mdl 5. Make Lightcurves and Spectra for Each PCU. **THESE INSTRUCTIONS EXCTRACT LAYER 1 FOR EACH PCU ONLY, **WITH LEFT AND RIGHT SIDE COMBINED. From step 5 we are going to treat each PCU separately. Therefore Steps 5 to XXX are to be repeated for each PCU that we want to extract lightcurves and spectra for. In this example we'll do PCU1. Go into the aux dir and edit expression.txt to read: ELV > 10.0 && OFFSET < 0.02 && PCU1_ON == 1 && ELECTRON2 < 0.1 && (TIME_SINCE_SAA < 0 || TIME_SINCE_SAA > 30) (DELETE ALL PARTS OF THE EXPRESSION REFERRING TO OTHER PCUs). For different PCUs just change the PCU1_ON == 1 bit. In the aux dir now edit layer1.cols to read: X1LSpecPcu1 X1RSpecPcu1 DELETE ALL OTHER LINES REFERRING TO OTHER PCUs. For different PCUs simply change the last digit of each line appropriately. 6. Now go into * /home/yaqoob/xte/ngc4593/ * From here simply type rex at the command line and enter the following answers to the prompts: Path to proposal level directory containing FMI: /home/yaqoob/xte/ngc4593/P60134-03-01/P60134 Target [all]:all Printmode, l (ligh curve), s (spectra) [both]:both Channels for light curve extraction [0-27]: 3-27 Layers to be extracted (1,2,3, or all) [1]:1 Root name for products []: n4593_31dec01p1 When this is finished you end up with the following files: n4593_31dec01p1_layer1_ch3-27_bkg.lc :model background light curve n4593_31dec01p1_layer1_ch3-27.lc :source+bgd light curve n4593_31dec01p1_layer1_ch3-27_net.lc :background-subtracted light curve n4593_31dec01p1_layer1_bkg.pha :model background spectrum n4593_31dec01p1_layer1.pha :source+background spectrum * Examine the light curves with fplot. If you see any funny business (e.g. flares etc.) make a qdp (ascii) file of the data by typing `wenv filename' (without .qdp extenstion) and then examine filename.qdp to find out the times of the flare(s). Then go back to the aux/expression.txt file and incorporate a time filter and then re-run rex (i.e. all of step 6) to re-extract light curves and spectra. Check the light curves again. 7. Move these five output files out of the way into /home/yaqoob/xte/ngc4593/analysis * mv *.pha analysis/ * mv *.lc analysis/ 8. Repeat steps 5--7 for each PCU 9. Make response matrices for each spectrum * Make sure your ftools refdata area contains the file pca_e2c_e05v02.fits **THIS FILE MUST BE USED FOR ALL EPOCH DATA (as of 12/31/01). If you are not sure you can explicitly specify it to be used by pcarsp by typing -e pca_e2c_e05v02.fits on the command line. Type pcarsp at the command line (with -e pca_e2c_e05v02.fits if necessary) Example using no attitude files for n4593_31dec01p2_layer1.pha: ------------------------------- (i.e. PCU2) pcarsp PCARSP V7.11 - Ready to go ! Input PHA file: n4593_31dec01p2_layer1.pha Input the Attitude file: NONE Input the layers included in the PHA file [L1,R1,LR1, etc, or all; P for propane] : LR1 Are layers added ? [y/n]: n Input the detectors included in the PHA file [0,1,2,3,4, or all]: 2 Are detectors added ? [y/n]: n This will give you: p2_LR1_2001-06-29.rsp Example using attitude files ------------------------------- * go to /home/yaqoob/xte/ngc4593/ and do * ls -1 P60134-03-01/P60134/*/stdprod/*.xfl >xfl.list Then pcarsp PCARSP V7.11 - Ready to go ! Input PHA file: n4593_31dec01p2_layer1.pha Input the Attitude file:@xfl.list Input the layers included in the PHA file [L1,R1,LR1, etc, or all; P forpropane] : LR1 Are layers added ? [y/n]: n Input the detectors included in the PHA file [0,1,2,3,4, or all]: 2 Are detectors added ? [y/n]: n This will give you: p2_LR1_2001-06-29.rsp ** NOTE *** For some reason I cannot get this to work for ftools v5.0.1 or v5.1 on linux but it works ok for DEC alpha. However for most cases with nominal on-axis pointing, attitude=none should be fine. Repeat the pcarsp step for each spectral file. You should now have p1_LR1_2001-06-29.rsp p3_LR1_2001-06-29.rsp p2_LR1_2001-06-29.rsp p4_LR1_2001-06-29.rsp 10. Add the spectra and responses from indiviual PCUs. You will be using the FTOOL addspec * Prepare an ascii file with the names of the .pha files to be added, one on each line. e.g. call it addpha.dat and in this example it will contain: n4593_31dec01p1_layer1.pha n4593_31dec01p2_layer1.pha n4593_31dec01p3_layer1.pha n4593_31dec01p4_layer1.pha Then on the command line enter addspec infil=addpha.dat outfil=n4593p1234_31dec01_l1 errmeth=gauss qaddrmf = yes qsubback = yes This will generate the following three files: n4593p1234_31dec01_l1.pha :combined source+bgd spectrum for PCUs 1,2,3,4 n4593p1234_31dec01_l1.bak :model background spectrum n4593p1234_31dec01_l1.rsp :response file for the spectrum Note that the header of n4593p1234_31dec01_l1.pha is made by addspec to automatically pick up the correct response and background. 11. CONVERSION OF TIMES TO DIFFERENT MISSIONS _____________________________________________ This is useful for simultaneous observations. The following are MJDREF values for various missions: ASCA: 4.89880000E+04 Chandra: 5.08140000E+04 RXTE: 49353.000696574074 Therefore we have the approximate following conversions: (I don't think this correctly accounts for leap secs etc). ASCATIME = RXTETIME + 31536000.0 secs ChandraTIME = RXTETIME - 126230400.0 secs ASCATIME = ChandraTIME + 157766400.0 secs Usage: Suppose Tc is the value of the absolute time of the first bin of a Chandra lightcurve in ChandraTIME and Tx is the value of the absolute time of the first bin of an RXTE lightcurve. 1. Convert Tx to ChandraTIME using the above, = Txc. 2. Convert all of RXTE time values to Chandra time. If the lightcurve initially started with zero time then add Txc to each bin. 3. Subract Tc from each bin of both lightcurves (if not already done). 4. Now the time axis of both lightcurves should have the same reference point.