Saturday, April 28, 2012

RXTE Analysis

Download Data :

 

Cook Book : 

 

ABC guide :

 

FMI (Fits Master Index) :

Directory structure :

proposal level -> obs level e.g.
P10231 -> 10231-05-01-01

Each level will have a FMI. Copy a FMI from a sub level directory to proposal level. cd out of proposal level and edit FMI :

recofmi P10231 delete=yes



Make Filter file :

xtefilt -s -c -a  -o -p -t 16.0

Example :
xtefilt -s -c -a /usr3/vstr/reji/DEVRAJ/Swift-J1749/appidlist -o 30185-01-01-00 -p /usr3/vstr/reji/DEVRAJ/Swift-J1749/P30185 -f filename -t 16.0

-a path to appidlist. appidlist is created by first typing 
$fhelp xtefilt
copy paste the app ids from the end to a new file named appidlist. It is preferrably kept at proposal level or outside.

-p proposal level dir-path
-o obs dir name (not full path)
-c rewrite old xfl
-s place xfl in stdprod


check filter file : 
fplot offset=yes filter.xfl
choose time as xaxis
choose any appropriate column as y axis (PCU0_ON etc). check list of available columns from
flcol filter.xfl
usual columns :
PCU0_ON, PCU1_ON, PCU2_ON, PCU3_ON, PCU4_ON -> status of PCUs
NUM_PCU_ON -> total number of pcus that were on
ELV -> earth occultation (0 for horizon, +ive for source, -ve for earth). Filter data for angle >= 10 degree.
OFFSET -> stability of pointing. For filter keep offset <= 0.02.
TIME_SINCE_SAA ->  For close to SAA, discard data for faint sources.
ELECTRON# -> filter out when ELECTRON2 > 0.1 for faint source.

In stdprod where .xfl file is located, gti file is produced using make time. e.g. :

