Removing ACIS Background Flares

CIAO 4.10 Science Threads

Overview

Synopsis:

This thread may be used to remove background flares from any
ACIS dataset.

The ACIS blank-sky
background datasets were created for
quiescent-background periods. So it is important to filter
your dataset to remove periods of background flares before
using the blank-sky files in the analysis.

Purpose:

To remove background flares from an ACIS observation for
spectral fitting or images for spatial analyses.

The lc_clean() routine removes flares (and periods
of anomalously-low count rates) from lightcurves using the
same technique as used on the ACIS background files.
The simple cleaning used by the
lc_sigma_clip() routine
in the
Filtering Lightcurves
thread is a more conservative approach.

Remove bright sources

The background fields were filtered using a maximum rate
that is 20 percent higher than the quiescent background
level. It is therefore necessary to remove any bright
sources from your dataset. For this example we have
chosen the regions to exclude by eye, using ds9.
The resulting region file - sources.reg - is shown
on the image in Figure 1 and listed below:

These times will be used as the lower and upper limits
for extracting the lightcurve.

The ACIS blank-sky background files were cleaned with a bin
size of 259.28 seconds (refer to
the Cookbook);
the same binning is used for the event data, so the filter
is:

[bin time=84245789.155:84253741.155:259.28]

The filter could also be defined as
"[bin time=::259.28]", in which case the TSTART and
TSTOP header values are used for the endpoints. This
approach is valid, though it will probably create some empty
bins in the output lightcurve, since that time range is
longer than the
good time interval.

The file 1838_c7_bg.lc contains the lightcurve
for the data. You can check the parameter file that was
used with plist dmextract.

Remove periods of high (or low) count rates

The lc_clean() routine from the Python
module lightcurves.py selects those regions of the
lightcurve that do not contain flares. The algorithm used is
taken from the lc_clean program created by Maxim
Markevitch, and is different from that used by the
lc_sigma_clip() routine
in the
Filtering Lightcurves
thread.

Figure 2: Plot from lc_clean

Figure 2: Plot from lc_clean

The top plot shows the lightcurve
of 1838_c7_bg.lc, where the time axis is
displayed on the x axis as a relative value (the first
bin in the lightcurve is used as the zero
point). Points that are in green are those that passed
the sigma-clipping and the horizontal dotted line shows
the mean value of these points (the numerical value is
given in the plot title).

The bottom plot shows a histogram of the count rate
values; the green version again shows the data that
passes the sigma-clipping algorithm.

In order to create a GTI file, we need to specify an
output filename; here we use "1838_c7_bg.gti".
The command also creates Figure 3.

Figure 3: Plot from lc_clean when outfile is set

Figure 3: Plot from lc_clean when outfile is set

The top plot now indicates the regions excluded by the
GTI file created by lc_clean - here
1838_c7_bg.gti - using a solid red pattern.

Since we specified an output file,
the lc_clean() function has run
dmgti, using the calculated
range, and created the file 1838_c7_bg.gti.
You can check the parameter file that was used with
plist dmgti.

Exit ChIPS when you are done:

chips> quit()

Running lc_clean via the deflare script

The deflare script provides a
command-line interface to lc_clean. Run deflare
with method=clean to choose
the lc_clean cleaning method; here we repeat
the example from this section:

An example of a strong flare

The previous example showed an essentially stable
background level. ObsID 1712, which is also used in the
Filtering
Lightcurves, contains a major flare event.
First we create a lightcurve of the background
of this observation:

When lc_clean() is run on this lightcurve, the
routine finds that the filtered lightcurve contains less than
ten percent of the original exposure, and so stops
(this limit can be changed by setting the option
minfrac to something other than 0.1).
The diagnostic plot that is created
(Figure 4) shows that the default
options do not do a good job with this lightcurve.
The log_scale calls are used to
change the scaling of the rate axes in both plots.

Figure 4: A lightcurve with a strong flare in it

Figure 4: A lightcurve with a strong flare in it

The strong flare means that the routine does not pick up the
"quiescent" level in this obeservation. Since the X axis of the
bottom plot is linked to the Y axis of the top plot, the
log_scale has changed the scaling in both plots
(e.g. compare to Figure 2).

The rate histogram in Figure 4 suggests
a value of 0.35 count/s, so we use the mean
option to force this value:

Figure 5: Setting the mean option when filtering a lightcurve

Figure 5: Setting the mean option when filtering a lightcurve

Forcing the initial calculation to use a mean level
of 0.35 count/s has resulted in more points
being marked as good. However, the curve is still
noisy and many times are excluded, as indicated by
the regions of solid red color.

The use of AUTO for the minimum value in
the limits
call means that the limit is calculated from the data.

See the lc_clean help file for
more information on changing the filtering scheme used
by the routine. Maxim
Markevitch's Cookbook contains advice on filtering lightcurves with strong flares.