User's Guide for the ADC FITS Table Browser, Version 3

Adapted from the original documentation by Lee Brotzman

July 1995, Teheran K. Simmons


CONTENTS

  1. INTRODUCTION
  2. GETTING STARTED
  3. ...MS DOS
  4. ...UNIX
  5. A BRIEF DESCRIPTION OF FITS TABLES
  6. RUNNING FTB
  7. ...Screen Layout
  8. ...Status Line
  9. ...Command Syntax, Abbreviations
  10. ...Passing Commands to the Operating System and On-Line Help
  11. ...The SET Command
  12. ...FITS Test File and Opening File for FTB Access
  13. ...Using On-Line Help
  14. ......Index to On-Line Help
  15. OPENING FITS FILES FOR FTB ACCESS
  16. ...The LIST Command
  17. ...The LIST HEADER Command
  18. ...The Current Table
  19. ...Changing Tables
  20. ...Browse Mode and Command Mode
  21. ...The DISPLAY Command
  22. ...The SELECT Command
  23. ...The EXTRACT Command
  24. ...Batch Mode Processing
  25. COMPLETE ON-LINE HELP COMMAND REFERENCE
  26. ...HELP
  27. ...EXIT
  28. ...RIGHT
  29. ...BOTTOM
  30. ...EXTRACT
  31. ...SELECT
  32. ...BROWSE
  33. ...LEFT
  34. ...SET
  35. ...CD
  36. ...LIST
  37. ...SYSTEM
  38. ...CLOSE
  39. ...OPEN
  40. ...TAKE
  41. ...DISPLAY
  42. ...QUIT
  43. ...TOP
  44. ...DOWN
  45. ...REMARK
  46. ...UP
  47. CONTRACT INFORMATION
  48. ...UPDATES
  49. BUG REPORT FORM

INTRODUCTION

This program reads standard FITS ASCII tables and allows the user to browse through them interactively, selectively displaying any field or record. Users may write all or part of the input table to disk in FITS or text file format. Copies of the program for MS-DOS and UNIX are available by anonymous FTP on adc.gsfc.nasa.gov in directory "/pub/adc/software/browsers/ftb." Version 1 of the program was written in Turbo Pascal and was released along with the ADC CD-ROM Test Disk. Version 2 was mainly a rewrite of Version 1 in Turbo C and was limited to MS-DOS platforms. This version uses the curses screen management package and has been compiled and run on MS-DOS 4.01 and 5.0, Silicon Graphics IRIX 4.0.1 (System V), Sun Microsystems SunOS 4.1.2 (BSD), DECstation 5000 Ultrix 2.4 (BSD), and Linux 0.99pl8 (System V, mostly). The look and feel is similar to Version 2, being a command-based interface (loosely modeled on the KEDIT text editor for PCs).

GETTING STARTED

MS-DOS

Users can get the file ftb3.zip by anonymous FTP from adc.gsfc.nasa.gov in directory "/pub/adc/software/browsers/ftb," then create a directory on the hard disk called FTB and unzip the contents of this file into that directory. For example (assuming the ftb3.zip is in the root directory of drive C:):

		C:\> MKDIR FTB
		C:\> CD\FTB
		C:\FTB> PKUNZIP ..\FTB3
Source code for FTB 3.0 is contained in the file ftb3src.zip (included inside the main ZIP archive). To compile FTB on an MS-DOS platform, users will need Borland C and a set of curses libraries. The curses libraries are part of the pccurs14.zip file. The libraries used for development are in the file pccurs14.zip in the same directory on ADC where FTB was found. Before running FTB, users should add the FTB directory to their paths by editing the PATH statement in their autoexec.bat file. At startup FTB will look for its help file first in the directory pointed to by an environment variable called "FTB" and then by inspecting the path. To ensure proper operation of FTB users should add the following two lines to the bottom of their autoexec.bat files and reboot the computer:
		SET FTB=C:\FTB
		PATH=%PATH%;%FTB%

UNIX

