~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to prim/help/computtabl.hlq

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
% @(#)computtabl.hlq    19.1 (ESO-IPG) 02/25/03 14:03:04 
 
2
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
3
%.COPYRIGHT  (c)  1990 European Southern Observatory
 
4
%.IDENT      computtabl.hlq
 
5
%.AUTHOR     MP, IPG/ESO
 
6
%.KEYWORDS   MIDAS, help files, COMPUTE/TABLE
 
7
%.PURPOSE    On-line help file for the command: COMPUTE/TABLE
 
8
%.VERSION    1.0  05-Aug-1992 : Creation, MP
 
9
%----------------------------------------------------------------
 
10
\se
 
11
SECTION./TABL
 
12
\es\co
 
13
COMPUTE/TABLE                                           05-Aug-1992 MP
 
14
\oc\su
 
15
COMPUTE/TABLE table column = expression
 
16
        compute arithmetic or string operations on table columns
 
17
\us\pu
 
18
Purpose:      
 
19
              Perform arithmetic or string operations on columns in a table. 
 
20
              The output column will be created if it doesn't exist.
 
21
\up\sub
 
22
Subject:      
 
23
              Table, column, arithmetic, string
 
24
\bus\sy
 
25
Syntax:       
 
26
              COMPUTE/TABLE table column = expression
 
27
\ys\pa
 
28
              table = table name
 
29
\ap\pa
 
30
              column = output column, either already existing or a new one
 
31
                       created by the command (In that case, the column has
 
32
                       to be referred to by label) .
 
33
\ap\pa
 
34
              expression = FORTRAN compatible expression , in
 
35
                       which the variables are columns in the table.
 
36
 
 
37
\ap\no
 
38
Note:         Expression may contain arithmetic operators, logical operators 
 
39
              and mathematical functions. 
 
40
              The supported arithmetic operators are +, -, *, / and **.
 
41
              The supported mathematical functions are :
 
42
\\
 
43
                     SQRT(:a)  LN(:a)   LOG10(:a)  EXP(:a)  SIN(:a) \\
 
44
                     COS(:a)   TAN(:a)  ASIN(:a)   ACOS(:a) ATAN(:a) \\
 
45
                     SINH(:a)  COSH(:a) TANH(:a)   ABS(:a)  INT(:a)  \\
 
46
                     MIN(:a,:b)  MAX(:a,:b)  MOD(:a,:b)            
 
47
\\
 
48
              Arguments of trigonometric functions are in degrees. The function
 
49
              INT produces the nearest integer value. The function MOD returns
 
50
              the floating-point remainder of a/b with the same sign as a.
 
51
\\
 
52
              The supported logical operators are .AND. .OR. .NOT.
 
53
 
 
54
              String operations can be performed on character columns:
 
55
\\
 
56
              TOLOWER(:a)  convert all characters in the column to uppercase
 
57
              TOUPPER(:a)  convert all characters in the column to lowercase
 
58
              COLLAPSE(:a) remove all spaces from the contents of the column 
 
59
              CONCAT(:a,:b)
 
60
              CONCAT(:a,s) concatenate the contents of two columns 
 
61
                           or of one column and one string into an output column
 
62
 
 
63
              The function TOCHAR(:a) can be used to convert the values of a 
 
64
              column with any numerical type into strings,  using the output
 
65
              FORTRAN format associated to the input column.
 
66
 
 
67
              The variable name SEQUENCE (short form SEQ) can be used as
 
68
              variable, refering to the sequence number of the table entries.
 
69
\\
 
70
              The variable name SELECT (short form SEL) can be used as 
 
71
              variable, refering to the select flag of the table entries 
 
72
              (The value will be 0 or 1 according to whether or not the
 
73
              entry is selected). This variable can be used to perform
 
74
              computations only on the selected entries of the table.
 
75
              Please, note, that for variables SEQUENCE and SELECT we should 
 
76
              NOT have a colon(`:') in front.
 
77
   
 
78
\\
 
79
              If the output column doesn't exist, it will be created and
 
80
              its type will be the same as the "highest" one of the input
 
81
              columns. 
 
82
\\
 
83
              The result of an illegal operation (i.e logarithm of a negative
 
84
              number) will be set to the NULL value. 
 
85
\\
 
86
              The SELECT mask will be reset by this command, i.e., before the
 
87
              computation, all the elements in the table are selected.
 
88
\on\see
 
89
See also:
 
90
              CREATE/COLUMN, WRITE/TABLE, SELECT/TABLE, COMPUTE/IMAGE
 
91
\ees\exs
 
92
Examples:
 
93
\ex
 
94
              COMPUTE/TAB mytable :MAG = 21.3-2.5*LOG10(:INTEN-:BACK)
 
95
                Compute for table `mytable.tbl' the resulting column :MAG from
 
96
                the expression involving the input columns :INTEN and :BACK.
 
97
\xe\ex
 
98
              COMPUTE/TAB mytable :R = 0.5*SEQ
 
99
                Compute resulting column :R from the expression involving
 
100
                the sequence number of the table entries.
 
101
\xe\ex
 
102
              SELECT/TAB  mytable :MAG.LT.110.
 
103
              COMPUTE/TAB mytable :Z = MIN(:MAG,:R)+SEL
 
104
                Compute resulting column :Z as follows:
 
105
\\
 
106
                compute for each row the minimum value of the column :MAG and
 
107
                the column :R and add to the result the selection flag of the
 
108
                row.
 
109
\xe\ex
 
110
              COMPUTE/TAB mytable :NAME = CONCAT(:STAR,TOCHAR(:SEQ))
 
111
                For each row of the table myname, convert the value of the 
 
112
                column labeled :SEQ into a string, concatenate it to the
 
113
                contents of the column :STAR and store the result into the
 
114
                column :NAME.
 
115
\\
 
116
                Here we use a column labeled :SEQ not the sequence numbers!
 
117
\xe\sxe