Multiple Chip ACIS Exposure Map and Exposure-corrected Image

Synopsis:

mkexpmap generates an exposure map which may be
used to convert a counts image of a source to an image in
flux units. The computed exposure map is essentially an
image of the effective area at each sky position,
accounting for the effects of dither motion which are
especially important near the edges of the detector.
The fluximage script automates
the creation of an exposure-corrected image for a
Chandra observation.

Purpose:

To build an exposure map for an entire ACIS chip array, create
an exposue-corrected image, and find an approximation for the source flux.

When running
fluximage,
you are only required to provide an input event file. The script
will read the related data product filenames - bad pixels,
aspect solution, mask (ACIS), and
dead time correction (HRC) - and look for them in the working
directory. If the files are in a different location or you wish
to be explicit in what files are used, all of the input filenames
may be set in the parameter file.

In this example, the script is run for all chips in an
ACIS-I observation. The input event file is
provided, and the supporting data filenames are read
from the header. We use the default bin size (which is
8 for ACIS and 32 for HRC data).

The energy range is
restricted from 0.5 keV to 7 keV, and a center-band
energy of 2.3 keV is used. This corresponds to the
Chandra Source Catalog broad
band, so we can set the bands
parameter
as bands=0.5:7.0:2.3orbands=broad
(which is the default value).

Note that the script looked in the repro/ directory
for any file matching the pattern "*evt*", finding
repro/acisf11823_repro_evt2.fits.
You can check the parameter file that was used with
plist fluximage.

Here we use fluximage to calculate the exposure-corrected
images in three bands; in this case the soft, medium,
and hard bands defined in the
Chandra Source Catalog (for which the shortcut
bands=csc
can be used):

This thread uses "foreach" loops to run the same CIAO
tool for multiple chips. The syntax is correct for the
csh or tcsh shell. If you are
using another shell, e.g. bash, change the loop syntax
accordingly.

What is the spectrum of the source?

We can use this file to extract a spectrum of the object
in energy space and find the peak energy.

First, we use the CIAO tool dmextract to create a histogram of count-rate as a
function of energy. Since we are not binning on pi or
pha, we set opt=generic, and we use a bin size of 50
eV to improve the signal to noise:

For this dataset, the peak of the measured spectrum is ~1.7 keV
(which is expected since this is close to the peak of the ACIS
effective area).
Using the peak value would mean that we would be under-estimating
the flux if the energy band is too broad; see the discussion
of
band selection
in the Chandra Source Catalog for more information.
So we will use the 2.3 keV used by the CSC, but note that
this is something that depends on the spectrum of the source
(or sources) being analysed.

The two vertical lines indicate the 1.7 keV peak and the
2.3 keV value defined by the Chandra Source Catalog
for its "broad" band.

Compute the Aspect Histograms

With the aspect solution
file we can create a binned histogram for each chip,
detailing the aspect history of the observation.

The binning used by the
asphist tool is controlled
by its
res_xy
parameter. The default value of 0.5 arcsec was
chosen to match the high-resolution capabilities
of Chandra. Since we are creating images - and
therefore exposure
maps - at a binning significantly larger than the
natural pixel scale of ACIS, we can increase
the res_xy parameter and so reduce the
time it takes to run mkexpmap.
To ensure that aliasing is not significant, we
chose the resolution to be half the pixel size;
that is 1.9 arcseconds (rounding down from
4 * 0.492 = 1.968).

In some cases there will be more than one aspect
solution file (pcadXXX_asol1.fits) for an observation.
All the files must be input, either as a list or
as a stack.
If you used chandra_repro to
re-process the data then it has created a stack file
for you, called acisf<obsid>_asol1.lis,
which we use in this case (although as we only have
a single aspect solution we could also have just used
it directly):

Calculate the Instrument Maps

Since the mirror effective area is used to create the
instrument map, and that area is energy dependent, it is
necessary to decide at what energy to perform the
calculation (or whether to use a spectrum as weights).
In this example we are
going to assume a monoenergetic distribution of
source photons of 2.3 keV (monoenergy
parameter).
The
Calculating Spectral Weights
for mkinstmap thread shows how to
create a weighted instrument map using
mkinstmap.

Note that it is not necessary for the instrument map to
be congruent with the exposure map; the instrument map
should describe the chip with full resolution.

The monoenergy parameter
value may be different for your science
objectives.

Including the maskfile parameter is
particularly important if you are interested in having
an accurate exposure map at the very edge of a CCD,
subarray or window. The
pixelgrid
parameter
should not be changed for the case of a subarray or
window; the mask file will account for the detector
range being different.
For more information, see the dictionary entry on mask
files.

The
pbkfile
parameter has been
deprecated and should be left empty; more
details can be found on the
Watchout
page.
The obsfile
parameter should use the event file
rather than the aspect histogram, as used in previous
versions of CIAO.

Calculate the Exposure Maps

Now we use mkexpmap and the
aspect information stored in the histogram
to project the instrument map onto the sky.
We need to set the xygrid parameter to produce an exposure
map that is the same size as the image created from the event
list. The get_sky_limits script can be used to easily
calculate this information from the existing image:

You can then set the xygrid parameter using the
information provided
by the script, either manually or via

