About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: 8 Oct 2008
Hardcopy (PDF): A4 | Letter

Preparing to Run ChaRT



Overview

Last Update: 8 Oct 2008 - when using the Spectrum & Exposure Time method, exposure time may be up to 200 ks

Synopsis:

This thread shows how to find the parameter values needed to run ChaRT. These values consist of the coordinates and spectral specifications (whether "energies with density" or "spectrum with exposure time") for the PSF. Note that the "spectrum with exposure time" works well for ACIS; for HRC, the "energies with density" option is recommended.

Proceed to the HTML or hardcopy (PDF: A4 | letter) version of the thread.




Contents



Get Started

Sample ObsID used: 942 (ACIS-S, NGC 4244)

File types needed: evt2

If you use a spectrum file as the spectral specification for your PSF, you will need to use the script chart_spectrum.sl, which is part of the CIAO Scripts distribution. The most recent version of the script is Version 1.0.1 (18 February 2004):

unix%  grep Version $ASCDS_CONTRIB/share/slsh/local-packages/chart_spectrum.sl 
% Version 1.0.1 (2004/02/18)

The chart_spectrum.sl script must be run in CIAO 3.4. A new version for CIAO 4 will be released as soon as it is available.

Note that $ASCDS_CONTRIB/bin/interpreted/ is the default path in the standard CIAO scripts installation; see the Scripts page for more information. Please check that you are using the most recent version before continuing. If you do not have the script installed or need to update to a newer version, please refer to the Scripts page.



Determine the Off-axis Angle

It is necessary to find the location of the source (or position) for which you would like to generate a PSF. To find the coordinates of a source - that is, the offsets from the optical axis - display the event file in ds9:

unix% ds9 acisf00942N003_evt2.fits
[Thumbnail image: The entire field next to a close-up of the desired source displayed in ds9.]

[Version: full-size]

[Print media version: The entire field next to a close-up of the desired source displayed in ds9.]

Figure 1: Reading the off-axis angle

The entire field is shown in the left frame of ds9 with the source marked by a cross. In the right frame, the image is zoomed and the desired source is circled.

Simply read the sky (physical) coordinates from ds9 as you pass the cursor over the image.

(x,y) = (4704,3700)

Since ChaRT requires the position to be in terms of theta and phi, dmcoords is used to convert the values:

unix% dmcoords acisf00942N003_evt2.fits opt=sky x=4704 y=3700 
unix% pget dmcoords theta phi
5.948632053025285
197.7438897007665

The position is therefore:

(theta,phi) = (5.949,197.74)

The values are given in the necessary units - theta in [arcmin] and phi in [deg]. This step could also be done with dmcoords in interactive mode:

unix%  dmcoords acisf00942N003_evt2.fits
dmcoords>: sky 4704 3700
(RA,Dec):     12:16:57.136    +37:43:35.94
(RA,Dec):      184.23807       37.72665 deg
THETA,PHI          5.949'        197.74 deg
(Logical):        4704.00       3700.00
SKY(X,Y):         4704.00       3700.00
DETX,DETY         3405.57       3875.41
CHIP ACIS-S2       573.49        753.83
TDET              3448.49       2455.83
dmcoords>: q

When running dmcoords interactively, a small value of theta is returned in [arcsec] and you must convert it to [arcmin]. For more information on coordinate definitions, read the CIAO thread on using ds9.

Caveat: if your event file has been reprojected (see reproject_events) dmcoords will not calculate theta and phi correctly; see the CIAO bugs page for more information. To avoid this bug, either use the original level=2 event file in this step or follow the workaround given on the bug page.



Spectral Specification of the PSF

The spectral information for the PSF may be provided as either a list of monochromatic energies and a ray density or a source spectrum file and an exposure time.

Energy & Density

Energy: a list of up to ten monochromatic energies between 0.2 and 10 keV. The values must be given in [keV] as well.

Density: a single value indicating the density of rays that will be generated at the entrance aperture. The allowed range is 0.001 to 10 rays/mm2. The number of rays that arrive at the focal plane is determined by the HRMA effective area at the input energies.

This option is useful when assembling a composite spectrum from several mono-energetic simulations, and it is the preferred method for the HRC, because the construction of a spectral file for the HRC is not straightforward.

