                                                     2001-11-02

Some notes on some aspects of the JEMX the spectral analysis

    by  Stefan Larsson and Niels J. Westergaard


The goal is to make the IT (Instrument Team) as well as user in
general able to use the XSPEC tool for spectral analysis.

The spectral extraction tool (j_src_spectra) may take
as input (parameter driven) a response matrix in OGIP format
(see Appendix 1 below). This will supply the required binning.

The JEMX detector binning is given in JMXi-IMOD-GRP in data
structures JMXi-FBDS-MOD, JMXi-RBDS-MOD, and JMXi-SBDS-MOD.
A full description is found in Appendix 2 below.

A default list of line energies is given in JMXi-IMOD-GRP under
the name: JMXi-ENRG-MOD (columns ENERG_LO, ENERG_HI as in RMF
and ARF) to be used e.g. when a RMF/ARF are to be produced
'on the fly'.
 
The resulting spectra from j_src_spectra will be in the
XSPEC "PHA II" format so that several spectra can be analyzed
simultaneously.



Appendix 1.

The OGIP format of a response matrix (RMF) consists of two FITS binary
tables. The first one (with name 'SPECRESP MATRIX') has 6 columns:

ENERG_LO, ENERG_HI, N_GRP, F_CHAN, N_CHAN, MATRIX

where ENERG_LO, ENERG_HI are the energy limits of the 'line energies'
i.e. the energies where the model spectrum is evaluated. So each
row corresponds to such a line energy. MATRIX is a vector column
where each vector element corresponds to the electronic detector bin
that is described in the second binary table: 'EBOUNDS' that has 3 columns:

CHANNEL, E_MIN, E_MAX

with channel number and energy limits of the bins.




Appendix 2.


             JEM-X pulseheight transformation scale.

             Niels Lund & Niels Joergen Westergaard
                          15/5 2001

JEM-X is using three different data formats for transmitting the 
pulseheight (energy-) information for the detected photons:

  a) 256 energy channels when using the full imaging and spectral- 
     timing formats. (The data from the calibration sources 
     transmitted inside the HK data packets is also given in the
     same scale).
  b) 64 energy channels in the spectral format. The 64 channels are
     derived from the 256 channels by discarding the two lowest bits.
  c) 8 energy channels in the restricted imaging format. The 8
     channels are also derived from the 256 channels by discarding
     the five lowest bits.

The raw pulseheight data are obtained from a 12 bit ADC yielding 4096
channels. For technical reasons an offset corresponding to about 400
ADC channels is introduced on the pulseheight signal prior to the
analog to digital converter. The available raw channel range is
therefore from 0 to about 3700. We want to cover the energy range up
to about 75 keV. Assuming that we will adjust the detector gain so
that 74 keV falls in channel 3700 (after offset correction) we will
have an easy scale to work with: 50 ADC channels per keV.

The following pulseheight transformation scale is designed to give
a good coverage of the interesting energy range from 2 to 35 keV
in 6 of the 8 pulseheight channels we have available when we operate
JEM-X with the restricted imaging format. This has been the primary
constraint for setting up the table. An additional constraint is
that a reasonable resolution should be preserved for the energy range
between 35 and 75 keV when operating in full imaging format.

In the full imaging format (and in the spectral and spectral/timing
formats) we have sufficient channels available that it is not the
channel discretization but the detector energy resolution which will
limit the quality of our energy spectra.

We propose that the 8 energy channels in the restricted imaging
format should have the following boundaries (expressed in keV):

8-ch:  0     1       2      3      4      5      6      7

keV:   0    2.0    4.5      7     10     15     23     35     (74)

With 50 ADC channels per keV we can now calculate which ADC readings
will correspond to the above ideal channel boundaries:

ADC:   0    100    225     350    500    750    1150   1750   3700

Each channel in the 8-channel scale corresponds to 32 channels in the
256-channel scale to be used for the full imaging format. So we can
write down the locations in the 256-scale which corresponds to the
8-scale boundaries:

256ch: 0     32     64      96    128    160    192    224     255

The following transformation table from the ADC- to the 256-scale will
closely approximate the desired channel boundaries:

  between ADC channel    0 and   96 use  3 ADC-ch. per 1 256-ch.
  between ADC channel   96 and  416 use  4 ADC-ch. per 1 256-ch.
  between ADC channel  416 and  496 use  5 ADC-ch. per 1 256-ch.
  between ADC channel  496 and  752 use  8 ADC-ch. per 1 256-ch.
  between ADC channel  756 and 1168 use 13 ADC-ch. per 1 256-ch.
  between ADC channel 1168 and 1744 use 18 ADC-ch. per 1 256-ch.
  between ADC channel 1744 and 3700 use 64 ADC-ch. per 1 256-ch.

The transformation table is shown below:


   0    3    6    9   12   15   18   21   24   27   30   33   36   39   42   45
  48   51   54   57   60   63   66   69   72   75   78   81   84   87   90   93

  96  100  104  108  112  116  120  124  128  132  136  140  144  148  152  156
 160  164  168  172  176  180  184  188  192  196  200  204  208  212  216  220

 224  228  232  236  240  244  248  252  256  260  264  268  272  276  280  284
 288  292  296  300  304  308  312  316  320  324  328  332  336  340  344  348

 352  356  360  364  368  372  376  380  384  388  392  396  400  404  408  412
 416  421  426  431  436  441  446  451  456  461  466  471  476  481  486  491

 496  504  512  520  528  536  544  552  560  568  576  584  592  600  608  616
 624  632  640  648  656  664  672  680  688  696  704  712  720  728  736  744

 752  765  778  791  804  817  830  843  856  869  882  895  908  921  934  947
 960  973  986  999 1012 1025 1038 1051 1064 1077 1090 1103 1116 1129 1142 1155

1168 1186 1204 1222 1240 1258 1276 1294 1312 1330 1348 1366 1384 1402 1420 1438
1456 1474 1492 1510 1528 1546 1564 1582 1600 1618 1636 1654 1672 1690 1708 1726

1744 1808 1872 1936 2000 2064 2128 2192 2256 2320 2384 2448 2512 2576 2640 2704
2768 2832 2896 2960 3024 3088 3152 3216 3280 3344 3408 3472 3536 3600 3664 3728

When working with the 256-scale we will have 32 channels to cover the
range between 35 and 75 keV, this corresponds to 1.25 keV/channel which
still is better than the detector resolution.