unix% pset mkexpmap xygrid=")get_sky_limits.xygrid"

(if the latter, do not run get_sky_limits again until after
running mkexmap).

Note:
If you are computing a low-resolution exposure map and speed is
more important than accuracy, set
useavgaspect=yes.
In doing so, only the average aspect pointing will be used to derive the
exposure map; otherwise all points in the aspect histogram will be
used. The time required to compute the exposure map is proportional
to the number of bins in the aspect histogram; if the aspect histogram
contains 100 bins, then the use of this option reduces the run time by
a factor of 100, approximately (you may also want to set verbose to 2,
since this causes mkexpmap to output percentage-completed
information).
Using the full aspect solution will help accurately
account for chip edges, bad pixels, etc.

Since we set the
normalize
parameter = no, the
exposure map has units of [cm2*s*counts/photon].
This allows us to simply
divide the image by the exposure map
to derive an image in units of flux
[photons/cm2/s/pixel].
If the setting had been left as yes (the default),
the units of the exposure map would be
[cm2*counts/photon].
The units can be added to the exposure map using
dmhedit

The exposure map can be displayed in
ds9 (Figure 3).
We adjust the DETNAM keyword to better reflect
the data (note that the DETNAM for each individual exposure
map is ACIS-0 to ACIS-3 in this example).

The strongly variable exposure near the edge of a
dithered field may produce "hot" pixels when divided
into an image. While technically proper, these hot
pixels can be an eyesore, drawing attention to a noisy,
uninteresting portion of the image. The
dmimgthresh tool is used to make
a "threshold cut" before dividing the image by the
exposure map, thus removing the hot pixels:

We also threshold the exposure map so that we
can use the exposure map to determine whether
a pixel is 0 because there were no counts or because
it was removed by the threshold process.

Here we set our threshold at 1.5% of the
maximum value of the exposure map. All image pixels
with values of exposure less than this
value will be set to 0.0 in the output file.
You may want to adjust these values for your own
observation.

The exposure map is in units of
[cm2*s*counts/photon] since it was created by
projecting the instrument map
(in [cm2*counts/photon]) onto the tangent
plane of the observation. To create an image in units of
[photon/cm2/s/pixel],
we simply need to divide by the exposure map.
This is done by the tool dmimgcalc.

Users should be cautious about analyzing the data for sources near
the edges of the ACIS CCDs.

For X-rays passing through the mirrors, the very bottom of each
CCD is obscured by the frame store. As a result, some of the
events in rows with CHIPY <= 8 are not detected. (The set of
rows affected varies from CCD to CCD.) Since the CIAO tools do
not compensate for this effect, the ARFs and exposure maps for
sources in these regions may be inaccurate.

For sources within about thirty-two pixels of any edge of a CCD,
the source may be dithered off the CCD during part of an
observation. The aspect histogram, which is used to create ARFs
and exposure maps, is designed to compensate for this effect.

An ARF calculated at the edge of a chip will not be accurate
since the response tools for spectral extraction (specifically the
ARF) assume that 100% of the PSF is enclosed - i.e. on the chip
- all the time, which may not be the case. The amount of error
introduced depends on how close the source is to the edge, the
morphology of the source, and the characteristics of the PSF,
which depends on the source spectrum.

A contaminant has accumulated on the optical-blocking filters of
the ACIS detectors, as described in the ACIS QE Contamination why topic. Since
there is a gradient in the temperature across the filters (the
edges are colder), there is a gradient in the amount of material
on the filters. (The contaminant is thicker at the edges.)
Within about 100 pixels of the outer edges of the ACIS-I and
ACIS-S arrays, the gradient is relatively steep. Therefore, the
effective low-energy (' 1 keV) detection efficiency may vary
within the dither pattern in this region. The ARF and
instrument map tools are designed to read a calibration file
which describes this spatial dependence.

fluximage updates were released in the 06
Feb 2012 scripts package: setting
badpixfile=CALDB uses the bad pixel file from the CALDB
rather than the per-observation version.

16 Feb 2012

fluximage updates were released in the 16
Feb 2012 scripts package: setting
badpixfile=NONE uses no bad pixel file when creating the
instrument, and hence exposure, maps.

15 Oct 2012

The fluximage script has been updated in the
15 Oct 2012 scripts package:
changes include an updated parameter file; output file names are different;
and support for spectrally-weighted exposure maps.
The observation used as an example has been changed
to ObsId 11823, an observation of the supernova remnant
RCW 103.
An example of running fluximage to create multiple bands
has been added (Figure 1).
The step-by-step guide has been updated to better match
the fluximage script: e.g. use of a
FOV file for filtering the
observation; using the same energy value for the exposure map rather
than taking the peak of the spectrum;
the
res_xy parameter of asphist
is
increased to reduce the time it takes to create exposure maps;
the exposure map is now also thresholded;
and the exposure-corrected image is created with pixels containing
0 (Figure 4)
or NaN (Figure 5) where there is no
data.

03 Dec 2012

Review for CIAO 4.5; removed mkexpmap warnings;

26 Nov 2013

Review for CIAO 4.6; the pbkfile parameter for
fluximage has been removed and is deprecated for
mkinstmap; an event file, rather than aspect
histogram, should be used for the obsfile
parameter of mkinstmap.