Archives of Photographic PLates for Astronomical USE

Scripted Access via TAP

This web application is an instance of Daiquiri, which comes with a built-in TAP interface according to the specifications from the International Virtual Observatory Alliance (IVOA).

The Table Access Protocol (TAP) was developed by IVOA is a second generation DAL interface being developed to provide a general access mechanism for tabular data, including but not limited to astronomical catalogs.

The URL for the APPLAUSE TAP service is:

You can find the full TAP documentation on the IVOA documentation website.

How to use TAP in Python

You need to install

    pip install pyvo

Pyvo allows to set a token for authorized access to your user account.

Your Daiquiri token is accessible at, once you’re logged in. You’ll need to replace the token of the examples with your own .

Access Daiquiri’s Token from your profile

This is how your code will look in Python, accessing the DR3 archive table, printing the name of each archive.

import numpy as np
import matplotlib.pyplot as plt
import pyvo as vo

# init tap service
tap_service = vo.dal.TAPService('')

# optional: use your API token to use your account instead of XXX
vo.utils.http.session.headers['Authorization'] = 'Token XXXX'

# run a syncronous query
tap_result = tap_service.run_sync('SELECT TOP 5 * FROM applause_dr3.archive')

# run a syncronous query
sql = ('SELECT * FROM applause_dr3.archive limit 5')
job = tap_service.submit_job(sql, language='postgresql', runid='test_pyvo')
result = job.fetch_result()

How to use TAP with TOPCAT

Topcat is a Tool for OPerations on Catalogues And Tables.

To use TAP in Topcat, you’ll need to select APPLAUSE as the service provider in Topcat:</code/>.

The full documentation how to use TAP in Topcat is located here.

How to use TAP on the command line

TAP can also be used with a HTTP command line client. Here we use HTTPie, but there are a lot of other similar clients (e.g. curl).

# retrieve the job list

# submit an asyncronous job (using PostgreSQL and the 5 minutes queue)
http -f --follow POST \
    QUERY="SELECT raj2000, dej2000 FROM applause_dr3.source_calib LIMIT 10" \
    LANG="postgresql-9.6" QUEUE="1h" PHASE="RUN"

# get all the information about a job

# check the status of a job

# get the results of a job as csv or votable

# archive the job (this deletes the database table and frees up space)
http --follow DELETE

As with the Python interface, you can also use your personal token to authenticate with the system to use your personal account (and your personal joblist, quota etc.). To do so, you need to send the token as part of the Authorization header with every HTTP request.

http Authorization:"Token c1a67d3db8b1c93e55573aa1a8a2133a5e65c301"