Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: 21 June 2016

URL: http://cxc.harvard.edu/ciao/threads/srcextent/

Measuring Source Extent

CIAO 4.9 Science Threads


Overview

Synopsis:

The srcextent tool calculates the sizes and associated errors of a photon-count source image or list of source images using the Mexican Hat Optimization (MHO) algorithm (Houck 2007). The uncertainty from a 90% confidence estimate derived from Monte Carlo trials using MARX simulated data is also reported.

Purpose:

To measure the size of a source and to estimate if a source may be extended.

Related Links:

Last Update: 21 Jun 2016 - Clarified limited scope of use of tool and added a caveats section.


Contents


Get Started

Download the sample data: 635 (ACIS-I, RHO OPH CORE)

unix% download_chandra_obsid 635 evt2

The PSF and source data may be provided either as event files or images. Event data are preferred, and are used in this thread. If using a PSF image, the source centroid must be at the center of the image to ensure the appropriate estimates are correct.

Simulate a PSF (optional)

A PSF may be used in runnning srcextent. The tool fits the PSF first, if it is present, and uses the result as an initial guess to guide fitting on the source image.

The Chandra HRMA PSF can be simulated with ChaRT and the instrument effects, including detector pixelization, can be simulated with MARX. Instructions on how to run ChaRT and MARX to create a PSF FITS file are available in the ChaRT threads.


Creating the Source Region File

We need to define a source region to use as input to the tool. To do this, first display the image:

unix% ds9 acisf00635N004_evt2.fits &

In this example, we chose a source on ACIS-I1 (ccd_id=1), as shown in Figure 1.

To save the regions, follow these steps:

  1. Region → Save Regions... → Save As "src.reg".
  2. After choosing "OK" in the region filename dialog, a format dialog is opened. Set the format to "CIAO" and the coordinate system to "Physical".

    Only CIAO format regions are currently supported.

The resulting region file looks like:

unix% more src.reg
# Region file format: CIAO version 1.0
circle(3531,3781,20)

Run srcextent

The event file, PSF file, and region are the only inputs necessary to run srcextent:

unix% punlearn srcextent
unix% pset srcextent srcfile=acisf00635N004_evt2.fits
unix% pset srcextent outfile=extent.fits
unix% pset srcextent psffile=psf.fits
unix% pset srcextent regfile=src.reg

Running the tool with verbose=3 prints the results to the screen:

unix% srcextent verbose=3
Source file, FITS image or FITS events list (acisf00635N004_evt2.fits):
PSF file, FITS image or FITS events list (optional) (psf.fits):
Region File, ellipse or circle, in FITS or ASCII (required for events list) (src.reg):
Output file, FITS table (extent.fits):
Results for Source 1

Source Observed Size: 1.10 " @ PA 16.62 deg at pixel coords 3531.8, 3782.3
    90% Confidence intervals: (1.04 -- 1.17) @ (INDEF -- INDEF)

PSF Observed Size:    1.22 " @ PA 11.00 deg at pixel coords 3531.1, 3781.0
    90% Confidence intervals: (1.20 -- 1.24) @ (INDEF -- INDEF)

Estimated Intrinsic Size: 0.00 " @ PA 0.00 deg
    90% Confidence intervals: (INDEF -- INDEF) @ (INDEF -- INDEF)

Source is not extended at 90% confidence

An estimated intrinsic size of 0 " means that there is no evidence of extent given the errors, i.e. the source is pointlike. As the screen output reports, this source is not extended within a 90% confidence interval. Note that "PA" stands for "position angle."

The "@ (INDEF -- INDEF)" portion of the output represents the confidence limits on the position angle. The tool currently does not calculate these limits, so they will always be INDEF.

The contents of the parameter file may be checked with plist srcextent.


Run srcextent without a PSF

To compare how the output changes, srcextent run again, without the PSF file:

unix% pset srcextent psffile=""
unix% pset srcextent outfile=extent_nopsf.fits

unix% srcextent verbose=3
Source file, FITS image or FITS events list (acisf00635N004_evt2.fits):
PSF file, FITS image or FITS events list (optional) ():
Region File, ellipse or circle, in FITS or ASCII (required for events list) (src.reg):
Output file, FITS table (extent_nopsf.fits):
Results for Source 1

