You must be logged in to get data
Log in using the CADC login page
If you are not logged in, you will probably get a message
"Table [ cfht.cfiscat ] is not found in TapSchema"
This because if you don't have access to a table,
you aren't even allowed to know it exists.
If you still can't
access the data, you need to be added to the CFIS-read group. Contact
one of the PIs who can give you access. If you are still not able to
access the data, contact the CADC help desk at:
Setting the query: Use the check boxes to select which columns to return. Apply constraints on any column using the entry boxes. Use the positional constraint boxes if you want restrict the search to a smaller area. Use magnitude limit, masking and field criteria. It's usually best to test a query with "Max rows" set to a small number, then switch to unlimited rows once you're sure you've got the constraints right.
Synchronous vs. Asynchronous queries: For small queries, restricted in position, only returning a hundred thousand rows or less, synchronous queries are fine. Just hit submit and wait a few seconds for the results. The results will show up directly in your browser. However, the CFIS database contains 400 million sources with close to 200 parameters recorded for each object; if your query will return a significant fraction of the database, the query will take up to an hour or more to complete. The connection between your broswer and the CADC server will probably be lost. In this case, you are probably better off using the asynchronous queries. In this the case, your query will be executed as before but the webpage returned will just indicate that the query is running until it completes, when it will give you a link to the location of the results in the CFIS queries VOspace. The results file will perist there for at least a week. If you lose track of your query, it will end up here with a file name that is a combination of your user name and the time (UTC) when you submitted the query. For example: george_2018-07-12T20:38:03.tsv
Note that the TAP server only supports the tsv, csv and VOtable formats at the moment.
Setting the query: As you fill out the query page form, you will notice that the text in the query box changes. You can also modify the text directly for a higher degree of customization. As well as selecting individual columns you can select combinations of columns: U_MAG_AUTO-R_MAG_AUTO for example. The query language is the Astronomical Data Query Language or ADQL which was developed by the IVOA. It's very similiar to SQL with a few additions. The only caveat concerning setting the query manually is that if you modify the query manually first, and then use the various checkboxes and fields on the web page, it will overwrite your edits.
Executing multiple queries:
If you click submit from the web page, you should get back the results. For one-off queries, this is fine. However you want to execute multiple (small) queries, you may want to execute the queries from a script. You can modify the query by changing the part of the URL after "query=" to set an arbitrary query (remember to encode the special characters). In synchronous mode, GETs to that URL should work.
For example, the following should work:
wget -O test.tsv 'http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/cat/sync?REQUEST=doQuery&LANG=ADQL&table=cfht.cfiscat&method=sync&format=tsv&query=SELECT%0D%0Atop+10%0D%0AID%2C+u_ALPHA_J2000%2C+u_DELTA_J2000%0D%0AFROM%0D%0Acfht.cfiscat%0D%0A'
Table Access Protocol (TAP): This is the VO standard for accessing tables. All the of the CFIS query pages are running TAP for you behind the scenes. However feel free to bypass them and access the table cfht.cfiscat directly. Documention for TAP in general can be found here. Details of the implementation at the CADC can be found here.
Astronomical Data Query Language (ADQL): The query language used by TAP is ADQL. As mentioned before, ADQL is based on SQL, special restrictions and extensions to SQL92 have been defined in order to support generic and astronomy specific operations. The full details of ADQL can be found here.
Universal Worker Service (UWS): In asynchronous mode, TAP uses UWS to monitor the progress of the query. More documentation for UWS is available here