CADC The Canadian Astronomy Data Centre
If you have used CADC facilities for your research, please include the following acknowledgment:
This research used the facilities of the Canadian Astronomy Data Centre
operated by the National Research Council of Canada with the support of the Canadian Space Agency.
   Register  |  Contact
 
 Advanced Search

The Common Archive Observation Model (CAOM) TAP Service

This service implements the IVOA TAP-1.0 recommendation and exposes the Common Archive Observation Model (CAOM) content at CADC. The CAOM tables are all part of a schema called caom. The main tables are:

Following the TAP specification, we have implemented the following resources:

resourcedescription
http://www.cadc.hia.nrc.gc.ca/tap/async TAP asychronous endpoint (UWS job list, POST to create job, GET forbidden)
http://www.cadc.hia.nrc.gc.ca/tap/sync TAP sychronous endpoint (GET and POST)
http://www.cadc.hia.nrc.gc.ca/tap/availability VOSI availability (GET)
http://www.cadc.hia.nrc.gc.ca/tap/capabilities VOSI capabilities (GET)
http://www.cadc.hia.nrc.gc.ca/tap/tables VOSI tables (GET)

IVOA Data Models

In addition to the CAOM, this TAP service also provides access to some standard data models via the following database tables:

Downloading Data

The accessURL column in the caom.Plane table can be used to download the data. Note that some data is proprietary (caom.Plane.dataRelease is null or in the future); if you try to use the accessURL for proprietary data you will be challenged to authenticate and an authorization check will be performed. The download will be permitted (or not) depending on those checks.

There is also an accessURL column in the caom.SIAv1 and ivoa.ObsCore tables.

There is a previewURL column in the caom.Observation table. By default, this URL will return a modest-sized graphical representation of the observation, but may return an error code (404: Not Found) if there is no preview available.

Proprietary Metadata

Some of the observations and planes in CAOM have proprietary metadata (caom.Plane.metaRelease is null or in the future). For anonymous queries, the service will automatically restrict access to public metadata only. Experimental: users may authenticate using https and client-side X.509 certficate, in which case they will see both public metadata and proprietary metadata they are authorised to view.

Unsupported ADQL Constructs

The following ADQL Functions are not currently supported: ALL and DISTINCT within an aggragate function (AVG, COuNT, MIN, MAX, COUNT) PI RAND TRUNCATE

Sample TAP Requests (w/ Queries)

Here are some examples of queries (with the minimal requied parameters) that should work and return a modest number of results. Note that the QUERY itself must be properly encoded since it has spaces and other special characters. These queries can be executed via the /caom/async or the /caom/sync endpoints; details on how to do that are given in the UWS and TAP specifications. We include some live URLs below that use the /caom/sync endpoint.

Query SIA view for observations that contain a location:

REQUEST=doQuery
LANG=ADQL
QUERY=select * from caom.SIAv1
      where CONTAINS(POINT('ICRS', 180, 5), position_bounds) = 1

Try It!

Query ObsCore view for observations that intersect a circle:

REQUEST=doQuery
LANG=ADQL
QUERY=select * from ivoa.ObsCore
      where INTERSECTS(s_region, CIRCLE('ICRS', 180, 5, 2)) = 1

Try It!

Query CAOM observations and products that intersect a circle and are calibrated or advanced products:

REQUEST=doQuery
LANG=ADQL
QUERY=select * from caom.Observation as o JOIN caom.Plane as p on o.obsID=p.obsID
      where INTERSECTS(position_bounds, CIRCLE('ICRS', 180, 5, 2)) = 1
        and observable_ctype in ('CAL', 'PROD')

Try It!

Query that refers to a non-existent column and table and should fail:

REQUEST=doQuery
LANG=ADQL
QUERY=select noSuchColumn from noSuchTable

Try It!

Experimental PQL Support

PQL (Parameterised Query Language) is now supported but experimental; it does not follow any existing standard. To use PQL instead of ADQL as the query language, you must include LANG=PQL as a job parameter, plus 1 or more additional parameters defined below.

Allowed PQL parameters:

The most general way to query is by using utype parameters from a data model. The service can find the appropriate tables and columns automatically and can even infer joins between tables if the foreign key relationship is described in the TAP_SCHEMA. For example, if the PQL parameters include utypes from the caom.Observation and caom.Plane tables, the correct join will be used to generate the query. It should be noted that the TAP_SCHEMA tables themselves, while described in the TAP_SCHEMA with all the appropriate foreign keys, cannot feasibly be used with our experimental PQL implementation (except with a single TABLE parameter) : they do not have utypes (yet) and column names are generally ambiguous because the same column names are used in multiple tables. We intend to add utypes taken from the VODataService specification to resolve this.

PQL query using the ivoa.ObsCore data model utypes:

REQUEST=doQuery
LANG=PQL
obscore:DataID.collection=JCMT
obscore:Obs.dataProductType=spectrum

Try It!

Note: We are currently working on expanding the capabilities of PQL, specificially in specifying values and other kinds of conditions.

RSS Support

The caller can ask for RSS output format instead of the default VOTable. A URL with FORMAT=rss and LANG=PQL and one or more PQL parameters is a valid RSS feed that can be subscribed to using a variety of clients. By default, RSS queries a limited to 10 rows (items).

RSS feed on the entire ivoa.ObsCore table:

REQUEST=doQuery
FORMAT=rss
LANG=PQL
TABLE=ivoa.ObsCore

Subscribe!

RSS feed of calibrated images from ivoa.ObsCore table -- using utypes only!:

REQUEST=doQuery
FORMAT=rss
LANG=PQL
obscore:Obs.calibLevel=2
obscore:Obs.dataProductType=image

Subscribe!

RSS feed of calibrated optical images from CAOM -- using utypes only!:

REQUEST=doQuery
FORMAT=rss
LANG=PQL
caom:Plane.calibrationLevel=2
caom:Plane.energy.emBand=Optical
caom:Plane.dataProductType=image

Subscribe!