Download OMC UM

Transcript
4.3.1
Basic Table Row Selection
Attributes and columns are referenced by name in the expression. Any string of characters not surrounded
by quotes (i.e., a constant string) or followed by open parentheses (i.e., a function name) will be initially
interpreted as a table column name and its content for the current row will be inserted into the expression
before evaluation. If no such table column exists, an attribute of that name will be searched for – and its
value used, if found. To force the string to be interpreted as an attribute name (in case there is both a
table column and attribute with the same name), precede the attribute name with a single pound sign, ’#’,
as in ’#RA’. If the column or attribute name contains a space or a character which might appear as an
arithmetic term then enclose the name in ’$’ characters as in $MAX-PHA$ or #$MAX-PHA$. Names are
case insensitive. The following boolean operators are available:
”equal”
”less than”
”greater than”
”or”
”negation”
.eq. .EQ. ==
.lt. .LT. <
.gt. .GT. >
.or. .OR. ||
.not. .NOT. !
”not equal”
”less than/equal”
”greater than/equal”
”and”
”approx. equal(1e-7)”
.ne. .NE. !=
.le. .LE. <= =<
.ge. .GE. >= =>
.and. .AND. &&
∼
The expression may also include arithmetic operators and functions. Trigonometric functions use radians,
not degrees. The following arithmetic operators and functions can be used in the expression (function names
are case insensitive):
”addition”
”multiplication”
”negation”
”absolute value”
”sine”
”arc cosine”
”arc tangent”
”exponential”
”natural log”
”modulus”
+
∗
abs(x)
sin(x)
arccos(x)
arctan(x)
exp(x)
log(x)
i%j
”subtraction”
”division”
”exponentiation”
”cosine”
”tangent”
”arc sine”
”arc tangent”
”square root”
”common log”
”random # [0.0,1.0)”
/
∗∗ ˆ
cos(x)
tan(x)
arcsin(x)
arctan2(x,y)
sqrt(x)
log10(x)
random()
Conditional arithmetic can be performed by multiplying, ’*’, boolean and arithmetic expressions together.
If the boolean subexpression evaluates to TRUE, the larger expression has the value of the arithmetic subexpression. If the boolean is FALSE, the expression evaluates to zero. For example, 7 × (5 > 3) equals 7
whereas 7 × (5 < 3) equals 0. In addition, several constants are built in for use in numerical expressions:
#pi
#deg
3.1415...
#pi/180
#e
#row
2.7182...
current row number
A string constant must be enclosed in quotes as in ’Crab’.
Table columns with vector bins (i.e., more than one data value per bin) can also be used in building the
expression. No special syntax is required to operate on all data values of the bin. Simply use the table
column name as for a scalar column. Vector bin columns can be freely intermixed with scalar bin columns
or constants in virtually all expressions. The result will be of the same dimension as the vector. Two vector
bin columns in an expression, though, need to have the same number of data values.
Arithmetic and logical operations are all performed on a data value by data value basis. Two special functions are available to operate on table columns with vector bins: SUM(x) and NELEM(x). The former literally
ISDC – Introduction to the INTEGRAL Data Analysis – Issue 10.1
30