DB_CALC

COMMAND TYPE : JUNCTION

PURPOSE:

To evaluate a new field as a function of existing ones.

DESCRIPTION:

With this command the user can create a new file selecting fields from an existing catalogue and appending a new column (a new field) evaluated as a function of the catalogue fields. All the statements and the functions described in the Query Language paragraph can be used to produce the new column. The result can be a numeric or a character field. When the user evaluates a logical expression the result are the numerical values 0 = false and -1 = true.

This task works with simple precision floating numbers (7-8 significant digits). This degree of precision can be inadequate in a few cases as the the coordinates conversion. The user can use the DB_COCO command in that case.

INPUT FIELDS of the command:

From: PDB ?

The user must enter Y when the input catalogues are in Personal Data Base.

Example : Y

Catalogue Name

The name of the input catalogue.

Example : UGC

Select:

User must enter the name of the input catalogue fields that can be extracted and written in the output file. The field names must be divided by space or by comma. The following special keywords can be used:

%ALL Return all the fields of the input catalogue

%REC Return the record number of the input cat.

Example : RA DEC MAG %REC

The CTRL-L key provides more rows to write field names.

Where:

The user can enter the constraints on the fields of the input catalogue that will be used for the search. The task will process the records that satisfy the constraints only. Refer to chapter to have the explanation about the statements and the functions available.

Example : MAG < 13 AND (MAG-MAGV) < 1.5

The CTRL-L key provides more rows to write constraints.

Evaluate:

The user must enter the expression that defines the new field that must be created. Refer to Query Language chapter for a summary of the available functions.

Example : LOG(VAR2 - VAR1) * VAR3

New variable name

The user must enter the name of the new field created by DB_CALC command. This is required only if the output file will be inserted in the PDB. We advise to use meaningful name for the new field. A valid field name is a string of eight or less characters that starts with an alphabetic character and that does not contain special symbols.

Example : LOGVAR

New variable format

The format of the new field in FORTRAN format. Only type A, F, E and I are allowable formats. The user has to define the floating (Fm.n or Em.n), integer (Im), or character (Am) format with an adequate size. The task stops, writing an error message, when an improper format is defined.

Example : F8.3

Output: File Name

The name of the output file that contains the fields selected from the input catalogue and the new field created by this task.

Example : NEWCAT2.DAT

PDB Catalogue Name

The name of the new catalogue in the Personal Data Base. When this field is filled an entry in the PDB for this new catalogue will be created and the user can continue to work on these new data with DIRA. Otherwise the output file only will be written. Valid catalogue names are strings of 12 or less characters that do not contains special symbols.

Example : NEWCAT2

NOTE:

When the task find an error in the evaluation of the new field, the output record is written, but the new field, that is undefined, is filled with blank characters. The errors can be caused by computing errors or by absence (blank fields) of the required values in the input catalogues. No error message is written during task execution. The number of records in the output file and the number of records with undefined fields are shown at the end of the task.

The user can run the DB_SELECT command and use the NULL() function to find records that have undefined values in a given field.



Previous: Commands
Up: Commands
Next: DB_CHECK
Previous Page: Commands
Next Page: DB_CHECK