Informational:
At today’s (20 May 2022) DP0 Delegates working meeting, there was a question on whether it was possible to access and query external TAP services from within an RSP Jupyter notebook. In particular, the question was whether it was possible to query the PanSTARRS1 TAP service from within an RSP Juptyer notebook from https://data.lsst.cloud.
Fortunately, this was previously asked (and answered!) by Robert Nikutta in a Community Forum post in July 2021 (link.
Basically, although there is a convenience function, get_tap_service()
within the rubin_jupyter_utils.lab.notebook
module, it appears it only accesses TAP services internal to Rubin. (An example of using get_tap_service()
for accessing the Rubin TAP service can be found in the excellent DP0 tutorial notebook, 02_Intermediate_TAP_Query.ipynb
.)
Robert Nikutta discovered that get_tap_service()
uses pyvo.dal.TAPService()
“under the hood”; so, to access and query external TAP services, once can use the following:
import pyvo
tap = pyvo.dal.TAPService('https://datalab.noirlab.edu/tap')
tap.run_sync('select count(*) from gaia_edr3.gaia_source')
<Table length=1>
COUNT
int32
----------
1811709771
We confirmed that Robert’s solution still works at today’s meeting. Now, how to access the PanSTARRS1 TAP service from an RSP notebook on https://data.lsst.cloud? First, we need to find the access url for the PanSTARRS1 TAP service. There are several ways to go about this:
-
Google “TAP access endpoint panstarrs” in your browser. This will lead you to the following page among the top matches to your google search:
You will want to click on the ‘+’ sign next to “Table Access Protocol” to find the URL you will need:
-
Instead of Googling, you can go straight to the STScI NAVO directory at http://vao.stsci.edu/keyword-search/ and enter “panstarrs” in the search box. It will return you several links (the top of which goes to the above webpage) for you to investigate:
-
If you are familiar with TOPCAT, you can use its TAP service functionality to find the correct URL; e.g.:
(In a future post, we will review how to access and query the Rubin TAP service from within TOPCAT.)