aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/ptools/doc/tbselect.hlp
blob: 1a4ad6f401126e416fa253f2477a1ff503fd5768 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
.help tbselect Aug91 noao.digiphot.ptools
.ih
NAME
tbselect -- create a new APPHOT/DAOPHOT table database from selected rows
of an old APPHOT/DAOPHOT table database
.ih
USAGE
tbselect intable outtable expr
.ih
PARAMETERS
.ls intable 
The list of APPHOT/DAOPHOT STSDAS table databases from which rows are
copied.
.le
.ls outtable 
The list of output APPHOT/DAOPHOT table databases to contain the copied rows.
The number of output tables must equal the number of input tables.
.le
.ls expr
The boolean expression which determines which rows are copied to the new
table. \fIExpr\fR is evaluated once for each input row of data.
If \fIexpr\fR is "yes" a copy is made of the old input table.
.le
.ih
DESCRIPTION
TSELECT creates a new APPHOT/DAOPHOT table database containing a subset of
the rows in the old table database.
The rows are selected on the basis of an input boolean expression whose
variables are table column names.
If after substituting the values associated
with a particular row into the column name variables the expression evaluates
to yes, that row is included in the output table.

The supported
operators and functions are briefly described below. A detailed description
of the boolean expression evaluator and its syntax can be found
in the manual page for the IMAGES package HEDIT task.

The following logical operators can be used in the expression. 

.nf
	equal		  ==	not equal		!=
	less than	  <	less than or equal	<=
	greater than	  >	greater than or equal	>=
	or		  ||	and			&&
	negation	  !	pattern match		?=
	concatenation	  //
.fi

The pattern match character ?=  takes a
string expression as its first argument and a pattern as its second argument.
The result is yes if the pattern is contained in the string expression.
Patterns are strings which may contain pattern matching meta-characters.
The meta-characters themselves can be matched by preceeding them with the escape
character.  The meta-characters are listed below. 

.nf
	beginning of string	^	end of string		$
	one character		?	zero or more characters	*
	white space		#	escape character	\
	ignore case		{	end ignore case		}
	begin character class	[	end character class	]
	not, in char class	^	range, in char class	-
.fi

The expression may also include arithmetic operators and functions.
The following arithmetic operators and functions are supported.

.nf
addition		+		subtraction		-
multiplication		*		division		/
negation		-		exponentiation		**
absolute value		abs(x)		cosine			cos(x)
sine			sin(x)		tangent			tan(x)
arc cosine		acos(x)		arc sine		asin(x)
arc tangent		atan(x)		arc tangent		atan2(x,y)
exponential		exp(x)		square root		sqrt(x)
natural log		log(x)		common log		log10(x)
minimum			min(x,y)	maximum			max(x,y)
convert to integer	int(x)		convert to real		real(x)
nearest integer		nint(x)		modulo			mod(x)
.fi
.ih
EXAMPLES

1. Extract all stars brighter than twentieth magnitude from an
the output of the DAOPHOT ALLSTAR task and create a new database.

.nf
   pt> tbselect m92.al.1 m92out "MAG <= 20.0"
.fi

2. Create a new database from the output of the DAOPHOT NSTAR task by
removing all INDEF valued magnitudes.

.nf
    pt> tbselect  n2264b.nst.1 n2264out  "MAG != INDEF"

.fi
.ih
BUGS
Column names must be set off from operators by blanks in the expression so
that they can be correctly parsed by the expression evaluator.
.ih
SEE ALSO
ptools.txselect,tables.tselect,ptools.tbselect
.endhelp