funfilters(7) | SAORD Documentation | funfilters(7) |

foo.fits[pha==1&&pi==2]It is also possible to put region specification inside a file and then pass the filename in bracket notation:

foo.fits[@my.reg]Filters must be placed after the extension and image section information, when such information is present. The correct order is:

- •
- file[fileinfo,sectioninfo][filters]

- •
- file[fileinfo,sectioninfo,filters]

- •
**file**is the Funtools file name

- •
**fileinfo**is an ARRAY, EVENT, FITS extension, or FITS index

- •
**sectioninfo**is the image section to extract

- •
**filters**are spatial region and table (row) filters to apply

# comment until end of line # include the following file in the table descriptor @file # each row expression can contain filters separated by operators [filter_expression] BOOLOP [filter_expression2], ... # each row expression can contain filters separated by the comma operator [filter_expression1], [filter_expression2], ... # the special row# keyword allows a range of rows to be processed row#=m:n # or a single row row#=m # regions are supported -- but are described elsewhere [spatial_region_expression]A single filter expression consists of an arithmetic, logical, or other operations involving one or more column values from a table. Columns can be compared to other columns, to header values, or to numeric constants. Standard math functions can be applied to columns. Separate filter expressions can be combined using boolean operators. Standard C semantics can be used when constructing expressions, with the usual precedence and associativity rules holding sway:

Operator Associativity -------- ------------- () left to right !! (logical not) right to left ! (bitwise not) - (unary minus) right to left * / left to right + - left to right < <= > >= left to right == != left to right & (bitwise and) left to right ^ (bitwise exclusive or) left to right ⎪ (bitwise inclusive or) left to right && (logical and) left to right ⎪⎪ (logical or) left to right = right to leftFor example, if energy and pha are columns in a table, then the following are valid expressions:

pha>1 energy == pha (pha>1) && (energy<=2) max(pha,energy)>=2.5Comparison values can be integers or floats. Integer comparison values can be specified in decimal, octal (using '0' as prefix), hex (using '0x' as prefix) or binary (using '0b' as prefix). Thus, the following all specify the same comparison test of a status mask:

(status & 15) == 8 # decimal (status & 017) == 010 # octal (status & 0xf) == 0x8 # hex (status & 0b1111) == 0b1000 # binaryThe special keyword row# allows you to process a range of rows. When row# is specified, the filter code skips to the designated row and only processes the specified number of rows. The "*" character can be utilized as the high limit value to denote processing of the remaining rows. Thus:

row#=100:109processes 10 rows, starting with row 100 (counting from 1), while:

row#=100:*specifies that all but the first 99 rows are to be processed. Spatial region filtering allows a program to select regions of an image or rows of a table (e.g., X-ray events) using simple geometric shapes and boolean combinations of shapes. For a complete description of regions, see Spatial Region Filtering.

pha==1,pi=2:4is equivalent to:

(pha==1) && (pi>=2&&pi<=4)[Note that the behavior of separators is different for filter expressions and spatial region expressions. The former uses AND as the operator, while the latter user OR. See Combining Region and Table Filters for more information about these conventions and how they are treated when combined.]

col = vv # col == vv in range col = :vv # col <= vv in range col = vv: # col >= vv in range col = vv1:vv2 # vv1 <= col <= vv2 in rangeThe vv's above must be numeric constants; the right hand side of a range list cannot contain a column name or header value. Note that, unlike an ordinary comma separator, the comma separator used between two or more range expressions denotes OR. Thus, when two or more range expressions are combined with a comma separator, the resulting expression is a shortcut for more complicated boolean logic. For example:

col = :3,6:8,10:is equivalent to:

(col=6 && col =10)Note also that the single-valued rangelist:

col = valis equivalent to the C-based filter expression:

col == valassuming, of course, that val is a numeric constant.

- •
- (pi+pha)>(2+log(pi)-pha)

- •
- min(pi,pha)*14>x

- •
- max(pi,pha)==(pi+1)

- •
- feq(pi,pha)

- •
- div(pi,pha)>0

foo.fits[pha==1,@foo]

- •
- pha==MEAN_PHA

- •
- double TIME

- •
- int X

- •
- int Y

- •
- short PI

- •
- short PHA

- •
- int DX

- •
- int DY

- •
- pha=10

- •
- pha==10

- •
- pha=10:50

- •
- pha=10:50,100

- •
- pha>=10 && pha<=50

- •
- pi=1,2&&pha>3

- •
- pi=1,2 ⎪⎪ pha>3

- •
- pha==pi+1

- •
- (pha==pi+1) && (time>50000.0)

- •
- (pi+pha)>20

- •
- pi%2==1

April 14, 2011 | version 1.4.5 |