aboutsummaryrefslogtreecommitdiff
path: root/vendor/voclient/doc/votsort.html
blob: c8fd11bbcb1d184a38781f0ec961aa4063a4fb69 (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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
Content-type: text/html

<HTML><HEAD><TITLE>Manpage of VOTSORT</TITLE>
</HEAD><BODY>
<H1>VOTSORT</H1>
Section: User Commands  (1)<BR>Updated: Feb 2013<BR><A HREF="#index">Index</A>
<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>

<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>

votsort - Extract the main positional columns from a VOTable
<P>
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>

<B>votsort</B> [<I>-opts</I>] votable.xml
<P>
<A NAME="lbAD">&nbsp;</A>
<H2>OPTIONS</H2>

The <I>votsort</I> task accepts the following options:
<DL COMPACT>
<DT><B>-h, --help</B>

<DD>
Print a help summary to the terminal and exit.  No processing is done 
following this flag.
<P>
<DT><B>-c </B><I>N</I>,--col <I>N</I>

<DD>
Sort by column number <I>N</I> (0-indexed).
<DT><B>-d,--desc</B>

<DD>
Sort in descending order.
<DT><B>-f </B><I>FORMAT</I>,--fmt <I>FORMAT</I>

<DD>
Output format of sorted table.   See description below for list of formats.
<DT><B>-o </B><I>NAME</I>,--output <I>NAME</I>

<DD>
Output name of sorted file, if not specified results are written to stdout.
<DT><B>-s,--string</B>

<DD>
Perform a string sort of the columns.
<DT><B>-t </B><I>N</I>,--top <I>N</I>

<DD>
Print the top <I>N</I> rows of the sorted table.
<DT><B>-i </B><I>N</I>,--indent <I>N</I>

<DD>
XML indention level when writing a new XML document.
<DT><B>-n,--noheader</B>

<DD>
Suppress header information for formats other than XML and FITS.
<DT><B>-N </B><I>NAME</I>,--name <I>NAME</I>

<DD>
Sort by column with the name=<I>NAME</I> attribute.
<DT><B>-I </B><I>ID</I>,--id <I>ID</I>

<DD>
Sort by column with the id=<I>ID</I> attribute.
<DT><B>-U </B><I>UCD</I>,--ucd <I>ucd</I>

<DD>
Sort by column with the ucd=<I>UCD</I> attribute.
<P>
<P>
</DL>
<A NAME="lbAE">&nbsp;</A>
<H2>DESCRIPTION</H2>

The <I>votsort</I> task is used to sort the rows of a VOTable either by
explicit column number (i.e. the <I>-c</I> flag), as a simple string sort
(i.e. the <I>-s</I> flag), or by an explicit 'name', 'id' or 'ucd' attribute
of the &lt;FIELD&gt; elements (the <I>-N</I>, <I>-I</I> and <I>-U</I> 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 
<I>-d</I> flag can be used to force a descending sort of the column.
<P>

Output is written to the stdout unless the <I>-o</I> flag is used to 
name a specific output file.  By default, a new VOTable will be written,
the <I>-f</I> flag can be used to specify a new format.  Allowed formats
include:
<P>

<I>vot</I>

A new VOTable

<I>asv</I>

ASCII-separated (i.e. whitespace) values.

<I>bsv</I>

Bar-separated values.

<I>csv</I>

Comma-separated values

<I>tsv</I>

Tab-separated values

<I>html</I>

Standalone HTML document (entire table)

<I>shtml</I>

Single HTML table

<I>fits</I>

FITS bintable

<I>ascii</I>

ASV alias

<I>xml</I>

VOTable alias

<I>raw</I>

VOTable alias
<P>

For formats such as CSV that normally
include column headers, the <I>-n</I> (or <I>--noheader</I>) flag may be used
to suppress this header.  The FITS file produced will be an MEF containing
a bintable extension for each VOTable &quot;&lt;TABLE&gt;&quot; element.  Column types and
names in this case come from the VOTable &quot;&lt;FIELD&gt;&quot; attributes.
<P>
If no input file is specified the VOTable will be read from the stdin,
results will be written to stdout unless the <I>-o</I> (or <I>--output</I>)
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.
<P>
<A NAME="lbAF">&nbsp;</A>
<H2>RETURN STATUS</H2>

On exit the <B>votsort</B> task will return a zero indicating success, or a 
one indicating an error.
<P>
<A NAME="lbAG">&nbsp;</A>
<H2>EXAMPLES</H2>

<DL COMPACT>
<DT>1)  Sort a VOTable based on first column<DD>
<P>
<PRE>
  % votsort test.xml
  % votsort <A HREF="http://generic.edu/test.xml">http://generic.edu/test.xml</A>
  % cat test.xml | votsort -o sort_test.xml
</PRE>

<P>
A string sort will be done automatically if this is a string-valued column, otherwise a numeric sort is done.
<DT>2)  Sort a VOTable based on the magnitude column<DD>
<P>
<PRE>
  % votsort --name=V test.xml
</PRE>

<DT>3)  Same as above, select 10 faintest stars<DD>
<P>
<PRE>
  % votsort --name=V --desc --top=10 test.xml
</PRE>

<DT>4)  String sort based on object name, output as CSV<DD>
<P>
<PRE>
  % votsort -s -f csv test.xml
  % votsort --string --fmt=csv test.xml
</PRE>

</DL>
<A NAME="lbAH">&nbsp;</A>
<H2>BUGS</H2>

No known bugs with this release.
<A NAME="lbAI">&nbsp;</A>
<H2>Revision History</H2>

Feb 2013 - First public release
<A NAME="lbAJ">&nbsp;</A>
<H2>Author</H2>

Michael Fitzpatrick (<A HREF="mailto:fitz@noao.edu">fitz@noao.edu</A>), Feb 2013
<A NAME="lbAK">&nbsp;</A>
<H2>SEE ALSO</H2>

votget, votinfo, votcnv, votpos, votstat
<P>

<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT><A HREF="#lbAB">NAME</A><DD>
<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT><A HREF="#lbAD">OPTIONS</A><DD>
<DT><A HREF="#lbAE">DESCRIPTION</A><DD>
<DT><A HREF="#lbAF">RETURN STATUS</A><DD>
<DT><A HREF="#lbAG">EXAMPLES</A><DD>
<DT><A HREF="#lbAH">BUGS</A><DD>
<DT><A HREF="#lbAI">Revision History</A><DD>
<DT><A HREF="#lbAJ">Author</A><DD>
<DT><A HREF="#lbAK">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 05:13:27 GMT, April 14, 2013
</BODY>
</HTML>