Using the "energy & density" option

  1. The purpose of making the PSF
    1. To make a PSF with approximately the same number of counts as the source under investigation. For example, you may want to subtract the PSF at the source position in order to look for extended, low brightness emission around the source.

    2. To define the PSF with a much higher S/N than the data.

  2. Select an energy

    HRC: for most sources, a monochromatic PSF will suffice, with an energy input of 1 keV. For some sources, e.g. super soft sources, another monoenergy - maybe 0.2 keV - would be a better choice, or perhaps the simulation should include both 0.2 and 1 keV.

    ACIS: the user will have to decide if a single energy PSF is sufficient, and if not, the known or suspected source spectrum will dictate the choice of energies.

  3. Determine the necessary density

    Now we need to estimate density to input. Looking at the Effective Area (EA) curve for HRC-I in the POG, we can estimate the EA to be 200 cm2 at 1 keV. Since the ChaRT input requires units of rays/mm2, we can calculate a source density which is approximately

    (# counts in your source)/(20000 mm^2).
    

    If you want to create a PSF with a much higher S/N, you can increase the number of rays by some factor like 10 or 100 (so long as you don't exceed the maximum of 10 rays/mm2).


Spectrum & Exposure Time

The chart_spectrum.sl script must be run in CIAO 3.4. A new version for CIAO 4 will be released as soon as it is available.

Spectrum: a file containing the definition of the source spectrum at the entrance aperture of the HRMA for which you would like a PSF to be simulated.

A common user error has proven to be using a file with incorrect units. The file must be energy [keV] vs flux [photons/cm2/s]. Currently, ChaRT will not complain if it appears that the file has incorrect units, so it is up to the user to check that the file is accurate.

For directions on creating a spectrum for your source, see the CIAO thread Using specextract to Extract ACIS Spectra and Response Files. After fitting the spectrum in Sherpa (as illustrated in the Fitting PHA Spectra (S-Lang or Python) thread), you can write out the spectrum using the S-Lang function write_chart_spectrum.

After fitting your spectrum, run the following commands:

sherpa> () = evalfile("chart_spectrum.sl")
sherpa> write_chart_spectrum("source_flux_chart.dat",1.0,8.0)

The first argument to write_chart_spectrum is the name of the spectrum file to create. (If the file already exists, it will be overwritten.) The other arguments specify the minimum and maximum energies to include in the spectrum; in this case, the range is 1 to 8 keV. If the bounds are omitted, the full energy range (as determined by Sherpa) will be used.

If you would like to plot your spectrum, use the function plot_chart_spectrum:

sherpa> plot_chart_spectrum(1.0,8.0)

The output produced by write_chart_spectrum is an ASCII file that contains two columns:

unix% more source_flux_chart.dat
1.01    1.47075e-07
1.03    1.90387e-07
1.05    2.40984e-07
1.07    3.01956e-07
1.09    3.71097e-07
1.11    4.49524e-07
1.13    5.37328e-07
1.15    6.33379e-07
1.17    7.4084e-07
1.19    8.56084e-07
1.21    9.79824e-07
1.23    1.11157e-06
...

The first column gives the center of the energy bin in [keV]. The second column is the flux in [photons/cm2/s].

Exposure Time: the desired exposure time for the simulation. It must be given in [ks] and be within the range of 0 to 200 ks.

The exposure time of the observation is stored in the EXPOSURE header keyword of the event file:

unix% dmkeypar acisf00942N003_evt2.fits exposure echo+
49145.706362262

The exposure time is returned in [s], so this observation is 49 ks long.




Summary

Since all the necessary information has been obtained, you are ready to run ChaRT.



History

14 Dec 2004 updated for CIAO 3.2: location of chart_spectrum.sl
16 Feb 2005 reviewed for CIAO 3.3: no changes
18 Aug 2008 updated for CIAO 4.0: version N003 event file, minor changes to screen output; the chart_spectrum.sl script must be run in CIAO 3.4 (a new version for CIAO 4 will be released as soon as it is available); updated to have inline image
08 Oct 2008 when using the Spectrum & Exposure Time method, exposure time may be up to 200 ks

Return to Threads Page
Hardcopy (PDF): A4 | Letter
Last modified: 8 Oct 2008


The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.