Skip to the navigation links
Last modified: 29 February 2024


Bugs: specextract

Table of Contents




Using correctpsf=yes with small region may yield unreliable results.

The PSF aperture correction users get when using correctpsf=yes with weight=no may be unreliable when using very small regions, where small is relative to the size of the PSF. For example using a circle with a 0.5arcsec radius, ie 1 ACIS pixel, for an on-axis source is likely going to incorrectly compute the PSF fraction correction.


Users can work around this issue by running the arfcorr tool separately after running specextract. The key is to use an input image with a small bin size compared to the region. For example

% pset arfcorr infile="acis_evt2.fits[sky=region(small.reg)][bin sky=0.1]"
% pset arfcorr arf=small_reg.arf
% pset arfcorr outfile=small_reg_psfcorrected.arf
% pset arfcorr x=4171.265139 y=3985.193939
% pset arfcorr region="region(small.reg)"
% arfcorr mode=h

The same asp and mask files are used for source and background responses  (28 Dec 2010)

The script assumes that corresponding items in the source and background stack are defined from the same event file, and uses the specified asp and mskfile files for creating both the source and background responses.

For example, if the input command includes:

specextract infile="file1.fits[sky=region(i.reg)],file2.fits[sky=region(i.reg)]" \
bkgfile="file1.fits[sky=region(bg.reg)],file2.fits[sky=region(bg.reg)]" \
asp="asphist1.fits,asphist2.fits" outroot="src_i" 

The "asphist1.fits" file is used in creating both the source and background WMAP files:

sky=1]" asphist1.fits "src1_tdet.fits[wmap]" clobber=yes

sky=1]" asphist1.fits "bkg1_tdet.fits[wmap]" clobber=yes

Users who wish to define the source and background from different event files will need to run the script twice to do so.

Remember that if you plan on subtracting the background, then you do not need to create a background RMF and ARF. You may simply use dmextract to create the spectrum. In this case, leave the bkgfile parameter blank so that specextract will only create the source spectrum and responses.

The mkwarf tool may run out of memory for large regions.
# mkwarf (CIAO): dsALLOCERR -- ERROR: Could not allocate memory.  (15 Dec 2011)

If a weighted ARF is being created for a large region, on order of a full chip (or larger), mkwarf may hit the intrinsic memory limit of a 32-bit application.


In CIAO 4.4, there is a new specextract parameter - binarfwmap - that specifies the binning of the sky2tdet WMAP, which is used as input to mkwarf.

If you encounter this error, increase the binarfwmap value to create a coarser WMAP.

# specextract (<date>): ERROR An error occurred while running 'sky2tdet':
# sky2tdet (CIAO): ERROR: no non-null/0/nan pixels are in the input image
 (02 Mar 2012)

The most likely cause of this error is that the region and energy filter set in the energy_wmap parameter do not select any events:

unix% dmlist "evt2.fits[sky=region(ciao.reg)][energy=300:2000]" counts


Adjust the energy_wmap value to match that of your events. The range of event energies in the region can be found with dmstat:

unix% dmstat "evt2.fits[sky=region(ciao.reg)][cols energy]"
min: 2231.7507324 @: 61
max: 7980.6259766 @: 35
mean: 4012.0070413
sigma: 1252.6216735
sum: 429284.75342
good: 107
null: 0


may produce incorrect warning message:

Output spectra and responses were not combined because spectra and/or responses were not created for every item in the input stack(s) of files.

The above warning message may occur even if the spectrum, RMF, and ARF were successfully created for each of the individual observations.


As a work around, users just need to run the combine_spectra script with the list of spectra, .pi files, as input

$ combine_spectra "spectract_output/*pi" outroot=combo