Next Previous Up Contents
Next: tapresume: Resumes a previous query to a Table Access Protocol server
Up: tapquery: Queries a Table Access Protocol server
Previous: Usage

B.28.2 Examples

Here are some examples of tapquery:

stilts tapquery tapurl=https://gea.esac.esa.int/tap-server/tap
                adql='SELECT TOP 1000 source_id, ra, dec
                      FROM gaiadr3.gaia_source
                      ORDER BY random_index'
                out=g.fits
Executes the given ADQL query on the service referenced by the URL and writes the result to a FITS file.
stilts tapquery tapurl=https://gea.esac.esa.int/tap-server/tap
                adql='SELECT TOP 1000 source_id, ra, dec
                      FROM gaiadr3.gaia_source
                      ORDER BY random_index'
                sync=true auth=true
                out=g.fits
Same as the previous example, except that sync=true runs the query synchronously instead of asynchronously, and auth=true will attempt to log in to the service (prompting you for username and password) if it offers authentication.
stilts tapquery
       tapurl=http://dc.g-vo.org/tap
       adql='SELECT *
             FROM twomass.data AS t
             JOIN TAP_UPLOAD.up1 AS s
                  ON DISTANCE(t.raj2000,t.dej2000,s.ra2000,s.dec2000)<5./3600'
       nupload=1 upload1=6dfgs_E7.fits ucmd1='select BMAG-RMAG<0'
       maxrec=20000
       ocmd='tablename 2mass_x_6df' omode=topcat
The local table 6dfgs_E7 is filtered to contain only rather blue objects, and the resulting selection is uploaded to the TAP server. A positional crossmatch with 5 arcsec tolerance is then performed on the server between this uploaded table and the twomass.data table held by the service. The adjusted maxrec parameter ensures that the result will not be artificially truncated to shorter than 20000 rows (assuming the service limits permit this). When the result is received, it is loaded directly into TOPCAT with the name "2mass_x_6df".


Next Previous Up Contents
Next: tapresume: Resumes a previous query to a Table Access Protocol server
Up: tapquery: Queries a Table Access Protocol server
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