Basic Lightcurves
![[CXC Logo]](../../imgs/cxc-logo.gif)
CIAO 4.2 Science Threads
[Python Syntax]
Overview
Last Update: 5 Feb 2010 - updated for CIAO 4.2: ChIPS version; ObsID 461 file version and corresponding change to screen output
Synopsis:
A simple lightcurve from a point source in ACIS data can be used to get an idea of the variability of the source or to look for background flares that should be filtered out. The process for HRC is similar, but requires accounting for the Dead Time Factor (DTF). The CIAO tool dmextract is used in this thread as it accurately applies good time interval (GTI) information when creating lightcurves.
Purpose:
To create lightcurves for use in a variety of analyses.
Related Links:
- Why topic: Timing Analysis with Lightcurves: caveats that one should be aware of when doing timing analysis on Chandra data.
Contents
- Get Started
- ACIS Lightcurves
- HRC Lightcurves
- Caveats
- Parameter files:
- History
- Images
Get Started
Sample ObsIDs used: 953 (ACIS-I, 47 Tuc); 461 (HRC-I, 3C 273)
File types needed: evt2; dtf1 (ObsID 461 only)
ACIS Lightcurves
The most common lightcurve is made from a point source observed with the ACIS detector. This may be done to get an idea of the variability of the source or to help identify periods of high background.
To begin, we define the regions - two source and one background - which will be used to create the lightcurves. For instructions on how to create regions in ds9, see the Using CIAO Region Files thread. The regions used in this example are shown in Figure 1.
![[Thumbnail image: Two source extraction regions (src1 and src2) and a background extraction region (bkg) are defined on the data.]](regions.thumb300.png)
[Version: full-size]
![[Print media version: Two source extraction regions (src1 and src2) and a background extraction region (bkg) are defined on the data.]](regions.png)
Figure 1: Image of 47 Tuc with extraction regions
The source and background regions for creating the lightcurves.
unix% more src1.reg # Region file format: CIAO version 1.0 circle(4010.5,4037.5,8) unix% more src2.reg # Region file format: CIAO version 1.0 circle(4035.5,4034.5,8) unix% more bkg.reg # Region file format: CIAO version 1.0 circle(3875.5,3972,54.5)
Determine which chips are being used
dmextract uses a ccd_id filter on the input file ensure that the proper GTIs are used. Use dmstat to determine the correct chip:
unix% punlearn dmstat unix% dmstat "acisf00953N003_evt2.fits[sky=region(src1.reg)][cols ccd_id]" ccd_id min: 3 @: 1 max: 3 @: 1 mean: 3 sigma: 0 sum: 7284 good: 2428 null: 0 unix% dmstat "acisf00953N003_evt2.fits[sky=region(src2.reg)][cols ccd_id]" ccd_id min: 3 @: 1 max: 3 @: 1 mean: 3 sigma: 0 sum: 5850 good: 1950 null: 0 unix% dmstat "acisf00953N003_evt2.fits[sky=region(bkg.reg)][cols ccd_id]" ccd_id min: 3 @: 1 max: 3 @: 1 mean: 3 sigma: 0 sum: 663 good: 221 null: 0
The regions with which we are working are all located on chip 3 (ACIS-I3); see Figure 6.1 of the POG for an illustration of the focal plane)
Create a background-subtracted lightcurve
First we extract a background-subtracted lightcurve for "src2":
unix% punlearn dmextract unix% pset dmextract \ infile="acisf00953N003_evt2.fits[ccd_id=3,sky=region(src2.reg)][bin time=::2000]" unix% pset dmextract outfile="src2_sub_lc.fits" unix% pset dmextract bkg="acisf00953N003_evt2.fits[ccd_id=3,sky=region(bkg.reg)]" unix% pset dmextract opt="ltc1" unix% dmextract Input event file (acisf00953N003_evt2.fits[ccd_id=3,sky=region(src2.reg)][bin time=::2000]): Enter output file name (src2_sub_lc.fits):
You can check the parameter file that was used with plist dmextract.
The lightcurve may be plotted using ChIPS:
unix% chips ----------------------------------------- Welcome to ChIPS: CXC's Plotting Package ----------------------------------------- CIAO 4.2 Tuesday, July 6, 2010 chips> make_figure("src2_sub_lc.fits[cols time,net_rate,err_rate]", "line.color=red")
This lightcurve is shown in Figure 2. There is a significant drop in count rate near 6.9610x107 seconds. This information is used again in the next section.
Figure 2: Background-subtracted lightcurve of src2
There is a significant drop in count rate near 6.961x107 seconds.
Quit ChIPS before continuing:
chips> quit
Examining the lightcurve with dmlist shows the same results:
unix% dmlist "src2_sub_lc.fits[cols time,count_rate]" data -------------------------------------------------------------------------------- Data for Table Block LIGHTCURVE -------------------------------------------------------------------------------- ROW TIME COUNT_RATE 1 69584184.1139039993 0.09905969738988 2 69586184.1139039993 0.08507730 3 69588184.1139039993 0.0739362250 4 69590184.1139039993 0.0840644750 5 69592184.1139039993 0.06482080 6 69594184.1139039993 0.058743850 7 69596184.1139039993 0.062795150 8 69598184.1139039993 0.06532721250 9 69600184.1139039993 0.07545546250 10 69602184.1139039993 0.06634003750 11 69604184.1139039993 0.0840644750 12 69606184.1139039993 0.0719105750 13 69608184.1139039993 0.04000658750 14 69610184.1139039993 0.0010128250 15 69612184.1139039993 0.050641250 16 69614184.1139039993 0.04861560 17 69616184.1139039993 0.04085938928173
Looking for variability
It is also valuable to compare the lightcurves of sources in the same field when looking for variation. Here we extract a lightcurve for each of the "src1" and "src2" regions (intentionally including the background counts):
unix% punlearn dmextract unix% dmextract outfile="curve_1.fits" opt="ltc1" \ infile="acisf00953N003_evt2.fits[ccd_id=3,sky=region(src1.reg)][bin time=::2000]" unix% dmextract outfile="curve_2.fits" opt="ltc1" \ infile="acisf00953N003_evt2.fits[ccd_id=3,sky=region(src2.reg)][bin time=::2000]"
The lightcurves can be plotted in ChIPS:
unix% chips ----------------------------------------- Welcome to ChIPS: CXC's Plotting Package ----------------------------------------- CIAO 4.2 Tuesday, July 6, 2010 chips> split(2, 1, 0.01) chips> make_figure("curve_1.fits[cols time,count_rate]") chips> current_plot("plot2") chips> make_figure("curve_2.fits[cols time,count_rate]")
These commands produce Figure 3.
Figure 3: Comparing the lightcurves
The top plot contains lightcurve "src1" and the bottom plot contains lightcurve "src2". The x-axis values (time) for the two plots are aligned.
The results can also be examined with dmlist:
chips> quit unix% dmlist "curve_1.fits[cols time,count_rate]" data ... 13 69608184.1139039993 0.07241698750 14 69610184.1139039993 0.07444263750 15 69612184.1139039993 0.06937851250 16 69614184.1139039993 0.08355806250 17 69616184.1139039993 0.06891210431098 unix% dmlist "curve_2.fits[cols time,count_rate]" data ... 13 69608184.1139039993 0.04000658750 14 69610184.1139039993 0.0010128250 15 69612184.1139039993 0.050641250 16 69614184.1139039993 0.04861560 17 69616184.1139039993 0.04085938928173
Comparing this to the lightcurve data from the previous section proves two things:
-
This is not an instrumental effect, since it shows up in curve_2.fits but not curve_1.fits. An instrumental feature would appear in both sources, as they are close together and on the same chip.
-
This is not a background feature, since it is present in both the subtracted (src2_sub_lc.fits) and unsubtracted (curve_2.fits) lightcurves.
It is highly likely, therefore, that the dip in count rate is an indication of a variable star. In the case of 47 Tuc, this is due to a binary system; see the Chandra Photo Album entry for 47 Tucanae for more information.
High background levels
The technique for identifying periods of high background from a lightcurve - and subsequently filtering them out - is explained in detail in the Filtering Lightcurves thread.
HRC Lightcurves
The proper method of creating an HRC lightcurve requires accounting for the Dead Time Factor (DTF). The DTF describes the detector's deviation from the standard detection efficiency. This time-dependent change is due to the physical effect of an event striking the micro-channel plate, as illustrated in the MCP Principles page. The DTF is evaluated roughly every 2 seconds and the data are stored in the "dtf1.fits" file. The average DTF value within the time bin is used by dmextract to correct the exposure time and count rate in the lightcurve.
The source region for this example has been saved in the file hrc_src.reg. Again, for instructions on how to create regions in ds9, see the Using CIAO Region Files thread.
unix% more hrc_src.reg # Region file format: CIAO version 1.0 circle(16478,16292,19.5) unix% punlearn dmextract unix% pset dmextract infile="hrcf00461N005_evt2.fits[sky=region(hrc_src.reg)][bin time=64938947.367:64959159.548:1000]" unix% pset dmextract outfile=hrc_lc.fits unix% pset dmextract opt=ltc1 unix% pset dmextract exp=hrcf00461_001N004_dtf1.fits unix% dmextract Input event file (hrcf00461N005_evt2.fits[sky=region(hrc_src.reg)][bin time=64938947.367:64959159.548:1000]): Enter output file name (hrc_lc.fits):
You can check the parameter file that was used with plist dmextract.
Plotting the lightcurve in ChIPS:
unix% chips ----------------------------------------- Welcome to ChIPS: CXC's Plotting Package ----------------------------------------- CIAO 4.2 Tuesday, July 6, 2010 chips> make_figure("hrc_lc.fits[cols time,count_rate]") chips> limits(Y_AXIS, 10.7, AUTO)
creates Figure 4.
Figure 4: HRC lightcurve
The Dead Time Factor (DTF) was included when creating this lightcurve.
Examine the lightcurve with dmlist:
chips> quit unix% dmlist "hrc_lc.fits[cols time,count_rate]" data -------------------------------------------------------------------------------- Data for Table Block LIGHTCURVE -------------------------------------------------------------------------------- ROW TIME COUNT_RATE 1 64939447.3669999987 11.0733183423 2 64940447.3669999987 11.1507898829 3 64941447.3669999987 11.0442937264 4 64942447.3669999987 10.8239365178 5 64943447.3669999987 11.0010392113 6 64944447.3669999987 10.8625580386 7 64945447.3669999987 11.1579391650 8 64946447.3669999987 11.0144627826 9 64947447.3669999987 11.0962578163 10 64948447.3669999987 11.0444671884 11 64949447.3669999987 10.8780787192 12 64950447.3669999987 10.8945987836 13 64951447.3669999987 11.0979730444 14 64952447.3669999987 10.9051372468 15 64953447.3669999987 11.0032843556 16 64954447.3669999987 10.9659317565 17 64955447.3669999987 11.1047846334 18 64956447.3669999987 10.9752720633 19 64957447.3669999987 11.2070296654 20 64958447.3669999987 11.1219654704 21 64959447.3669999987 0.52213604829741
Caveats
There are a number of subtleties that it is important to be aware of when using lightcurves for timing analysis. These issues are described in the Timing Analysis with Lightcurves why topic; please read that document before continuing with the analysis.
Parameters for /home/username/cxcds_param/dmextract.par #-------------------------------------------------------------------- # # DMEXTRACT -- extract columns or counts from an event list # #-------------------------------------------------------------------- infile = acisf00953N003_evt2.fits[ccd_id=3,sky=region(src2.reg)][bin time=::2000] Input event file outfile = src2_sub_lc.fits Enter output file name (bkg = acisf00953N003_evt2.fits[ccd_id=3,sky=region(bkg.reg)]) Background region file or fixed background (counts/pixel/s) subtraction (error = gaussian) Method for error determination(poisson|gaussian|<variance file>) (bkgerror = gaussian) Method for background error determination(poisson|gaussian|<variance file>) (bkgnorm = 1.0) Background normalization (exp = ) Exposure map image file (bkgexp = ) Background exposure map image file (sys_err = 0) Fixed systematic error value for SYS_ERR keyword (opt = ltc1) Output file type: pha1 (defaults = ${ASCDS_CALIB}/cxo.mdb -> /soft/ciao/data/cxo.mdb) Instrument defaults file (wmap = ) WMAP filter/binning (e.g. det=8 or default) (clobber = no) OK to overwrite existing output file(s)? (verbose = 0) Verbosity level (mode = ql)
Parameters for /home/username/cxcds_param/dmextract.par #-------------------------------------------------------------------- # # DMEXTRACT -- extract columns or counts from an event list # #-------------------------------------------------------------------- infile = hrcf00461N005_evt2.fits[sky=region(hrc_src.reg)][bin time=64938947.367:64959159.548:1000] Input event file outfile = hrc_lc.fits Enter output file name (bkg = ) Background region file or fixed background (counts/pixel/s) subtraction (error = gaussian) Method for error determination(poisson|gaussian|<variance file>) (bkgerror = gaussian) Method for background error determination(poisson|gaussian|<variance file>) (bkgnorm = 1.0) Background normalization (exp = hrcf00461_001N004_dtf1.fits) Exposure map image file (bkgexp = ) Background exposure map image file (sys_err = 0) Fixed systematic error value for SYS_ERR keyword (opt = ltc1) Output file type (defaults = ${ASCDS_CALIB}/cxo.mdb -> /soft/ciao/data/cxo.mdb) Instrument defaults file (wmap = ) WMAP filter/binning (e.g. det=8 or default) (clobber = no) OK to overwrite existing output file(s)? (verbose = 0) Verbosity level (mode = ql)
History
03 Jan 2005 | reviewed for CIAO 3.2: no changes |
21 Dec 2005 | updated for CIAO 3.3: default value of dmextract error and bkgerror parameters is "gaussian"; dmextract can now accept a DTF file in the exp parameter, which simplifies the process of creating HRC Lightcurves |
01 Dec 2006 | updated for CIAO 3.4: CHIPS version |
23 Jan 2008 | updated for CIAO 4.0: updated ChIPS syntax; lightcurve tool no longer in CIAO; removed "Tool: dmextract vs. lightcurve" section; filenames, screen output, and region files updated for reprocessed data (version N003 event file for 953) |
25 Jun 2008 | updated image display to place figures inline with text |
12 Jan 2009 | updated for CIAO 4.1: provided both Python and S-lang syntax for ChIPS |
05 Feb 2010 | updated for CIAO 4.2: ChIPS version; ObsID 461 file version and corresponding change to screen output |