STScI Logo

tbselect noao.digiphot.ptools



tbselect -- create a new APPHOT/DAOPHOT table database from selected rows of an old APPHOT/DAOPHOT table database


tbselect intable outtable expr


The list of APPHOT/DAOPHOT STSDAS table databases from which rows are copied.
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.
The boolean expression which determines which rows are copied to the new table. Expr is evaluated once for each input row of data. If expr is "yes" a copy is made of the old input table.


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 evaluater 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.

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

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 metacharacters. The metacharacters themselves can be matched by preceeding them with the escape character. The metacharacters are listed below.

	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	-

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

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)


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

   pt> tbselect m92out "MAG <= 20.0"

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

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


Column names must be set off from operators by blanks in the expression so that they can be correctly parsed by the expression evaluator.



Search Form · STSDAS