Here are some examples of tpipe
in use with explanations
of what's going on. For simplicity these examples assume that you have the
tpipe
script installed and are using a Unix-like shell;
see Section 2 for an explanation of how to invoke the command
if you just have the Java classes.
The examples are arranged with one step (input, filter or destination) per line, to make it easier to see what's going on.
tpipe cat.fits
-write
is assumed,
and output is to standard output in text
format.
tpipe -head 5 cat.fits.gz
tpipe -ifmt csv xxx.csv \ -keepcols "index ra dec" \ -write -ofmt fits xxx.fits
cat tab1.vot | tpipe - -addcol IV_SUM "(IMAG+VMAG)" \ -addcol IV_DIFF "(IMAG-VMAG)" \ -delcols "IMAG VMAG" \ -write -ofmt votable -o - \ > tab2.vot
tpipe
command in this case.
The processing steps first add a column representing the sum,
then add column representing the difference, then delete the
original columns.
tpipe 2dfgrs_ngp.fits \ -disk \ -keepcols "SEQNUM AREA ECCENT" \ -sort -down AREA \ -head 20
-disk
flag is supplied, which means that
temporary disk files rather than memory
will be used for caching table data.
tpipe http://archive.org/data/survey.vot -meta
tpipe survey.fits -select "skyDistance(hmsToRadians(RA),dmsToRadians(DEC), \ 0.6457,-0.1190) < 5 * ARC_MINUTE" \ -count
skyDistance
function is an expression which
calculates the distance between the position specified in a row
(as given by its RA and DEC columns) and a given point on the sky
(RA=0.6457 radians, DEC=-0.1190 radians).
Since skyDistance
's arguments and return value are in
radians, some conversions are required: the RA and DEC columns
are sexagesimal strings which are converted using the
hmsToRadians
and dmsToRadians
functions
respectively. The result is compared to a multiple of the
ARC_MINUTE
constant, which is the size of an arcminute
in radians. Any rows of the input table for which this comparison
is true are included in the output.
The functions and constants used here are described in detail
in Section 4.4.3.
tpipe -ifmt ascii survey.txt \ -select "OBJTYPE == 3 && Z > 0.15" \ -keepcols "IMAG JMAG KMAG" \ -stats
tpipe -classpath lib/drivers/mysql-connector-java.jar \ -Djdbc.drivers=com.mysql.jdbc.Driver \ x.fits \ -explode \ -tosql jdbc:mysql://localhost/ASTRO1#TABLEX -user mbt
jdbc.drivers
system property is set to the JDBC driver
class name. The output will be written as a new table TABLEX
in the MySQL database called ASTRO1 on a MySQL server on the
local host, using the priveliges of MySQL user mbt
.
If a password is required, it will be prompted for on the terminal
(the -password
flag could be used to specify it instead).
Any existing table in ASTRO1 with the name TABLEX is overwritten.
The only processing done here is by the -explode
flag,
which takes any columns which have fixed-size array values and
replaces them in the output with multiple scalar columns.
tpipe USNOB.FITS -every 1000000 -stats