hxdpinxbpi - Produces PIN background (NXB + CXB) spectrum, and a dead time corrected source spectrum.


hxdpinxbpi @evts.list @pse.list @bkgs.list <outstem>


hxdpinxbpi performs the following steps to produce output spectra:

  1. AND GTI from NXB file(s) with GTI in pin??_cl.evt file(s) (or spectrum file) and any extra input GTI file(s) after ORing them together.
  2. Extract source spectrum using same GTI as step 1., if PIN cleaned event file is input.
  3. Extract NXB background spectrum using GTI from step 1.
  4. Calculate a simulated CXB spectrum, if requested
  5. Adjust the EXPOSURE in the NXB spectrum by 10.0 (background files are scaled up by 10.0 to suppress poisson noise).
  6. Apply dead time correction to source spectrum using hxddtcorr.
  7. Add CXB spectrum to NXB spectrum, if CXB spectrum is created or given as input.
  8. Optionally group source spectrum.


The number of output files depends on the input parameters and types of input files. If cleaned event files are used for the input_fname parameter, cxb_fname != 'NONE' and grouspec = "yes", then the output files will be as follows:
Source spectrum, corrected for dead time.

Grouped source spectrum

NXB background spectrum

CXB background spectrum

Total background spectrum, NXB + CXB

The total background spectrum will only be produced if cxb_fname='CALC' or a CXB spectrum is supplied for the cxb_fname parameter.


input_fname [string]
Cleaned PIN event file(s) or PIN source spectrum. The GTI from this file is ANDed with the GTI from the PIN NXB background file, and optionally the GTI file(s) input in the gti_fname parameter (not supported for input spectrum). The resulting GTI is used to extract a spectrum from the cleaned PIN event file (if event files are input), the pseudo event file (see pse_event_fname parameter) and the PIN NXB file (see bkg_event_fname parameter).

A single spectrum for multiple event files can be extracted. Specify @flist, where flist is a file containing cleaned PIN event files (one per line) to use this feature. Extended filename syntax is supported for individual files.

If a spectrum is entered, only a single file is allowed, and no extra GTI filtering (see gti_fname param) is allowed. However, mutliple pseudo event files and background files can be entered if necessary.

pse_event_fname [string]
Pseudo event file name or WEL unfiltered file name if pseudo event file is unavailable. This file is used to correct the dead time of the source spectrum extracted from the cl_event_fname event file(s).

If multiple event files are input for the cl_event_fname parameter, then the files input for this parameter must correspond 1-1 to the cl_event_fname files. The same syntax is used as for the cl_event_fname parameter.

bkg_event_fname [string]
HXD PIN NXD file, either "tuned" or "quick". These can be downloaded from either (tuned):

or (quick):

Alternatively, if the full ftp or http path to the file(s) is known, it can be entered directly. There should be 1-1 correspondence between these files and the cl_event_fname files. The same syntax is used as for the cl_event_fname parameter. A warning will be issued if any of these files are the quick background.

outstem [string]
Output filenames will start with this string.

(gti_fname) [string]
Additional GTI file(s) to AND with both the PIN NXB GTI(s) and cleaned event GTI(s). If more than one file is specified, they will be ORed together before the AND operation. The same syntax is used as for the cl_event_fname parameter. There does not have to be 1-1 correspondence between the gti_fname files and the cl_event_fname event file(s). The files must be FITS GTI files.

(cxb_fname) [string]
If 'NONE', then neither a CXB spectrum nor a total background spectrum will be calculated.

If 'CALC', then a simulated CXB spectrum will be calculated using a standard model for the CXB with adjustable parameters. The model will be calculated as:

   CXB = cxb_norm*(E/cxb_norm_ene)-cxb_phot_indx*exp(-E/cxb_cut_ene)

where E is the spectrum energy in keV. The default values for the cxb_norm, cxb_norm_ene, cxb_phot_indx, and cxb_cut_ene parameters are those found by Boldt et al. (1987). The exposure time in the simulated spectrum will be set to the value of the cxb_exposure parameter.

Otherwise this parameter is taken to be a CXB spectrum file, which will be added (with addspec) to the extracted NXB spectrum to create the total background spectrum.

(cxb_norm) [real]
CXB normalization in units of photons/cm^2/s/FOV/keV. See cxb_fname parameter

(cxb_norm_ene) [real]
CXB normalization energy in keV. See cxb_fname parameter.

(cxb_phot_indx) [real]
Photon index for CXB model. See cxb_fname parameter.

(cxb_cut_ene) [real]
Cutoff energy for CXB model in keV. See cxb_fname parameter.

(cxb_exposure) [real]
Exposure (s) to use for CXB model spectrum. If set to -1, then the exposure of the extracted NXB spectrum will be used. See cxb_fname parameter.

(cxb_randomize) [bool]
Randomize counts in simulated CXB spectrum?

(pinflat_rsp) [string]
PIN response matrix for flat emission. If set to 'CALDB', then the calibration database will be queried for the correct file.

(pinnom_rsp) [string]
PIN nominal pointing response matrix. The response matrix file corresponding to the nominal pointing and epoch of the input observation should be used. The nominal pointing can be checked by examining the 'NOM_PNT' FITS keyword in the input PIN cleaned event file. See the URL:

for more information on finding the correct PIN response matrix for a given epoch. If set to 'CALDB', then the calibration database will be queried for the correct file.

(nxb_scale) [real]
The exposure time in the extracted NXB spectra will be multiplied by this parameter. Currently, the background rates in the available NXB background event files are scaled up by 10 to suppress poisson noise. So to get the actual count rate one must multiply the exposure by 10.0 (which is the default for nxb_scale).

NOTE: It is unlikely that you will need to change this parameter.

(groupspec) [bool]
Group output source spectrum?

(groupmin) [int]
Minimum number of counts per grouped channel in grouped output source spectrum

(cleanup) [bool]
Remove temporary files?

(chatter) [0,5]
Terminal chat level. 0 => no chatter; 5 => debugging

(clobber) [bool]
Overwrite existing output files?

(history) [bool]
Add history keywords?



August 2009