NAME

bcmppha -- Converts a CGRO/BATSE TYPE II trigger file to a TYPE I pha file


USAGE

        bcmppha data_dir infile outfile filemode chan_start chan_stop list_lc 
          plot_lc device ns1 ns2 (nb1 nb2 nb3 nb4)

DESCRIPTION

The BCMPPHA program makes source and background Type I PHA files, which can be used with the XSPEC package for gamma-ray burst data analysis, from BATSE Type II PHA files for trigger data. A BATSE Type II PHA trigger file can be obtained from the BFITS file using the FTOOLS: "FBBFT2PHA". A TYPE II pha file contains one extension with one or more spectra stored as rows. A TYPE I pha file contains only one spectrum in an extension. This task has two file modes, Source, and Background. "Source" makes a source file and "Background" makes a background file. One needs to know the light curves to determine a source region and a background region. The light curve is displayed to help to determine a source region if plot_lc is set to be 'yes'.


SUPPORTED FITS FORMATS

Currently only the following OGIP standards are supported by this task:

     HDUCLAS1/HDUVERS1 = 'SPECTRUM'/'1.*.*'
             (commonly also known as "PHAVERSN=1992a")
     HDUCLAS2 = 'TOTAL'/'NET'/'BKG'
     HDUCLAS3 = 'TYPE:II'
     HDUCLAS4 = 'COUNT'/'RATE'


PARAMETERS

data_dir [character string]
The name of data directory

infile [character string]
The name of the BATSE trigger Type II PHA file to be read.

outfile [character string]
The name of the BATSE trigger Type I PHA file to be written.

filemode [character string]
The conversion file mode to be used. "Source" makes a source file and "Background" makes a background file so that they can be used with the XSPEC package for the BATSE gamma-ray burst data analysis.

list_lc [character string]
displays the light curve in ASCII. Default is [No]. One needs to know the light curve to determine a source region and a background region of the BATSE trigger data.

plot_lc [character string]
displays the light curve on screen to help one to determine a source region of the BATSE trigger data.

chan_start [integer]
start channel number

chan_start [integer]
stop channel number

ns1 [integer]
If "Source" mode is selected for filemode, this is the start spectra number for the source region.

ns2 [integer]
If "Source" mode is selected for filemode, this is the end spectral number for the source region.

nb1 [integer]
If "Background" mode is selected for filemode, this is the start spectra number for the background region before a source region.

nb2 [integer]
If "Background" mode is selected for filemode, this is the end spectra number for the background region before a source region.

nb3 [integer]
If "Background" mode is selected for filemode, this is the start spectra number for the background region after a source region.

nb4 [integer]
If "Background" mode is selected for filemode, this is the end spectra number for the background region after a source region.


EXAMPLES

1. The first example below will converts her_bfits_0_2213.pha to a source file her_s_0_2213.pha. No light curve in ASCII is requested. Start with channel number of 1 and end with channel number of 128 for this source region.

     bcmppha her_0_2213.pha her_s_0_2213.pha  source 
     Main BCMPPHA Ver 1.0.0
     Please enter data directory[]./data
     Please enter typeII PHA filename[]her_0_2213.pha
     Please enter output filename[] her_s_0_2213.pha
     Please enter file mode Background or Source[] s
     List Time History? yes or no[]n
     Please enter Start Channel[1]
     Please enter Stop Channel (1:256) [128]
     Plot Time History? yes or no[]no
     Please enter Start Point of Source[] 5
     Please enter End Point of Source[] 17
     ... written the PHA data Extension
     Completed BCMPPHA Ver 1.0.0

2. The second example below will converts her_0_2213.pha to a background file her_b_0_2213.pha. The light curve in ASCII is requested. Start with channel number of 1 and end with channel number of 128 for the background region.

     Please enter data directory[]./data
     Please enter typeII PHA filename[]her_bfits_6_143.pha
     Please enter output filename[] her_b_6_143.pha
     Please enter file mode Background or Source[] b
     List Time History? yes or no[]no
      Main BCMPPHA Ver 1.0.0
     Please enter Start Channel[]1
     Please enter Stop Channel (1:256) []128
     on a interactive menu, click on plot, the go to the plot, click right mouse button to determine
      b1, b2, b3, and b4 (click left mouse button will give the current coodinate):
      Chose spectra number: b 1
      Chose spectra number: b 2
      Chose spectra number: b 3
      Chose spectra number: b 4
      ... written the PHA data Extension
      Completed BCMPPHA Ver 1.0.0


BUGS


SEE ALSO

comppha

CATEGORY

Aug98 gro