Introduction to Filtering

Rows (e.g., X-ray events) in column-based data (i.e., FITS Binary tables and raw event files) can be filtered or selected based on a flexible set of user-specified criteria that allows column values to be compared with numeric values, header parameters, functions, or other column values. Both image and tables can be filtered using ASCII spatial region filters.

To filter tables and images, the filter specification is added to the FITS filename using bracket notation:

  foo.fits[pha==1&&pi==2&&circle(512,512,10)]
The filter specification comes after the extension and image sections and may optionally be enclosed in its own set of brackets. Thus:
  foo.fits[EVENTS,400:599,400:599,pha==1&&pi==2&&circle(512,512,10)]
  foo.fits[EVENTS,400:599,400:599][pha==1&&pi==2&&circle(512,512,10)]
  foo.fits[BKGD][400:599,400:599,circle(512,512,10)]
  foo.fits[BKGD][400:599,400:599][circle(512,512,10)]
define filters on an image section of size 200x200 defined on the FITS EVENTS (binary table) and BKGD (image) extensions. Order is important here: extension name is followed by section, which is followed by filters.

To implement both row and spatial filtering, funtools utilizes a technique in which the filter specification is converted into a small C program, which is compiled and linked automatically so that table rows or image sections can be fed to this program and filter results returned to the calling program. The power of the technique lies in these considerations:

Three variations on this scheme of dynamic filters are supported:

These choices are explored automatically by the filter init routines.

Table Filtering can be performed on columns in a FITS binary table file by comparing the value of a column to other columns, header values, constant values or function values. Table columns and image pixels also can be filtered with geometric Spatial Region Filters.


Index to the Funtools Help Pages
Last updated: March 30, 2001