aboutsummaryrefslogtreecommitdiff
path: root/vendor/voclient/doc/votsort.man
blob: a3705822745a27b2bbc3adff8a88603fd04aafd7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
." @(#)votsort.1 1.0 Feb-2013 MJF
.TH VOTSORT 1 "Feb 2013" "VOClient Package"
.SH NAME
votsort \- Extract the main positional columns from a VOTable

.SH SYNOPSIS
\fBvotsort\fP [\fI-opts\fP] votable.xml

.SH OPTIONS
The \fIvotsort\fP task accepts the following options:
.TP 6
.B \-h, --help
Print a help summary to the terminal and exit.  No processing is done 
following this flag.

.TP 6
.B \-c \fIN\fP,--col \fIN\fP
Sort by column number \fIN\fP (0-indexed).
.TP 6
.B \-d,--desc
Sort in descending order.
.TP 6
.B \-f \fIFORMAT\fP,--fmt \fIFORMAT\fP
Output format of sorted table.   See description below for list of formats.
.TP 6
.B \-o \fINAME\fP,--output \fINAME\fP
Output name of sorted file, if not specified results are written to stdout.
.TP 6
.B \-s,--string
Perform a string sort of the columns.
.TP 6
.B \-t \fIN\fP,--top \fIN\fP
Print the top \fIN\fP rows of the sorted table.
.TP 6
.B \-i \fIN\fP,--indent \fIN\fP
XML indention level when writing a new XML document.
.TP 6
.B \-n,--noheader
Suppress header information for formats other than XML and FITS.
.TP 6
.B \-N \fINAME\fP,--name \fINAME\fP
Sort by column with the name=\fINAME\fP attribute.
.TP 6
.B \-I \fIID\fP,--id \fIID\fP
Sort by column with the id=\fIID\fP attribute.
.TP 6
.B \-U \fIUCD\fP,--ucd \fIucd\fP
Sort by column with the ucd=\fIUCD\fP attribute.


.SH DESCRIPTION
The \fIvotsort\fP task is used to sort the rows of a VOTable either by
explicit column number (i.e. the \fI-c\fP flag), as a simple string sort
(i.e. the \fI-s\fP flag), or by an explicit 'name', 'id' or 'ucd' attribute
of the <FIELD> elements (the \fI-N\fP, \fI-I\fP and \fI-U\fP flags
respectively).  If no column is specified explicitly by number or attribute,
then the first column will be used for sorting. By default, columns are 
sorted in ascending order, the 
\fI-d\fP flag can be used to force a descending sort of the column.
.PP
Output is written to the stdout unless the \fI-o\fP flag is used to 
name a specific output file.  By default, a new VOTable will be written,
the \fI-f\fP flag can be used to specify a new format.  Allowed formats
include:

.in 15
.I vot
A new VOTable
.in 15
.I asv
ASCII-separated (i.e. whitespace) values.
.in 15
.I bsv
Bar-separated values.
.in 15
.I csv
Comma-separated values
.in 15
.I tsv
Tab-separated values
.in 15
.I html
Standalone HTML document (entire table)
.in 15
.I shtml
Single HTML table
.in 15
.I fits
FITS bintable
.in 15
.I ascii
ASV alias
.in 15
.I xml
VOTable alias
.in 15
.I raw
VOTable alias

.in 7
For formats such as CSV that normally
include column headers, the \fI\-n\fP (or \fI\--noheader\fP) flag may be used
to suppress this header.  The FITS file produced will be an MEF containing
a bintable extension for each VOTable "<TABLE>" element.  Column types and
names in this case come from the VOTable "<FIELD>" attributes.

If no input file is specified the VOTable will be read from the stdin,
results will be written to stdout unless the \fI\-o\fP (or \fI\--output\fP)
names an output file.  The task will only process a single VOTable and may
not be used to convert multiple files in a single call.

.SH RETURN STATUS
On exit the \fBvotsort\fP task will return a zero indicating success, or a 
one indicating an error.

.SH EXAMPLES
.TP 4
1)  Sort a VOTable based on first column

.nf
  % votsort test.xml
  % votsort http://generic.edu/test.xml
  % cat test.xml | votsort -o sort_test.xml
.fi

A string sort will be done automatically if this is a string-valued column, otherwise a numeric sort is done.
.TP 4
2)  Sort a VOTable based on the magnitude column

.nf
  % votsort --name=V test.xml
.fi
.TP 4
3)  Same as above, select 10 faintest stars

.nf
  % votsort --name=V --desc --top=10 test.xml
.fi
.TP 4
4)  String sort based on object name, output as CSV

.nf
  % votsort -s -f csv test.xml
  % votsort --string --fmt=csv test.xml
.fi
.SH BUGS
No known bugs with this release.
.SH Revision History
Feb 2013 - First public release
.SH Author
Michael Fitzpatrick (fitz@noao.edu), Feb 2013
.SH "SEE ALSO"
votget, votinfo, votcnv, votpos, votstat