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

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/dmcontour.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 dmcontour Context: tools

Synopsis

Make contour regions from a 2-D image

Syntax

dmcontour infile levels outfile [verbose] [clobber] [kernel] [mode]

Description

`dmcontour' allows the user to generate a region file from a 2-dimensional image that can be used to subsequently filter their data from contour levels in an input image. A virtual image file created from a table file with dm syntax can be used.

The region filters are created such that they include the contour level and everything above it -- including possibly other contour levels. Only closed contours will generate regions.

For best results users should smooth their image prior to running dmcontour. The actual region will be a polygon approximation to the contour.

If the input image has a physical coordinate system (e.g. a binned Chandra event file), the output is in the physical coordinates of the image. This makes using the file as a filter for event lists/tables, as well as images which have physical coordinates preserved, easy. If an image that doesn't have physical coordinates (e.g. an optical image) is used to define the contour levels, the output is in logical coordinates. It will be difficult to display these contours on anything other than another image which is congruent to the input image.

NB: The region fits file produced by dmcontour can be loaded into ds9 directly. However, if you find a display full of excluded regions, you may wish to make a simpler regions version by choosing only one level, e.g. "dmcopy regions.fits[contour_level=10] region10.fits".

Example

dmcontour in_image.fits "1,5,10,20" out_region.fits

Will read in the image, "in_image.fits" and create an output region file that has contour intervals for each of the specified levels.

The output region file will have region filters that will inlcude everything > 1, everything > 5, everything > 10, and everything > 20.

The syntax to use this with another tool (for example to extract a histogram/spectrum) would be:

infile="my_file[sky=region(out_region.fits[contour_level=1])]"

This will filter the "sky" vector column in "my_file" with the contour level = 1 region in the file "out_region.fits"

Parameters

name type ftype def min max units reqd
infile file input         yes
levels string         image yes
outfile file output         yes
verbose integer   0 0 5   no
clobber boolean   no        
kernel string   fits fits      

Detailed Parameter Descriptions

Parameter=infile (file required filetype=input)

Input file name.

The name of the input file. It can be a table with a DM virtual file specficiation that makes it into an image, eg "[bin ...]"

Parameter=levels (string required units=image)

The contour levels to define regions. Only closed contours will generate regions.

This parameter can either be a comma separated list of values or it can be a range of values. Do not include any spaces.

value1,value2,...,valueN comma separated list of contour levels
value1:value2:value3 Generate intervals from value1 to value2 in steps of value3
:value2:value3 Generate intervals from min(data) to value2 in steps of value3
value1::value3 Generate intervals from value1 to max(data) in steps of value3.
::value3 Intervals from min(data) to max(data) in steps of value3

Parameter=outfile (file required filetype=output)

Output file name

The name of the output FITS region file.

Parameter=verbose (integer not required default=0 min=0 max=5)

Controls amount of information to print (0-5).

Parameter=clobber (boolean default=no)

Clobber output if it exists? [y/n]

Parameter=kernel (string default=fits min=fits)

Data Model kernel of output file.

Bugs

See the bugs page for this tool on the CIAO website for an up-to-date listing of known bugs.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



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.