Next Previous Up Contents
Next: tcopy: Converts between table formats
Up: tcatn: Concatenates multiple tables
Previous: Usage

B.26.2 Examples

Here are some examples of tcatn:

stilts tcatn nin=2 in1=obs1.fits in2=obs2.fits out=combined.fits
Concatenates two similar observation catalogues to form a combined one. In this case, both input and output tables are FITS files.
stilts tcatn nin=3 omode=stats in1=obs1.txt ifmt1=ascii
                               in2=obs2.xml ifmt2=votable
                               in3=obs3.fit ifmt3=fits
Three catalogues with similar forms but in different data formats are joined. Instead of writing the result to an output file, the resulting joined catalogue is examined to calculate its statistics, which are written to standard output.
stilts tcatn nin=2 in1=survey.vot.gz ifmt2=csv in2=more_data.csv
             icmd1='addskycoords fk5 galactic RA2000 DEC2000 GLON GLAT' \
             icmd1='keepcols "OBJ_ID GLON GLAT"' \
             icmd2='keepcols "ident gal_long gal_lat"' \
             loccol=FILENAME
             omode=topcat
In this case we are trying to concatenate results from two tables which are quite dissimilar to each other. In the first place, one is a VOTable (no ifmt1 parameter is required since VOTables can be detected automatically), and the other is a comma-separated-values file (for which the ifmt2=csv parameter must be given). In the second place, the column structure of the two tables may be quite different. By pre-processing the two tables using the icmd1 & icmd2 parameters, we produce in each case an input table which consists of three columns of compatible types and meanings: an integer identifier and floating point galactic longitude and latitude coordinates. The second table contains such columns to start with, but the first table requires an initial step to convert FK5 J2000.0 coordinates to galactic ones. tcatn joins the two doctored tables together, to produce a table which contains only these three columns, with all the rows from both input tables, and sends the result directly to a new or running instance of TOPCAT. An additional column named FILENAME is appended to the table before sending it; this contains "survey.vot.gz" for all the columns from the first table and "more_data.csv" for all the columns from the second one.


Next Previous Up Contents
Next: tcopy: Converts between table formats
Up: tcatn: Concatenates multiple tables
Previous: Usage

STILTS - Starlink Tables Infrastructure Library Tool Set
Starlink User Note256
STILTS web page: http://www.starlink.ac.uk/stilts/
Author email: m.b.taylor@bristol.ac.uk
Mailing list: topcat-user@jiscmail.ac.uk