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

« back to all changes in this revision

Viewing changes to prim/help/createtabl.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
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
2
%.COPYRIGHT  (c)  1990-2008 European Southern Observatory
 
3
%.IDENT      createtabl.hlq
 
4
%.AUTHOR     JDP, IPG/ESO
 
5
%.KEYWORDS   MIDAS, help files, CREATE/TABLE
 
6
%.PURPOSE    On-line help file for the command: CREATE/TABLE
 
7
%.VERSION    1.0  12-AUG-1984 : Creation, JDP
 
8
%.VERSION    1.1  04-Mar-1991 : New Table Version
 
9
%----------------------------------------------------------------
 
10
\se
 
11
SECTION./TABL
 
12
\es\co
 
13
CREATE/TABLE                                            10-APR-2012   JDP,KB
 
14
\oc\su
 
15
CREATE/TABLE  table ncol nrow data_file [format_file] [organization]
 
16
        create a table from ASCII data
 
17
\us\pu
 
18
Purpose:      
 
19
          Create a table and load values from an ASCII data file.
 
20
          Format conversion is controlled by an auxiliary format file.
 
21
          If the table contains only numerical columns and no NULL values
 
22
          are present, the format file can be omitted.
 
23
\up\sy
 
24
Syntax:       
 
25
          CREATE/TABLE  table ncol nrow data_file [format_file] [organization]
 
26
\ys\pa
 
27
          table = the table name
 
28
\ap\pa
 
29
          ncol = number of columns; * if ncol defined in format_file.
 
30
\ap\pa
 
31
          nrow = number of rows;    * if nrow defined in format_file.
 
32
\ap\pa
 
33
          file = file name (default type .dat) with the data to be
 
34
                 loaded into the table 
 
35
                 All lines of the ASCII file will appear as table rows, 
 
36
                 even if it has more lines than the parameter nrow.
 
37
                 Then, additional rows are allocated.
 
38
                 The filename  NULL produces an empty table (disk space is
 
39
                 allocated - no columns are created; use CREATE/COL to create 
 
40
                 them later)
 
41
                 First char. # indicates comment lines.
 
42
\ap\pa
 
43
          format_file = optional filename (default type .fmt) to define
 
44
                 the format of the ASCII data file, and the size of the
 
45
                 table when ncol and/or nrow are *. By default the
 
46
                 name "table.fmt" is used. If the format file does not exist,
 
47
                 the conversion is done via list-directed input, free format,
 
48
                 and the labels are defaulted to LABxxx.
 
49
\ap\pa
 
50
          organization = optional file organization, as 
 
51
                 RECORD (table stored row per row) or
 
52
                 TRANSPOSED (table stored columnwise) (default).
 
53
                 !OJO! Not all MIDAS commands will work on tables organized
 
54
                       in RECORD mode.
 
55
\ap\no
 
56
Note:        
 
57
          All lines of the data file beginning with the char. `#' or `!'
 
58
          are interpreted as comment and ignored.
 
59
 
 
60
          The format file describes each field (column) in the table ASCII 
 
61
          file as :
 
62
          DEFINE/FIELD [pos1] [pos2] type [format] label [unit]
 
63
          where
 
64
          pos1 = starting position of the field
 
65
          pos2 = last position in the field
 
66
          type = data type of the field as I - integer,
 
67
                                           R - real single precision,
 
68
                                           D - real double precision,
 
69
                                           C - character.
 
70
          format = optional FORTRAN format
 
71
          label  = column label associated to that field
 
72
          unit   = optional units
 
73
 
 
74
          Three keywords can also be added at the beginning of the format
 
75
          file:
 
76
          ROWS    number_of__rows (if not specified in the command line)
 
77
          COLUMNS number_of_columns (if not specified in the command line)
 
78
          FS    list of field separators used in the ASCII data file.
 
79
                Only used when pos1 and pos2 are not specified in the 
 
80
                DEFINE/FIELD statement. Per default tabs and blanks are
 
81
                used as field separators. The list of separators has to  
 
82
                be written in the form "f1f2f3". The number of field
 
83
                separators is not limited. If the blank is used as field
 
84
                separator, character strings containing blanks have
 
85
                to be enclosed within double quotes.
 
86
 
 
87
          The max. no. of columns is set to 256. If you really need tables 
 
88
          with more columns, you have to update the definition of
 
89
          MAXCOL in the file /midas/version/prim/table/libsrc/tbaload.c
 
90
          (look for the line starting with "#define MAXCOL ...").
 
91
          The safest option is to reinstall Midas after you've done your
 
92
          changes.
 
93
\on\see
 
94
See also:
 
95
          CREATE/COLUMN, CREATE/VIRTUAL, DELETE/COLUMN, WRITE/TABLE
 
96
          COMPUTE/TABLE, SELECT/TABLE, COPY/TABLE, PROJECT/TABLE, 
 
97
          COPY/TT, MERGE/TABLE
 
98
\ees\exs
 
99
Examples:
 
100
\ex
 
101
          CREATE/TABLE mytable 5 1000 myfile format
 
102
            Create the table `mytable.tbl' from ASCII data in the
 
103
            file `myfile.dat', using the format in `format.fmt'
 
104
            The ASCII file `myfile.dat' could contain the following
 
105
            structure
 
106
            .........1.........2.........3
 
107
            123456789012345678901234567890
 
108
            NGC 3379 10.75 12.85 E 893
 
109
            The associated file `format.fmt' is defined as:
 
110
            ! - format file 
 
111
            DEFINE/FIELD 5  8  I      :NAME "NGC"
 
112
            DEFINE/FIELD 10 14 R F5.2 :RA "HOUR"
 
113
            DEFINE/FIELD 16 20 R F5.2 :DEC "DEGREE"
 
114
            DEFINE/FIELD 22 22 C      :TYPE
 
115
            DEFINE/FIELD 24 26 I      :RV
 
116
            END
 
117
\xe\ex
 
118
          CREATE/TABLE waldi 3 1000 waldi waldi
 
119
            Generates `waldi.tbl' from the ASCII file `waldi.dat' using
 
120
            the format file `waldi.fmt' which is defined as:
 
121
            FS = "\t,"
 
122
            DEFINE/FIELD R    :RA
 
123
            DEFINE/FIELD R    :DEC
 
124
            DEFINE/FIELD C*13 :NAME
 
125
            No field positions are given, tabs and commas are used as field
 
126
            separators.
 
127
            The file `waldi.dat' has the following structure:
 
128
            0.0047,-35.0596    MS2357-3520
 
129
            0.0286,-63.5943    MS2357-6352
 
130
            0.0499,0.0401      Q 2357-0014
 
131
            0.0528,-0.2427    Q 2357-005A
 
132
\xe\ex
 
133
          CREATE/TABLE table 4 100 data
 
134
            Generates `table.tbl' from the ASCII file `data.dat' without
 
135
            associated format file. The information in the file `data.dat' 
 
136
            is in free format (list-directed read in FORTRAN) as:
 
137
            1000.0 4.3, 1.1      2.
 
138
            1001.0 5.2  3.4      0.3
 
139
            1020.1 2.5  1.2      3.
 
140
            ........
 
141
\xe\sxe