First of all, users will need an ANSI C and Gnu C compilers, available for just about any platform from

	FTP://prep.ai.mit.edu/pub/gnu
Users can get the file ftb3.tar.Z by anonymous FTP from adc.gsfc.nasa.gov in directory /pub/adc/software/browsers/ftb. The following command will uncompress and untar the source code into a subdirectory called "ftb":
		$ zcat ../ftb3.tar | tar xf -
Next, users can bring the make file (makefile or makefile.unx) into their favorite editor and examine the definitions for the CC, CFLAGS, and LFLAGS macros. Examples for SGI, Sun, Ultrix, and Linux are given; users can make adjustments as desired. (Users are asked to please disclose any changes so that thay can be incorporated into subsequent releases, especially on the Sun, where some work had to be done with the library and include paths to get to System V curses.) Then, the users can type "make" and see what happens.

If the compile finished successfully, users should set an environment variable to point to the FTB directory and add the FTB directory to their path. Without the environment variable, the ftb executable and the help file ftb.hlp have to be in a directory on the path. An example from a ".login" file under csh and Ultrix 4.2 is as follows:

		setenv FTB ~/ftb
		set path = ($path $FTB)
An example from a ".profile" under bash (the Bourne-Again Shell) and Linux is as follows:
		set FTB=~/ftb
		set PATH=$PATH:$FTB
Note that in both cases the redefinition of the PATH variable takes place after any other PATH settings. Generally, these statements are last in the startup script.

During tests some problems have been identified with using FTB 3.0 on machines with 64-bit architecture, like the DEC-alpha running under OSF-1 operating system. See section 7.1 for update information.

A BRIEF DESCRIPTION OF FITS TABLES

The FITS format is endorsed by the International Astronomical Union as the standard interchange format for astronomical data. Details of the format and information about related software can be found at the FITS Support Office WWW site:
       http://www.gsfc.nasa.gov/astro/fits/fits_home.html. 
There are several FITS formats. The Fits Table Browser is designed to read only FITS files with a FITS TABLE extension, not to be confused with the FITS BINTABLE extension. The FITS TABLE extension includes the tabular data in ASCII form. A FITS file is partitioned. The first part is the PRIMARY HEADER, followed possibly by several 2,880-byte-large blocks of data. If the FITS file has an extension, as will be the case for FITS files with the FITS TABLE extension, the existence of the extension is noted in the PRIMARY HEADER, and the FITS TABLE EXTENSION follows the PRIMARY HEADER. The FITS TABLE EXTENSION starts with its own header, followed by the data. This header specifies the table format and its contents and is interpreted by FTB to unpack the data. Multiple FITS TABLE EXTENSIONS can follow the PRIMARY HEADER. After the last extension, extra records of 2880-bytes may follow. The total byte count of a FITS file is a multiple of 2880. The first record in the primary header identifies the file as FITS by the key "SIMPLE = " in the first 10 bytes and "T" in byte 30.

RUNNING FTB

Screen Layout

Once the program is installed, the MS-DOS and UNIX versions operate identically. When the program is executed, the following information will appear on the screen:

Status Line

==============================================================================
Path: /home/leb/ftb              Files:  0  Tables:  0  Lines: 1/17
FTB>
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8

			  ADC FITS Table Browser, Version 3.0

				     Written by

				  Lee E. Brotzman
				    Hughes STX

			     Astronomical Data Center
			 NASA/Goddard Space Flight Center

		     Work performed under Contract NAS5-30960

		  This program is public domain, but no warranty,
		expressed or implied, is made by NASA or the ADC as
		 to the accuracy and functioning of the software.

===============================================================================
The top line, also known as the status line, gives the current path, the number of files currently open, the total number of tables contained in those files, and the size of the current screen buffer (17 lines total and the top line is line 1).

Command Syntax, Abbreviations

FTB commands are blank-delimited, case-insensitive strings. You only have to give enough characters of the command to make it unique; "HELP," 'Help," and "h" are all equivalent to "help," whereas "L" means "LEFT" and "LI" means "LIST." The shorthand may be confusing at first, but it makes typing commands a lot easier once a user is familiar with it.

