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/dmsyntax.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 dmsyntax Context: dm

Synopsis

The Data Model syntax for filtering and binning files.

Syntax

dataset[block][filter-command][bin-command][opt-command][rename]
dataset[block][filter-command][cols-command][opt-command][rename]

Description

The data model (DM) is a library which lets our software access a variety of file formats and to describe filtered subsections of those files. For the user, the most obvious interaction with the DM is the virtual-file syntax which allows you to filter and bin the files.

All of the CXC tools support the DM virtual file syntax. This means that whenever you are prompted for a filename, you can instead enter a filename qualified by a set of restrictions that implicitly define a filtered table or image.

All of the qualifiers are optional.

  • "dataset" is the filename (for the IRAF kernel, it may also be a directory containing multiple imh files; for the FITS kernel, it is any file or pseudo-file handled by CFITSIO).
  • [block] is the name of the image or table. For FITS files, the block corresponds to an HDU and may be identified by name or number. The block name is created by concatenating the EXTNAME and EXTVER keywords (if EXTVER is other than 1). If omitted, the `first interesting block' is picked; in the case of an event file, this is usually the events block. If you're not sure what the block name or number is, use the "dmlist filename blocks" command to list the blocks in the file. Note that blocks are numbered from 1 to N (as in CFITSIO's subroutine API, but different from the FTOOLS user level convention of counting from 0).
  • [filter-command] defines which rows of the table, or portions of an image, to accept. For a table, a simple filter command is [filter name=min:max,min:max,min:max....] giving a set of ranges for a particular column. See `ahelp dmfiltering' and `ahelp dmimfiltering' for the full syntax.
  • [bin] is a sequence (eg [bin name=min:max:step,name=min:max:step,..] or [bin name=step,...]) defining table columns to bin to create an image file. See `ahelp dmbinning' for the full syntax.
  • [cols-command] is a sequence (eg [cols name,name,name]) where the names are names of columns to include. Alternatively, [cols -name,-name] excludes a set of columns. See `ahelp dmcols' for the full syntax.
  • [opt-command] is a sequence (eg [opt option-list]) describing special options for the DM library. See 'ahelp dmopt'.
  • [rename] is a name for the new block. If omitted, the default name of the output block is just the name of the original block, except if you are binning a table to an image when the string _IMAGE is appended. Example: "evt1.fits[events][energy=1000:2000][bin x=1:1024:2,y=1:1024:2]" creates an image block called EVENTS_IMAGE, but "evt1.fits[events][energy=1000:2000][bin x=1:1024:2,y=1:1024:2][softimg]" creates an image block called SOFTIMG.

Example 1

evt.fits[events][pha=30:200,time=10:20,50:60][bin
x=1:100:20,y=2:50:10][myimage]

This example picks a table called "events" in the file evt.fits, and specifies a filtering and binning of the file. The filter says to pick rows in the table for which the value of the pha column is >= 30 and < 200, and in addition for which the value of the time column is either >= 10 and < 20 or >= 50 and < 60. Both the pha and time filters must be satisfied for a row to pass the filter. The binning command says that for each row passing the filter, use the values of the x and y columns to find out which pixel of the result image the row contributes to. Finally, the [myimage] specifies that the name (FITS EXTNAME and HDUNAME) of the resulting image is "myimage".

Example 2

[(x,y)=circle(412.2,512.11,20.3)]

This example illustrates region filtering. Here a two-dimensional column is filtered using regions syntax. In this example, only records whose x,y values are in a circle of radius 20.3 centered on 412.2, 512.11 are selected.

Example 3

[(x,y)=region(saoimage.reg)]

A special "region" type is the file region, allowing you to filter on ascii region files created by programs like SAOIMAGE and DS9. In this example only records whose x,y values are contained within the region saved in the file saoimage.reg are selected. See `ahelp dmregions' for more information.

CHANGES IN CIAO 3.4

IRAF QPOE Files

Support for IRAF QPOE files has been removed from CIAO.

Bugs

See the bugs page for the Data Model library 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.