To make GTI for all pcus that are one and set limits on elevation and offset :
[devraj@bharani stdprod]$ maketime
Name of FITS file and [ext#][FP_fbd86e8-fbda34f.xfl]
Name of output FITS file[basic.gti]
Selection Expression[elv.gt.10.and.offset.lt.0.02.and.num_pcu_on.gt.0]
Flag, yes if HK format is compact[no]
Column containing HK parameter times[TIME]
PREFR keyword not found, using prefr = 0.5
POSTFR keyword not found, using postfr = 0.5


To make GTI when only 3 pcus are on :
 olegacy [84] [day] ~: maketime
   Name of FITS file and [ext#][] FP_3c7a9f5-3c855c1.xfl
   Name of output FITS file[] basic.gti
   Selection Expression[] elv.gt.10.and.offset.lt.0.02.and.num_pcu_on.eq.3


Additional expression for faint sources :
 (TIME_SINCE_SAA > 30 || TIME_SINCE_SAA < 0.0) && ELECTRON2 < 0.1

To make GTI when 3,4 or 5 PCUs are on :
http://heasarc.nasa.gov/docs/xte/recipes/pcu_combine.html


 Check datatype in PCA directory using 

fkeyprint FS37_fbd86e8-fbd8ea8 datamode
or mymodo (from Tomasso)

Type of event mode data : 
1. E_62mus_.... -> generic event mode
2. Goodxenon mode : GoodXenon1_2s and GoodXenon2_2s

Binner data :

1. SB_...
2. Standard 1f
3. Standard 2f

For GoodXenon :

Combine GoodXenon 1 and 2 files into event files. 
1. Put GoodXenon file names in a file list eg ls *FS37* > filelist
2. Run make_se :

[devraj@bharani pca]$ make_se
Starting up MAKE_SE v.0.20

 > Give name of file containing FITS filelist [fits_files.txt] >
 > Give root for product (output) filenames [event] > 


This creates files like : event_gxn where n is the number of GoodXenon paired files. e.g. event_gx0, event_gx1 etc

Select bitmask

for event modes only.
see :
http://heasarc.nasa.gov/docs/xte/recipes/layers.html

example :

% fselect
Name of FITS file and [ext#][] obs_01_01_gx0 
Name of output FITS file[] obs_01_01_gx0_d0124
Selection Expression[] @bitfile_d0124

sample bitmasks :
http://heasarc.gsfc.nasa.gov/docs/xte/recipes/bitmasks.html#table1

Extract lightcurve by saextract/seextract

saextract -> for binned data (science array)
seextract -> event modes 
see http://heasarc.nasa.gov/docs/xte/abc/data_files.html#array for science data types.

See example saextract here :
http://heasarc.nasa.gov/docs/xte/abc/extracting.html

For input give a single file name or a list of files (max 100) with @filelist 

etc ....

individual layers :
http://heasarc.gsfc.nasa.gov/docs/xte/recipes/layers.html
http://heasarc.gsfc.nasa.gov/docs/xte/abc/pca_issues.html



Plot light curve by lcurve or "fplot offset=yes", entering TIME as the x-axis and RATE[ERROR] as the y-axis.

PHA files for spectral analysis :

run timetrans ( http://heasarc.nasa.gov/docs/xte/abc/extracting.html#time_plot )
to create start and stop times. This creates a file like : peak.tint etc.
The resulting output file containing the converted times can be entered into the extractors (with an @ sign) at the prompt Input time intervals t1-t2, t3-t4 in seconds. 
Rerun seextract/saextract for producing .pha files for spectral analysis.

and example page :
http://heasarc.nasa.gov/docs/xte/abc/extracting.html#event_ex1


Background Estimation :

First copy the relevant background models from the download page :
http://heasarc.nasa.gov/docs/xte/pca_news.html  (see at the end : Important downloads and links)

Steps :
1. Create a new filter file. (rename or move old filter file if necessary)

2. Create a list of standard2 files if there are more than one. Use runpcakackest for multiple files. Use pcabackest for single file at a time.

3. While running pcabackest, input correct standard2 file name, model name etc. See :
http://heasarc.nasa.gov/docs/xte/recipes/pcabackest.html

4. Apply saextrct on background files to produce background light curves and pha files.

5. substract background using lcamath

Create Response matrix


http://heasarc.nasa.gov/docs/xte/recipes/pca_response.html


Dead time

Deadtime should be calculated per PCU: always divide the count rates by the number of PCUs actually on.
http://heasarc.nasa.gov/docs/xte/recipes/pca_deadtime.html


Use XDF for filelist :


To start XDF, type xdf at your system prompt. A window will appear on the screen divided in boxes with accompanying buttons. In broad terms, you start at the top of the window and work downwards, gradually narrowing your data selection criteria by filling the boxes until you produce the file list which appears in the box at the bottom. In more detail:

  1. The first box to fill in is the Path to the directory containing the FMI (FITS Master Index) file - usually the proposal level directory. It is not necessary to type a carriage return when the path name is complete.
  2. Next, use the mouse to activate the Make ObsList button on the top row. This fills the Observations box with one-line summaries of the ObsIds in the top level directory. For each ObsId, the directory name, target name, and time range are listed. At this point you can choose a particular target or time range, though for most GOs this option is not needed.
  3. You select ObsIds themselves by clicking on them with the mouse or by pushing the All button.
  4. The next step is to choose Subsystems from the Subsystems box by clicking on the names of the ones you're interested in.
  5. To see the AppIds/ Configurations of your chosen Subsystem, push the Make AppIdConfigList button on the top row. Select the Appid/Configurations you're interested in from the AppIds/Configurations window.
  6. Finally, when you've completed your choice of AppIds, push the Make FileList button on the top row. The list of corresponding files will appear in the box at the bottom of the screen: if you want to save it, push the Save FileList button on the top row to write out the list to an ASCII file called whatever you put into the File Name window. If no name is specified, it will be called "fits_files.xdf".
Using the @filename convention, the .xdf file may be input to the data reduction software to identify the raw input files.


REX script
http://heasarc.gsfc.nasa.gov/docs/xte/recipes/rex.html


PLOTTING with FTOOLS

Basic PLT cmds  :
https://heasarc.gsfc.nasa.gov/docs/xte/recipes/plotting.html 


FAXBARY:
 command:
faxbary infile=FS_event_gx0_113952e0-11395ce4 outfile=testbary2 orbitfiles=../orbit/FPorbit_Day3344 ra=18.11661111 dec=-29.40833333 refframe="ICRS"

options:
infile=input file name, any event file that you want to analyse. For goods xenon file, give the file obtained after running make_se
outfile=output file name
orbitfiles=orbital ephemeris, always present in the directory orbit in the obsID
ra and dec= coordinates in degrees. Its preferred that correcting pointings are given, based on chandra/xmm pointings obtained from literature. RXTE coordinates in file header may not be accurate
refframe= preferred ICRS as most X-ray data will be compatible with that, FKS being the older version.

Note: latest version of HEASOFT is required as planetary ephemeris files from JPL are searched in standard paths.