Passing Commands to the Operating System

Any command that FTB does not understand it simply passes on to the operating system, so "dir" under MS-DOS or "ls" under UNIX can be used to get directory listings, etc. If the name of an OS command conflicts with an FTB command, a user can still execute it with the "SYSTEM" command; for example, "SYSTEM list ftb.hlp" would invoke the "list" program from an OS command shell. The first command you should enter is "HELP." This will show you all the commands available to FTB. The commands "UP," "DOWN," "LEFT," "RIGHT," "TOP," and "BOTTOM" will scroll through the screen text (or you can look at the "HELP SCREEN" below).

FTB has a default command that is executed by just hitting a carriage return. The default command is meaning initially "DOWN HALF," that the display should scroll down half a "page." So a user can scroll through the help text returned by the "HELP" command just by hitting a few carriage returns.

The SET Command

The SET command can be used to reset the default command and a few other options. Entering "help set" or referring to the section in this document dedicated to the SET command will provide a description.

FITS Test File and Opening File for FTB Access

FTB is distributed with a small FITS file to use for testing. This is the file pln.fit, which is the Strasbourg Planetary Nebulae catalog. A FITS file is opened by using the command "OPEN ". Typing "OPEN pln.fit" will open the file, decode the FITS header information, and display a listing of the COMMENT keywords found in the primary header.

Using On-Line Help

The FTB user should be aware that FTB is tailored to work best with the FITS tables found on the ADC CD-ROM, Selected Astronomical Catalogs, Volume 1.

