Program: TABLE
Purpose: GIPSY Table maintenance program
Category: TABLES, UTILITY, HEADER
File: table.c
Author: M.G.R. Vogelaar
Notes: A GIPSY table is a collection of columns of type
INT (integer numbers), REAL (floating point numbers),
DBLE (double precision numbers), LOG (booleans) or
CHARn (strings of length n which can contain spaces).
Table entries are stored in the descriptor of a set
and are bound to a subset level. Therefore a column
can be identified by:
1) Table name
2) Column name
3) Set name
4) Subset level
The program first asks set and subset and then generates
a list with all the columns it could find. This list
is called the 'table directory'. Each table in this
directory has a unique 'table number' and each column
in a table also has a unique 'column number'. All
input of columns can be given either with these numbers
or by the name of the table and column. The keywords
containing TABCOL accept names or numbers or a mix
of both. The first entry must always be a table (one name
or one number) and the others must be columns. If a
table specification is not unique, set and subset are
asked with COLSET=
Examples:
Set AURORA has axis RA-DEC-FREQ.
INSET=AURORA TOP=N produces the table directory:
============================================================
tab col Table Column Type Units Size Level set
============================================================
1 1 OBSFREQ XX INT UNITS 255 (* * *) AURORA
1 2 OBSFREQ YY INT UNITS 255 (* * *) AURORA
2 1 OBSINTF BASELINE INT ? 19 (* * *) AURORA
3 1 XBLPOS xpos REAL WU 5 (* * 2) AURORA
4 1 XBLPOS xpos REAL WU 5 (* * 3) AURORA
TABCOL=1 : select all columns in table 1
TABCOL=1 1 2 : select column 1 and 2 of table 1
TABCOL=OBSFREQ : select all columns in table 1 (OBSFREQ)
TABCOL=OBSFREQ 1 2 : select column 1 and 2 in table OBSFREQ
All specifications return columns 'OBSFREQ' 'XX' and
'OBSFREQ' 'YY'
TABCOL=3 1
TABCOL=XBLPOS COLSET=AURORA FREQ 2
TABCOL=XBLPOS 1 COLSET=AURORA FREQ 2
all return column 'xpos' in table 'XBLPOS' on subset
level FREQ 2.
Note that the keyword TABCOL= is only a generic keyword.
Keywords:
INSET= Give set (, subset(s)):
1) Input is the name of a set (TOP= is asked (hidden)
also).
2) Input is name of a set and a subset specification.
For this INSET=, a 'table directory' will be generated.
Maximum number of subsets is 4096.
** TOP= Tables on top level only? [Y]/N=All levels
If INSET= has a set name only, it is possible to get
tables on toplevel only (TOP=Y) or to get tables on
all levels (TOP=N). This is the way to get display all
the available columns.
OPTION= [1]=Exit,2=Set,3=Filter,4=Create,5=View,6=Plt,7=NEXT
Select one of the options 1..14, enter 7 for next
selection:
8=Clc,9=Stat,10=Cor,11=Srt,12=Edt,13=Del,14=Cpy [back]
Carriage return brings you back to the previous
selection. The options are:
1) Exit program
2) Give new set or append one
3) Set filter column
4) Create (and fill) new column
5) View, export (formatted) table data;
6) Plot column(s)
7) Next selection
8) Fill column using expressions with columns as variables
9) Elementary statistics on column data
10) Correlation between two columns
11) Sort a column
12) Edit (and/or append to) a column
13) Delete a column
14) Copy contents of column to another column
OPTION=1; Quit the option loop. quit Hermes:
OPTION=2; Give a directory of tables and columns of
new (and old) set:
SETAPPEND= Append new tables? [N]
If you want the tables of a new set, use SETAPPEND=N,
and if you want to append tables of a set in the table
directory, use SETAPPEND=Y
The number of subsets cannot exceed 4096 per set.
INSET= Give set (, subsets):
OPTION=3; Setup a filter:
FTABCOL= Table, col. number for filter: [Filter OFF]
Carriage return results in inactivating the filter.
A table (and column) number however will set up a
filter array. This array need not to be of type LOG.
Types REAL/DBLE and INT are also allowed. If in a
REAL or DBLE type array a blank value is encountered,
the corresponding filter value is set to FALSE.
OPTION=4; Import data from ASCII file and put data
in Gipsy table.
IMPORTFILE= Name of import ASCII file: [no file]
OUTSET= Give set (, subsets) to put column in:
The number of subsets can be greater than 1.
TABNAME= Give name of table:
Max. length is 8 characters.
COLNAME= Give name of column:
Max. length is 8 characters.
TYPE= Type: INT REAL DBLE LOG CHARn: [program default]
Default depends on existence of destination.
You must specify at least one of the characters
I, R, D, L or C.
NCHAR= Give number of characters per string: [10]
Only asked if TYPE=4 (character type).
COLSIZE= Give number of entries in column: [return to menu]
Only asked if no import file was given, i.e.
IMPORTFILE=
UNITS= Give units of column data: [none]
Max. length is 8 characters.
COMMENT= Give comment: [none]
Max. length is 80 characters.
APPCOL= Append to existing column: [Y]/N
If a selected column already exists, data can be
appended at the end of the column with APPCOL=Y
OPTION=5; Write contents of column(s) to screen,
ASCII file on disk or printer
TABCOL*= Table, column: [start output]
The keyword is asked in a loop
(TABCOL1=, TABCOL2= etc.) After one or more
specifications, you can display the column(s) by
pressing carriage return.
First number is a table number, the second number is a
column. If the column number is not specified, the
first column of the table is used.
SPACES= Give number of spaces between columns: [1]
If more than one column is given, you can give the
number of spaces between the columns.
FORMAT*= Give format X type: [default for this type]
For every column a format image is asked (FORMAT1=,
FORMAT2= etc. With this image you specify field width
and precision (see description). X is one of INT/REAL/
DBLE/LOG/CHARn, n is an integer.
For the types REAL/DBLE there is an HMSn or DMSn
format (See description).
DESTINATION=[S]creen, (F)ile, (P)rinter, (Q)uit [Screen]
Display your columns on screen or send it to a
file (EXPORTFILE=) or send it to a printer (PRINTER=).
The DESTINATION= keyword is asked in a loop which
you can abort with DESTINATION=Q. It is also possible
to give more than one destination f.i. DESTINATION=SFPQ
will send output to screen, file and printer and quits
the loop.
EXPORTFILE= Name of export ASCII file: [No output to file]
If a name is specified, an ASCII file is created to
store data. If you press carriage return, there will
be no output to an ASCII file. If a given name already
exists, APPEND= must be specified.
APPEND= File exists, ok to append? [Y]/N
The file specified in EXPORTFILE= already exists.
You can append to this file with APPEND=Y. If APPEND=N
you will be prompted for another filename.
PRINTER= Give number of printer:
First a list with available printers is generated
OPTION=6; Create plot with contents of column as Y
(and X) values.
GRDEVICE= Plot device: [List of devices]
Destination of plot, Screen or Hardcopy.
** PGMOSAIC= View surface sub divisions in x,y: [1,1]
View surface can contain a number of plots in
in X and Y direction (mosaic). Default is 1 plot in
both X- and Y direction.
** PGPAPER= Give width(cm), aspect ratio: [calc, calc]
Aspect ratio is height/width. Default is calculated
by the program and will obtain the largest view
surface available.
** PGBOX= Corners of box Xl,Yl,Xh,Yh: [default by application]
It is possible to overrule the calculated
PGPLOT box size with PGBOX=. The coordinates (x,y) of
the lower point are given first.
** PGCOLOR= Give color 1..15: [1]
See description for the available colors.
** PGWIDTH= Give line width 1..21: [1]
** PGHEIGHT= Give character height: [1.0]
** PGFONT= Give font 1..4: [2]
YTABCOL= Table, col. for Y values: [return to menu]
Column representing Y values. If only a table
number is given, the column number is 1 by default.
The plotting loop is aborted by pressing carriage
return.
XTABCOL= Table, col. for X values: [Create X column]
Column representing X values. If only a table
number is given, the column number is 1 by default.
If carriage return is pressed, the X array is filled
with values as specified in XVALUES=
XVALUES= message, "Give %d values for X axis: [calculated]
Create a column with values for the X axis. The
default creates values 1 .. [size of the Y column]
EXTABCOL= Table, col. for error in X values: [No X error bar]
The values in this column represent half the length
of a total error bar in X direction.
EYTABCOL= Table, col. for error in Y values: [No Y error bar]
HEADER= Give text as header above plot: [None]
COMMENT= Give text as comment in plot: [No comment]
COMPOS= Give X, Y in plot coordinates: [upper left corner]
Position of comment.
** ANGLE= Angle in degrees: [0]
Angle of comment, counted anti-clockwise.
** JUST= Horz. justification 0.0 .. 1.0: [0.0]
Horizontal justification is a number between 0 and 1.
** NEWFRAME= Advance to new (plot) page? [Y]/N
If NEWFRAME=N, next output will be in the same frame.
IDPOS= Enter position of id. in mm: [3 3]
An identification string can be plotted at a
position x,y in mm.
IDANGLE= Enter angle of id. string (deg): [0]
The identification string can be plotted at any
angle. The angle is entered in degrees.
IDTXT= Enter text for id.: [user,date]
The identification string is either supplied by
the user or created by the program. The default string
is created by the program and contains username and
date, e.g.
GIPSY: k.u. keleku, Wed Jan 3 12:52:37 1996
OPTION=7; Display the operations menu and ask for
a choice.
OPTION= 8=Clc,9=Stat,10=Cor,11=Srt,12=Edt,13=Del,14=Cpy [back]
Another set of options from the main menu. Pressing
carriage return displays the previous options.
OPTION=8; Create a new column as a result of an
mathematical expression with variables
representing existing columns.
EXPRESSION= F($1, $2,...$n) = [return to menu]
Give an expression with $1..$n as variables
representing columns. If the expression is approved by
the program, the table, column specification is done
with keyword TABCOLn= where n is a number corresponding
with a variable.
Keywords TABCOL*=, OUTSET=, TABNAME=, COLNAME=, UNITS=,
COMMENT= and APPCOL= are described above.
OPTION=9; Elementary statistics on column data.
STABCOL= Table, col. for statistics: [return to menu]
Calculate statistics for specified column, i.e.
-Number of entries in column
-Minimum, and maximum of column data
-Mean and rms of column data
-Number of blanks in column.
OPTION=10; Correlation between two columns.
XTABCOL= Table, col. for X values: [return to menu]
YTABCOL= Table, col. for Y values: [Create Y column]
XVALUES= Give n values for X axis: [calculated]
Create a column with n values for the X axis. The
default creates values: 1 ... [n=size of the Y column]
HEADER= Give text as header above plot: [None]
PG ... = If a plot device is opened, all PGplot keywords
(PGMOSAIC=, PGBOX=, PGCOLOR= etc)
can be specified as described above.
ID ... = Identification string keywords. See description at
OPTION=6
OPTION=11; Sort a column.
Not yet implemented.
OPTION=12; Edit a column.
ETABCOL= Table, col. to edit data: [Return to menu]
ROW= Give row(s) (1..13) to edit: [stop]
Max. 1024 entries can be edited in one run.
NEWVAL= New 'type' value(s) at entry n: [old value in n]
'type' is one of INT/REAL/DBLE/LOG/CHAR and
n is the row number of the entry. For all types except
character data, it is possible to enter more than one
value.
OPTION=13; Delete columns and tables.
DTABCOL= Delete tab (, col(s)): [Return to menu]
If you give one number, all columns will be deleted
in that table. If more numbers are entered (max. of
1024) then the first number is the table, and the
other numbers are columns. Deleted columns are marked
DELETED in the table directory.
OPTION=14; Copy contents of column to another column.
CTABCOL= Table, column to copy:
Keywords OUTSET=, TABNAME=, COLNAME=, UNITS=,
COMMENT= and APPCOL= are described above.
Description: The GIPSY application TABLE is an interactive program
working with GIPSY tables. A GIPSY table is an entry in
the descriptor of a set and is connected to set- or
subset level. A table is identified by the set name,
a subset level and a character string. Its contents is
a list of column names, so a column can be specified by
a set name (INSET=/OUTSET=), a subset level, a table name
(TABNAME=), and a column name (COLNAME=). At the INSET=
prompt you specify the name of the set and the subset
level. If the subset level is omitted you can get
tables from top level only OR get tables from all levels,
i.e. all tables in the set. Top level is selected with
the keyword TOP=Y (default), and all tables can be found
with TOP=N.
The column contains data with type INT, REAL, DBLE, LOG,
or CHAR. Type, units, number of entries and a comment are
also stored in the descriptor. The character type must
include a length, so it will have a number as postfix
(CHARn and n <= 132).
The table directory:
The first column is a table number that can be used to
specify tables (instead of giving names). The second
holds column numbers for each table. The corresponding
names, type and units of column data and the size of a
column are listed. 'Level' indicates the subset level
where the column is found. If the set was a RA-DEC-FREQ
set, then (* * 2) means the RA-DEC subset at frequency 2!
The table directory is sorted in order of set name, table
name, subset level and column name.
With OPTION=2 you can extend this list with tables from
other sets. This option is needed if one wants for
instance to calculate a new column as function of two
columns belonging to different sets.
OPTION=3:
The filter filters data in statistics, correlation,
calculations (with OPTION=8), viewing and plotting.
A filter is set with OPTION=3 and FTABCOL=. The
column can be of any type except character data.
If the column has type INT, REAL or DBLE then the
contents is converted to LOGical data in a way that
all data not equal to zero is set to TRUE and all data
equal to zero or blank data is set to FALSE. Note that
the data in the filter array is not changed in any way.
If a filter is active but the filter column is smaller
than the column to be filtered, then the filter column
is virtually extended with FALSE values. If a filter
is active and a new column is created, then only the
data that passed the filter is stored.
OPTION=4:
Importing data is possible with OPTION=4. First asked is
the filename containing the ASCII data (IMPORTFILE=).
If you press carriage return, the length of the new
column is asked with COLSIZE= and the new column is
filled with zeroes (use the edit option to fill ).
If you have an import file, then this file must be an
ASCII file which contains only one column. Character
data consists of one or more text strings and a carriage
return to limit the string.
The LOG(ical) type is one of YES, JA, TRUE, NO, NEE,
FALSE or abbreviations of these.
The destination is needed (OUTSET=) which is the name of
an existing set and the specification of subset(s). The
table name (TABNAME=) and column name (COLNAME=) must be
a unique combination. The type of the data (TYPE=) and
the units (UNITS=) are character strings, not longer than
8 characters. Some comment can be given (less than 80
characters). The comment is displayed in the table
directory and is listed right to the level information.
If the column you wanted to create, already exists, it
is possible to append data to this column with keyword
APPCOL=Y
IMPORTANT: Only the first column of an ASCII file is converted (except
for character data) to data values.
OPTION=5:
In order to get the contents of a certain column, use
OPTION=5. You specify a table and column number from the
directory list and the program asks you if you want to
direct the contents list to screen, to an ASCII file
(EXPORTFILE=) or to a printer. If you give a file name and
that file already exists, the program will prompt you with
APPEND= The default is APPEND=Y, this appends column data
to the existing file. You can create your own layout for
one or more columns with the keywords FORMAT1=, FORMAT2= etc.
Each keyword corresponds with a given column (TABCOL*=).
The specification in FORMAT*= is called a 'format image'.
A 'format image' is used to print numbers in a user given
format consisting of characters representing the
wanted output format. The syntax is:
flag(s) Zero or more flags, in any order, which modify the
meaning of the conversion specification. The flag
characters and their meanings are:
- The result of the conversion is left-
justified within the field.
+ The result of a signed conversion always
begins with a sign, "+" or "-".
string Characters, some with special meaning.
If the string (f.i. FFFFF.FF or gggg.gg or wwwww)
contains no dot, the number of characters specify
a minimum field width. For an output field, if the
converted value has fewer characters than the field
width, it is padded on the left (or right, if the
left-adjustment flag, - has been given) to the field
width.
If the string contains a dot, the total number of
characters including the dot is the minimum field width
and the number of characters after the dot is the
precision.
The characters are used to determine the conversion
type. If the string contains an:
'e' or 'E'
The floating-point-number argument is
printed in the style [-]drddde+dd,
where there is one digit before the
radix character, and the number of
digits after it is equal to the
precision. The E conversion character
produces a number with E introducing
the exponent instead of e. The
exponent always contains at least two
digits. However, if the value to be
printed requires an exponent greater
than two digits, additional exponent
digits are printed as necessary.
'g' or 'G'
The floating-point-number argument is
printed in style f or e (or int style E
n the case of a G conversion
character), with the precision
specifying the number of significant
digits. The style used depends on the
value converted; style e is used only
if the exponent resulting from the
conversion is less than -4 or greater
than or equal to the precision.
others
Strings without 'e', 'E', 'g' and 'G'
indicate a floating point conversion.
The floating point number argument is
printed in decimal notation in the
style [-]dddrddd, where the number of
digits after the radix character, r, is
equal to the precision specification.
If the result of a conversion is longer than the
field width, an asterisk is returned. If the
input number is a blank, a 'b' is returned.
Examples: Format string: +eeeeee.eeee
Number: 43345.5436
Result: +4.3346e+04
Remark: exponential format
signed conversion
field width: 12
precision: 4
Format string: gggg.ggggg
Number: 34.43
Result: 34.430
Remark: Field width is 10
Number of significant digits is 5
Format string: +ffff.ff
Number: 23.456
Result: +23.46
Remark: signed conversion
Format string: -ffff
Number: 345.87
Result: 346
Remark: left justified
Format string: -+ffff.fff
Number: 34.43
Result: +34.430
Remark: left justified
signed conversion
Format string: eee.eeee
Number: 234.43
Result: *
Remark: Field width too small
for conversion
Format string: ffff.ff
Number: blank
Result: b
Remark: input was a blank
There is also a possibility to print REAL an DBLE numbers
in HMS or DMS format. The length of the format is fixed.
The precision of the seconds is given in HMSn or DMSn
where n is an integer.
OPTION=6;
A simple plot routine allows you to plot the data in a
column (YTABCOL=) as function of column entry or as
function of another column (XTABCOL=). Pressing carriage
return at the YTABCOL= prompt will abort the plot loop.
Pressing carriage at the XTABCOL= prompt will give the
keyword XVALUES= to create the X column yourself. The
default for this keyword will result in an X axis with
lowest value 1 and highest value equal to the length of
the Y column. An expresssion can be given also. Error
bars can be included with EXTABCOL= and EYTABCOL=
If the size of YTABCOL= and XTABCOL= is
different, the smallest size will be used as the number
of column entries to plot. If the program can find the
units of the data, it will plot these units along the
axes. The keywords beginning with 'PG' all apply to
plotting.
There is some control over the plotting with the
keywords PGMOSAIC= to get more plots on one page,
PGPAPER= to set width of output and aspect ratio
(i.e. height/width), PGBOX= to set your own plot box
limits, PGCOLOR= to set the colour of frame and
labels, PGFONT= to set the font style of all text in the
plot, PGHEIGHT= to set the height of the characters. The
default for PGHEIGHT=1.0. To get a height that is n times
the current height, use PGHEIGHT=n.
PGWIDTH= can be used to set the width of the lines.
For overlays use NEWFRAME=N, so that new data will be
plotted in the current plot. The data is scaled as
previous data.
Color indices for PGCOLOR=
0 Background
1 Default (Black if background is white)
2 Red
3 Green
4 Blue
5 Cyan
6 Magenta
7 Yellow
8 Orange
7 Yellow
8 Orange
9 Green + Yellow
10 Green + Cyan
11 Blue + Cyan
12 Blue + Magenta
13 Red + Magenta
14 Dark Gray
15 Light Gray
16-255 Undefined
Available fonts for PGFONT=
1 single stroke "normal" font
2 roman font
3 italic font
4 script font
Text can be added to the plot with the keywords:
COMMENT= which accepts strings, COMPOS= which needs
two numbers to position the text in COMMENT=
(the default is the upper left corner).
The position is in world coordinates. The string is
drawn with the baseline of all the characters passing
through COMPOS=
The positioning of the string along this line is
controlled by JUST=. If JUST=0.0, the string will be
left-justified at the point COMPOS=); if JUST=0.5, it
will be centered, and if JUST=1.0, it will be right
justified. [Other values of JUST= give other justifi-
cations.]. The text can be
written at an arbitrary angle with ANGLE=. The angle
(in degrees) increases counter-clockwise where
ANGLE=0.0 is horizontal.
OPTION=8;
OPTION=8 deals with expressions which create a new
column as a function of existing columns.
The existing columns corresponding with the variables
$1 .. $n, can be of type INT, REAL or DOUBLE. The result
however is always of type REAL. The length of the
result column is equal to the size of the smallest column.
The destination of the result column must be specified
with keywords OUTSET=, TABNAME= etc.
Description of the syntax in the expressions:
1) functions; syntax ff(..); where ff is one of the
following available functions:
abs(x) absolute value of x
sqrt(x) square root of x
sin(x) sine of x
asin(x) inverse sine of x
cos(x) cosine of x
acos(x) inverse cosine of x
tan(x) tangent of x
atan(x) inverse tan of x
atan2(x,y) inverse tan (mod 2pi) x = sin, y = cos
exp(x) exponential of x
ln(x) natural log of x
log(x) log (base 10) of x
sinh(x) hyperbolic sine of x
cosh(x) hyperbolic cosine of x
tanh(x) hyperbolic tangent of x
rad(x) convert x to radians
deg(x) convert x to degrees
erf(x) error function of x
erfc(x) 1-error function
max(x,y) maximum of x and y
min(x,y) minimum of x and y
sinc(x) sin(x)/x (sinc function)
sign(x) sign of x (-1,0,1)
mod(x,y) gives remainder of x/y
int(x) truncates to integer
nint(x) nearest integer
ranu(x,y) generates uniform noise between x and y
rang(x,y) generates gaussian noise with mean x
and dispersion y
ranp(x) generates poisson noise with mean x
ifeq(x,y,a,b) returns a if x == y, else b
ifne(x,y,a,b) returns a if x != y, else b
ifgt(x,y,a,b) returns a if x > y, else b
ifge(x,y,a,b) returns a if x >= y, else b
iflt(x,y,a,b) returns a if x < y, else b
ifle(x,y,a,b) returns a if x <= y, else b
ifblank(x,a,b) returns a if x == BLANK, else b
2) constants; syntax cc; where cc is one of the following
available constants:
PI 3.14159....
C speed of light (SI)
H Planck (SI)
K Boltzmann (SI)
G gravitation (SI)
S Stefan-Boltzman (SI)
M mass of sun (SI)
P parsec (SI)
BLANK Universal undefined value
Note: the Hubble constant is not included.
3) operators; syntax op; where op is one of the following
available operators:
+ addition
- subtraction
* multiplication
/ division
** power
4) parameters; syntax $n; where 1 <= n <= 32.
A) The calculations are all done in double precision.
B) BLANK values are recognized. Any operation on a
BLANK causes the result to be set to BLANK (except the
function IFBLANK). Also all illegal operations, like
dividing by zero or the logarithm of a negative value,
will cause the result to be set to BLANK.
OPTION=9;
Statistics.
For the column given in TABCOL= the program calculates
the minimum and maximum value, the mean and rms of the
data. Also the number of blanks are printed.
OPTION=10;
Correlation and regression.
The correlation option first plots a diagram with pixel
values of the two given columns (same remarks as with
the plot option wrt. creating your own temporary column
for the X axis). Furthermore, it
calculates the regression lines y=ax+b and x=cy+d, the
deviations from these lines and the linear correlation
coefficient r. If r = 1 or r = -1, there is perfect
positive resp. negative correlation. If r = 0, there is
total absence of correlation.
If n is the number of valid data pairs in the regression,
the significance of r is the probability Pc(r,n) that
the data points could represent a sample from an
uncorrelated parent population:
Pc(r,n) < 5% is significant.
Pc(r,n) < 1% is highly significant.
Pc(r,n) < 0.1% is very highly significant.
In most cases with large n, this probability is so
small, that 0(%) is printed.
The applied statistic t = r * sqrt( n-2 / 1-r**2 ) is
distributed in the case of the null-hypothesis (of no
correlation) like Student's t-distribution with
v = n-2 degrees of freedom.
The two sided significance level is given by Pc(r,n).
Example:
Statistics
==========
Data points diagram : n = 100
Regr. Y on X : Y = +0.9804 (+/-0.0357) X + -2.1644 (+/-0.3035)
Regr. X on Y : X = +0.9026 (+/-0.0328) Y + +1.9823 (+/-0.2978)
Linear corr. coeff. : r = 0.940727
Significance of r : Pc(r,n) = 0.0(%)
Pc(r,n) < 5% is significant.
Pc(r,n) < 1% is highly significant.
Pc(r,n) < 0.1% is very highly significant.
References:
-Kreyszig, E., Introductory Mathematical Statistics
Chapter 17, 18.
-Press, H. et al, Numerical Recipes, Chapter 14.
-Bevington, P., Data Reduction and Error Analysis
for the Physical Sciences, Chapter 7.
-Ractliffe, J., Elements of Mathematical Statistics
Chapter 16.
OPTION=11;
Sorting a column. Not yet implemented
OPTION=12;
A column must be given with ETABCOL= The length of this
column is the maximum number of entries you can edit.
The keyword ROW= specifies the entries in this column
that you want to edit.
Editing is done in a loop with the keyword NEWVAL=
as the new value. The default is the old value. For
all types except character data, you can give more
than one value at this prompt. If, for example, you
have a column with at least 91 entries and want the
entries to be filled with values SIN(0) to SIN(90)
(angle in degrees), use the expression:
NEWVAL=SIN(RAD([0:90:1]))
The repeat argument [0:90:1] generates the numbers
0, 1, 2,... 90. These numbers are converted to radians
and after calculating the sine, they are stored in the
column.
Editing can be done also by exporting the data to an
ASCII file (OPTION=5). Edit the data with your editor
and read the data back with OPTION=4.
OPTION=13;
Deleting can be of columns or tables. If DTABCOL=
contains one name or number, it refers to a table.
If it contains more than one, the first one specifies
the table and the others the columns in the table.
After deleting columns, the columns are marked
DELETED in the table directory. They are deleted in
the set descriptor, but remain in the table directory
until a new set is used.
OPTION=14;
Copy data to another column. Only one column can be
copied at a time. INT/REAL/DBLE/LOG data can be copied
to INT/REAL/DBLE/LOG data. Character data can only be
copied to character data, but the number of characters
can decrease. For example if type was CHAR20 you can
select TYPE=CHAR10
Notes:
Example: Program FINDGAUSS created a number of columns in set
AURORA. With the default file cols.def, the next table
was printed:
X centre Y centre Flux Major Minor Pa
(hms) (dms) Jy/pix " " degree
===========================================================================
3h 17m 8.43s 41d 18m 2.7s 10.687 18.799 12.800 178.689
3h 16m 29.90s 41d 18m 40.7s 1.584 31.699 25.663 144.585
.... ....
Contents cols.def:
INSET=a 0
OPTION=5
SPACES=2
TABCOL1=1 11
FORMAT1=hms2
COLNAME1=X centre
COLUNITS1=(hms)
TABCOL2=1 16
FORMAT2=dms1
COLNAME2=Y centre
COLUNITS2=(dms)
TABCOL3=1 1
FORMAT3=
COLNAME3=Flux
COLUNITS3=Jy/pix
TABCOL4=1 5
FORMAT4=
COLNAME4=Major
COLUNITS4="
TABCOL5=1 7
FORMAT5=
COLNAME5=Minor
COLUNITS5="
TABCOL6=1 3
FORMAT6=
COLNAME6=Pa
COLUNITS6=degree
Updates: Jun 11, 1992: VOG, Document created.
Jul 10, 1992: KGB, increased length of comment, etc.
Aug 24, 1992: VOG, Second release.
Okt 5, 1992: VOG, Subset selection possible,
HMS/DMS formats added
Apr 12, 1995: VOG, Removed code around "PGLAB"
Oct 20, 1995: VOG, Increased length of 'messbuf2'
(TABLE crashed when displaying
character data).
Jan 03, 1996: VOG, Added identification string in plots.