Source Observed Size: 1.24 " @ PA 179.99 deg at pixel coords 3531.6, 3782.2
    90% Confidence intervals: (1.18 -- 1.31) @ (INDEF -- INDEF)

Since the PSF information was not available, a determination about the extent is not reported.

The contents of the parameter file may be checked with plist srcextent.


Examining the Output

In addition to being printed to the screen, the source extent information is saved in the output FITS file. Whether or not a source is extended is recorded as a boolean in the EXTENT_FLAG column of the output file, as are the ellipse parameters reported to the screen (e.g. major and minor axes and the confidence limits). This example uses the file from the first run of srcextent:

unix% dmlist extent.fits"[cols EXTENT_FLAG, X, Y, MAJOR_AXIS, MINOR_AXIS, POS_ANGLE]" data

--------------------------------------------------------------------------------
Data for Table Block TABLE
--------------------------------------------------------------------------------

ROW    EXTENT_FLAG X                    Y                    MAJOR_AXIS           MINOR_AXIS           POS_ANGLE

     1          0      3531.8198282680      3782.2614844821                    0                    0                    0

Recall that this source was determined to not be extended (EXTENT_FLAG=0), so the major and minor axis and the position angle are all 0.


Caveats

The srcextent tool is intended to provide a quick estimate for the size of the source. Users trying to determine unambiguously the point-like nature of their source or to trying to detect the presence of faint diffuse emission around a point source must perform a more rigorous evaluation of the data.

The quality of the srcextent estimate is strongly biased by the quality of the PSF used. Users should be concerned about:

  • The spectrum of the PSF must match the spectrum of the source.
  • srcextent does not take any detector effects into account. This include pileup, chip edges, bad columns/pixels, dither, etc. Users should be aware of the effects each of these has on the PSF and the data to determine if any possible extent could be related to the instrument.

Users should review the sherpa Accounting for PSF Effects in 2D Image Fitting thread to see how to do 2D modeling and fitting including a PSF.



Parameters for /home/username/cxcds_param/srcextent.par


       srcfile = acisf00635N004_evt2.fits Source file, FITS image or FITS events list
       outfile = extent.fits      Output file, FITS table
       psffile = psf.fits         PSF file, FITS image or FITS events list (optional)
       regfile =                  Region File, ellipse or circle, in FITS or ASCII (required for events list)
        (shape = gaussian)        source shape [gaussian,disk]
           (x0 = INDEF)           estimate of x-position [sky]
           (y0 = INDEF)           estimate of y-position [sky]
      (srcsize = 0)               crude estimate of source size
      (imgsize = 0)               size of image
    (binfactor = 0)               image binning factor
    (mincounts = 15)              minimum counts threshold inside ellipse
    (minthresh = 6)               minimum counts threshold for source file
      (clobber = no)              clobber output file
      (verbose = 3)               verbosity setting
         (mode = ql)
    


Parameters for /home/username/cxcds_param/srcextent.par


       srcfile = acisf00635N004_evt2.fits Source file, FITS image or FITS events list
       outfile = extent_nopsf.fits Output file, FITS table
       psffile =                  PSF file, FITS image or FITS events list (optional)
       regfile = src.reg          Region File, ellipse or circle, in FITS or ASCII (required for events list)
        (shape = gaussian)        source shape [gaussian,disk]
      (srcsize = 0)               crude estimate of source size
      (imgsize = 0)               size of image
    (binfactor = 0)               image binning factor
    (mincounts = 15)              minimum counts threshold inside ellipse
    (minthresh = 6)               minimum counts threshold for source file
      (clobber = no)              clobber output file
      (verbose = 3)               verbosity setting
         (mode = ql)
    

History

20 Apr 2009 New for CIAO 4.1.2
08 Feb 2010 updated for CIAO 4.2: changes to the ds9 region file format menu; minor changes to screen output
15 Dec 2010 updated for CIAO 4.3: added x0 and y0 to srcextent parameter file listing
04 Feb 2011 added note that only CIAO format regions are currently supported
10 Jan 2012 reviewed for CIAO 4.4: no changes
03 Dec 2012 Review for CIAO 4.5; input file version updates
11 Dec 2013 Review for CIAO 4.6; no changes.
22 Dec 2014 Review for CIAO 4.7; no changes.
21 Jun 2016 Clarified limited scope of use of tool and added a caveats section.


Last modified: 21 June 2016
Smithsonian Institute Smithsonian Institute

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