Those tables have overall descriptions of the catalog in COMMENT keywords in the primary header, hence the behavior of the "OPEN" command, which lists some of that information. There are some other features of the CD-ROM FITS tables of which FTB takes advantage, like the tagged field COMMENT cards in the table headers (i.e., the card contains the table field name as a tag in each record that is used by FTB: "COMMENT OBJECT: text " would indicate a comment "text" on the field "OBJECT" in the table. If FTB acts strangely or crashes while browsing other tables and if the tables are legal FITS, the ADC would appreciate a copy of that FITS table so that staff can fix the problems.

Index to On-Line HELP (See section 6.0 On-Line Help.)

The HELP command gives information about the following FTB commands:

 BOTTOM     BROWSE    CD          CLOSE      DISPLAY         
 DOWN       EXIT      EXTRACT     HELP       LEFT            
 LIST       OPEN      QUIT        REMARK     RIGHT           
 SELECT     SET       SYSTEM      TAKE       TOP             
 UP

Basic Operation
---------------
 OPEN       Open a FITS file, which may contain more than one table 
 BROWSE     Browse through table records 
 CLOSE      Close a table and free its allocated resources
 EXIT/QUIT  Leave FTB

Manipulate Table Fields and Records
-----------------------------------
 DISPLAY    Define the fields to display with BROWSE and EXTRACT
 SELECT     Place constraints on field values to limit searches
 EXTRACT    Write selected records to a disk file
 UP         Scroll the display up
 DOWN       Scroll the display down
 LEFT       Scroll the display left
 RIGHT      Scroll the display right
 TOP        Scroll to the top of the display
 BOTTOM     Scroll to the bottom of the display

Get Further Information
-----------------------
 LIST       List information about tables, fields, and headers 
 HELP       Get help on FTB commands

Batch and External Commands
---------------------------
 SET        Set various operational parameters
 TAKE       Take commands from a text file (batch processing)
 REMARK     Ignore the remainder of the input line; used in FTB batch files 
 SYSTEM     Execute an operating system command or shell to an OS prompt 
 CD         Change the current working directory

Opening FITS Files for FTB Access

The LIST command

Once the table is open, the LIST command will provide information about the number and names of active tables, information about individual tables, and lists of field descriptions. If needed, the output of the "LIST" command can be redirected to a disk file. An example follows below:

		
		LIST APPEND FILE [file name]
("LIST" is the command; "APPEND" is the way the file is placed in the file - appended to end of the file specified; "FILE" is the operator that tells FTB the user is redirecting to a file; and "[file name]" is the actual file name the user specifies.)

The LIST HEADER Command

As a component of the LIST command, LIST HEADER gives the user access to the header information about the opened FITS table(s). It is very helpful (although not necessary) to view the header information to get an idea of the items that are available in the file.

The Current Table

FTB keeps track of tables by setting a pointer to the "current table." Initially, the current table is set to be the first table of the most recently opened FITS file. (FTB can open more than one FITS file, and any file can have more than one table, up to a limit of 20 individual tables.) The "LIST" command marks the current table with an asterisk. Most FTB commands have a "TABLE" option that defines to which table the command should be applied. This will automatically reset the current table.

Changing Tables

The following steps are necessary to change between tables:

1. Invoke LIST Command (to see list of available tables in open file).
2. Invoke LIST TABLE [table #] to actually switch table to
   user-specified number "[table #]." 

Browse Mode and Command Mode

The BROWSE command displays the records of the table. This puts FTB into BROWSE mode, as noted by the change in the prompt from "FTB>" to "BROWSE>". The UP, DOWN, LEFT, RIGHT, TOP, and BOTTOM commands work as normal, but any other command that writes information to the screen (e.g., "HELP") will clear browse mode. The main difference between browse and command modes is how the information on the screen is retrieved. In command mode an entire "internal text file" is built with all the screen text. In browse mode each record is retrieved individually from the FITS file and displayed immediately.

The DISPLAY Command

The DISPLAY command can be used to set which fields to display. For instance, for pln.fit

		FTB> DISPLAY PK RAH RAM DecSign+DecD DecM V
will restrict the display to just the PK number, equatorial coordinates, and visual magnitude. The "+" between DecSign and DecD tells FTB to display those two fields right next to each other without an intervening blank space. It is also possible to put specific fields into specific screen columns. See "HELP DISPLAY'" for more information.

The SELECT command

The SELECT command is used to restrict which records to display by placing constraints on field values. For example,

 
		FTB> SELECT V >= 18
will restrict the display to only those nebulae with visual magnitudes greater than or equal to 18. It is possible to test a field against the "null" value in the TNULL record of the FITS header. For example, using only the following,
		FTB> SELECT V < 18
will select records with the visual magnitude less than 18. However, since the default, that is, TNULL, value of the field is blank, default fields convert to 0 and will pass this test, which is probably not what a user would want. Entering the following will get only those records with valid visual magnitudes less than 18.
		FTB> SELECT V < 18 &  NOT NULL(V)
This will select visual magnitudes less then 18 that are not equal to the NULL value. The NULL() "pseudo-function" tests the given field for exact string equality with the value of the corresponding TNULL keyword and returns true for a match and false otherwise.

The operators for the select command have alphabetic equivalents, so the SELECT command above can also be entered like this:

		FTB> SELECT V LT 18 AND NOT NULL(V)
Or boolean operations such as the following are allowed:
		FTB> SELECT (V LT 18) & (NOT NULL(V))
Note that after entering a SELECT command, "BROWSE" must again be executed to see the selected records.

The EXTRACT command

The EXTRACT command will write to disk all selected records exactly as they would have been displayed on the screen. For instance, if the above DISPLAY and SELECT commands are in force,

		FTB> EXTRACT test.fit
will extract the PK number, equatorial coordinates, and non-null visual magnitudes for all nebulae with V < 18 into the file test.fit, which is in FITS format. Open test.fit and go into browse mode to confirm the operation. It is also possible to extract the data into a plain text file with the command
		FTB> EXTRACT TEXT test.txt


EXAMPLE: 

By following the procedures below, users can search and extract data. 

1. OPEN the desired table. (It MAY already be open.)
2. SELECT data needed by setting desired criteria (using boolean
   search). 
3. DISPLAY data on the screen (to see if it iss the right data).
4. EXTRACT to disk in the following format:

	    EXTRACT APPEND DUMP [(full path):\(filename)]

Example: EXTRACT APPEND DUMP [c:\temp\fits\fitsfile.txt]
(EXTRACT is the command; APPEND is the way the file is placed in the file - appended to end of the file specified; DUMP is the operator that tells FTB to write the specified data to the file with labeled column headings; "[(full path):\(filename)]" is the actual path and file name the user specifies.)

See "HELP EXTRACT" for more information.

Batch Mode Processing

FTB has a "batch mode" that allows putting a sequence of FTB commands into an ordinary text file and executing them. The "TAKE" command will accept the name of the batch file, or a user can invoke batch mode when the program is started up with the "-t" command line parameter. For example,

		$ ftb -t pln.ftb
will start up FTB and execute the commands in file "pln.ftb," which is included in the standard distribution. The most important command is "EXIT," which has an alias of "QUIT."

ON-LINE HELP

Command: HELP [command]

Default: Command list

The HELP command gives information about the following FTB commands:

 BOTTOM   BROWSE   CD     CLOSE   DISPLAY   DOWN     EXIT    EXTRACT 
 HELP     LEFT     LIST   OPEN    QUIT      REMARK   RIGHT   SELECT
 SET      SYSTEM   TAKE   TOP     UP

Command: BOTTOM

Default: Bottom of current display

The BOTTOM command scrolls immediately to the bottom of the current display screen. In BROWSE mode and with a SELECT command in force, the full screen may not be displayed since some (or all) records may be "selected out."

Command: BROWSE [TABLE table-id] [RANGE start-finish]

Default: Current table; all records in the table

The BROWSE command allows a user to browse through the given table. The table-id can be either the table number or the table name. If no table identifier is given, the current table is browsed. (See SET TABLE.) If the search begins at record "start" and runs through record "finish" inclusive, the default is to start at record 1 and proceed to the end of the table.

The fields that are displayed can be controlled with the DISPLAY command, and constraints can be placed on field values to select only certain records using the SELECT command. Table record numbers can be displayed with the SET NUMBER command. (See HELP SET.)

Once the BROWSE command is invoked, FTB goes into "BROWSE mode," and the prompt changes from "FTB>" to "BROWSE>". The main difference is that records are pulled in from the FITS table file individually and displayed immediately rather than being read into memory all at once. The SET UPDATE command controls when the screen is updated. "SET UPDATE ON" will update the screen as soon as a record is retrieved from the FITS file. "SET UPDATE OFF" will delay updating until an entire screen full of records has been retrieved or the supply of records is exhausted, whichever comes first. In general, SET UPDATE ON should be used if a SELECT command is in force that will select only a few records and the FITS file is being read from a slow device like a CD-ROM drive. For regular browsing without SELECT, SET UPDATE OFF will avoid annoying and slow screen updates on graphical devices such as X terminals.

Command: CD directory-path

Default: None

The CD command changes the current working directory for FTB, as given in the "Path:" portion of the status line at the top of the screen. Relative path names are allowed.

Command: CLOSE [TABLE table-id]

Default: Current table

The CLOSE command closes the given table and frees all allocated memory attached to the table. Closing a table affects the ordering of the table identifiers for other open tables. For example,

    CLOSE TABLE 2 
will free all resources for table 2 and delete it from the list. Subsequent LIST commands would show that item 2 is no longer on the list of tables, but tables 3, 4, ... are left intact and have been renumbered as tables 2, 3, ...

Command: DISPLAY [TABLE table-id] [CLEAR] field-id ...

Default: List of current display fields

The DISPLAY command allows the user to specify which fields are displayed by BROWSE. The table-id can be either the table number or the table name. If no table identifier is given, the field specifications apply to the current table.

Note that DISPLAY commands for a table are cumulative; that is, each DISPLAY command puts the requested fields at the end of the previous display. The CLEAR option clears memory of all previous field specifications.

Field specifications may consist of the field number or name followed by a separator character and perhaps more information. A counter is maintained that holds the next available screen column for a display. If a field will not fit because some other field is in the way, it is moved to the right automatically until a place is found for it or until there is no more room.

Field separator characters can be one of the following:

1. One or more blanks to indicate that a blank column should appear
   after the field. 

2. A plus sign (+) to indicate that the next field should be placed
   adjacent to this field. 

3. A comma (,) to indicate a range of fields to display, each
   separated by a single blank. 

4. A slash (/) followed by a column number to indicate that the field
   should be placed in that column. 
In cases (1), (2), and (3) above the display counter is incremented to point to the next available display position. In case (4) the display counter is not changed.

For example, if the display counter starts at 1, the left margin, the following field specifications

    DISPLAY RAH RAM DecSign+DecD DecM Mag/30 
will result in field RAH displayed starting in column 1 and field RAM following, separated by a blank column. DecSign and DecD will be displayed together without any intervening blank column. DecM will be separated from Decd by a blank column, and Mag will be displayed starting in column 30. The display counter is set to point to the column following DecM.

If those same six fields are adjacent to each other in the table (which can be verified with the LIST FIELDS command), then the following field specification

    DISPLAY RAH,Mag 
will display all six fields, each separated by a single blank.

Command: DOWN [PAGE | HALF | rows]

Default: Scroll down half a page

The DOWN command scrolls the display down by either a full screen "PAGE," half a page, or by the given number of rows. In BROWSE mode and with a SELECT command in force, the scrolling may not work as expected, since records may be "selected out" of the display.

Command: EXIT

Default: None

The EXIT command terminates FTB, closing all open files and restoring the original default drive and directory.

Command: EXTRACT [TABLE table-id] [APPEND] [FITS|TEXT|DUMP] [RANGE start-finish] [filename]

Default: Current table; FITS mode; all selected records; prompt for file name

The EXTRACT command writes display fields (see DISPLAY) from selected records (see SELECT) into the named file. The output can be in FITS mode, which will write a standard FITS ASCII table; TEXT mode, which will write a text version of the FITS header; and a separate text file for the data, or DUMP mode, which will dump the selected records with labeled column headings. The APPEND option in FITS mode will append an additional ASCII Table extension to the given FITS file and in TEXT or DUMP mode will append data records to the given output text file.

Note that if the APPEND option is used in TEXT mode and the display format has changed from a previous invocation of the EXTRACT command, the text file will have an inconsistent format and will not agree with the text file version of the FITS header.

The RANGE search begins at record "start" and runs through record "finish" inclusive; the default is to start at record 1 and proceed to the end of the table.

File names should be given without extensions, and EXTRACT will append standard extensions to the output file name(s). In FITS mode the extension is ".fit". In TEXT mode the extensions are ".hdr" and ".dat" for the header and table file, respectively.

Example:

   EXTRACT TABLE 2 RANGE 200-550 savedata 
This will extract the records in table 2 into the FITS file "savedata.fit". The search begins at record 200 and proceeds through record 550. The number of records extracted depends on the criteria set by the SELECT command.

Command: LEFT [PAGE | HALF | columns]

Default: Scroll left half a page

The LEFT command scrolls the display left by either a full screen "PAGE," half a page, or by the given number of columns.

Command: LIST [TABLE table-id] [ FIELDS | HEADER | INFO ] [SCREEN | [APPEND] FILE [filename]]

Default: List of tables; output to screen

By default the LIST command lists the active tables by number and by name (if available). It will also print a listing of the field information, the actual FITS header for a specific table, or a more human-readable version of the table header information.

Output can be directed to the screen or a disk file. (MS-DOS users can direct the output to a printer by writing the output to a printer device file, such as PRN or LPT1.) To send output to a file, the FILE option should always appear last on the command line. If no file name is given, the user is prompted for one. The APPEND option will append the information to the end of the named output file.

Example:

   LIST TABLE 2 HEADER FILE tabinfo.hdr 
This will generate a listing of the FITS header for TABLE 2 in the TEXT FILE "tabinfo.hdr" in the current working directory.

Command: OPEN [filename]

Default: Prompt for file name

The OPEN command opens a FITS file, scans the file for standard ASCII tables (XTENSION= 'TABLE '), and decodes the table headers to determine the information needed to browse through the table.

The file must be accessible through the current working directory (as given following "Path:" in the status line at the top of the screen) or by explicitly giving the absolute or relative path name.

Command: QUIT

Default: None

The QUIT command is a synonym for EXIT, which terminates FTB, closing all open files and restoring the original default drive and directory.

Command: REMARK [comments in any format]

Default: None

The REMARK command is used to include comments in FTB batch files. (See TAKE.) REMARK can be entered at the FTB command prompt, although it is not very useful to do so.

Command: RIGHT [PAGE | HALF | columns]

Default: Scroll right half a page

The RIGHT command scrolls the display right by either a full screen "PAGE," half a page, or by the given number of columns.

Command: SELECT [TABLE table-id] [ CLEAR | conditions ]

Default: List of current selections

The SELECT command specifies which records are displayed by placing constraints on field values. Only those records meeting the criteria set down by the conditions will be displayed by the BROWSE command or written to disk by the EXTRACT command.

Note that, unlike the DISPLAY command, SELECT commands for a table are NOT cumulative. Each SELECT command introduces an entirely new set of selection criteria. The CLEAR option clears out all previously defined conditions. A maximum of 50 operands and operators for one selection expression is allowed. If an expression is longer than the command line, use continuation characters to extend the command to additional command lines. (See SET CONTINUE.)

The conditions are given by a logical expression specifying field names and test values. Take care that the data type of a field and its test value are the same; namely character-valued fields ("A" formats) are compared to strings enclosed in single or double quotes and numeric fields are compared to numbers. It is also possible to compare one field against another of the same type.

Relational operators can be alphabetic or symbolic, and both notations are accepted interchangeably. Alphabetic operators (AND, OR, etc.) must be separated from their operands by white space. The recognized operators are given as follows:

  Operator  Meaning                 Operator  Meaning
  -------------------------------   ----------------------------------
  AND && &  logical and             OR || |   logical or
  EQ  == =  equal to                NE != < >  not equal to
  LT  <     less than               GT >      greater than
  LE  < =    less than or equal to   GE >=     greater than or equal to
  SE        strictly equal to       IN        contains substring
  NOT !     unary not               NULL()    test against null value
Use of parentheses to group logical operations is allowed. Operator precedence is the same as C and Fortran.

For strings the operators EQ, NE, LT, GT, LE, and GE ignore case and trailing blanks. The operators SE and IN are used only for string comparisons. For SE, strictly equal to, case, and trailing blanks are significant; therefore, the comparison value must have the same length as the field value. IN, for testing substrings, is case insensitive.

The NULL() pseudo-function tests a field against its NULL value (given in the TNULL record of the FITS header). It returns TRUE if the field equals the NULL value and FALSE otherwise. The single parameter of the NULL() pseudo-function is the field name. See the examples given below.

If the expression is evaluated as FALSE, the record has failed the test and will not be selected for display or extraction. If the expression is evaluated as TRUE, then the record is selected.

For example, to display only the records in Table 1 for objects appearing west of three hours of right ascension, up to and including six hours of RA, and north of 15 degrees declination, enter the following:

 SELECT Table 1 RAH gt 3 and RAH le 6 and DecSign eq '+' and DecD gt 15 
To select all stars with visual magnitude brighter than 7 and B-V greater than U-B, enter the following:
   SELECT (V < 7) && (B_V > U_B) 
To select all stars that have B-V equal to zero but that are not blank (which is the null value), enter the following:
   SELECT B_V = 0 && !null(B-V) 
To eliminate the selection criteria and display all records, enter the following:
   SELECT CLEAR 

Command: SET [parameter value]

Default: List current settings

The SET command is used to set certain global operational parameters. If no parameters are given, a list of the current settings is displayed.

Parameter   Value     Initially     Description
---------+----------+---------------------------------------------------
CONTINUE | char     |     \     | Command line continuation character
DEFAULT  | command  | DOWN HALF | Default command
ECHO     | ON|OFF   |    OFF    | Batch file command echo
NUMBER   | ON|OFF   |    OFF    | Display record numbers in browse mode
TABLE    | table-id | undefined | Current table identifier
UPDATE   | ON|OFF   |    OFF    | Control screen updating in browse mode
WRAP     | ON|OFF   |    OFF    | Word wrap
---------+----------+---------------------------------------------------
CONTINUE is a character to place at the end of a command line to indicate that additional parameters are following on the next line.

DEFAULT is a command to execute whenever a blank line is entered (by hitting a carriage return by itself).

ECHO starts or stops command-line echo in FTB batch files. It has no effect on commands entered interactively. When ON, every command line read from a batch file is echoed to the screen before it is executed. Command-line echo is useful for tracing the execution of an FTB batch file.

NUMBER displays record numbers in browse mode, useful for finding which records have been returned by the SELECT command.

TABLE sets the current table. The table-id can be the table name or the table number.

UPDATE controls screen updates in BROWSE mode. See HELP BROWSE.

WRAP controls word wrap for lines too long to fit on a single screen. WRAP OFF will write long records out beyond the right-hand edge of the screen, where they can be brought into view with the RIGHT command. WRAP ON is useful in BROWSE mode for seeing all of a table record at once; however, since the record is broken on word boundaries, the wrapped records may not line up exactly.

Command: SYSTEM [OS-command]

Default: Shell

The SYSTEM command allows the user to execute any legal operating system (OS) command, program, or batch/script file. The user should note that any command entered at the main FTB prompt that is not recognized as a valid FTB command is automatically passed on to the operating system. The explicit SYSTEM command is included to allow the user to execute a program whose name conflicts with a valid FTB command, for example LIST, and also to "shell" out to an active OS command prompt. To reach an OS shell, simply enter "SYSTEM" without any operands. To return to FTB, enter the OS command "exit" or "logout", whatever is appropriate.

Command: TAKE [filename]

Default: Prompt for file name

The TAKE command opens a text file containing a series of FTB commands and executes them one at a time (batch processing). This is a convenient way of opening a table file and setting up the display for tables that are used often.

All valid FTB commands are accepted, including those commands that are passed on to DOS. Comments can appear in the batch file using the REMARK command. Long commands can be spread out over several lines by placing the continuation character. (See HELP SET.) at the end of each line to be continued. No command line can total more than 255 characters in length.

Command: TOP

Default: Top of current display

The TOP command scrolls immediately to the top of the current display screen.

Command: UP [PAGE | HALF | rows]

Default: Scroll up half a page

The UP command scrolls the display up by either a full screen "PAGE," half a page, or by the given number of rows. When in BROWSE mode and if a SELECT command is in force, the scrolling may not work as expected since records may be "selected out" of the display.

CONTACT INFORMATION

For further information or questions, contact
Astronomical Data Center
Code 631
NASA/Goddard Space Flight Center
Greenbelt, Maryland 20771, U.S.A.

Internet:  help@adc.gsfc.nasa.gov

FTB UPDATES

Updates to FTB will be announced in the ADC Electronic Newsletter and ADC World-Wide-Web pages and will be made available for retrieval from the ADC ftp-site.

WWW: http://adc.gsfc.nasa.gov/adc.html
ftp://adc.gsfc.nasa.gov/pub/adc/software/browsers/ftb

BUG REPORT FORM

Please use the following form for reporting bugs.

-------------------------------< Cut Here >---------------------------------
			   FTB 3.0 BUG REPORT
 Return to:  (One or both of the addresses in this file.) 


	Name:
	E-Mail:

	Platform:
	  (e.g., IBM-PC, Sun, Indigo)
	Op. Sys.:
	  (e.g., MS-DOS 5.0, Ultrix 4.2A)
	Compiler (for UNIX systems):
	  (e.g., GCC 4.3.3)
	Shell (for UNIX systems):
	  (e.g., ksh)

	FITS File:
	  (By name if on ADC CD-ROM or else describe the file and its source)
	FTB Command(s):
	  (If possible, give the sequence that generates the error.)

	Description of error -- please be as specific as possible: