ALMA Science Archive

Jupyter Notebooks

This page contains Jupyter Notebooks to programatically access the ALMA Science Archive. The notebooks interact through Virtual Observatory standards with ALMA's ObsCore Table Access Protocol (TAP) service.

Queries in TAP are written in the SQL-like Astronomical Data Query Language (ADQL). ADQL queries include spatial queries as well as operations on other properties/columns of the database. This also allows the user detailed control over the returned columns.

In these Jupyter notebook we will exemplify some of the most common queries. For this we will be using the astropy affiliated PyVO client, which is interoperable with other valid TAP services from other observatories.

Table of Contents

0. Installation

1. Query one source

2. Query a catalogue of sources

3. Query by proposal and IDs

4. Query by science keyword

5. Query by spatial resolution

6. Query by covered frequency range

7. Query by Sensitivity

8. Query using Astroquery.ALMA

9. Download data after query

0. Installation

Install the required software with

pip3 install jupyterlab matplotlib pandas sklearn
pip3 install --upgrade --pre astroquery

download the Jupyter Notebooks

wget -O - | tar -xz
cd alma-science-archive-notebooks

and start the notebook server


You can modify the code in the cells and run each cell with "Shift+Enter". An introduction to Jupyter Notebooks can be found here.


Python 3.6 users, run: pip3 --upgrade astropy==4.1

If you experience problems with these notebooks, please contact us through the ALMA Helpdesk.

Throughout the notebooks we will access the ALMA ObsCore TAP service using:

Here some examples of the use of ADQL:

Example 0a: Query by coordinate and request the entire result table

Find all ALMA observations where the footprint of the observation (stored in the VO column 's_region') intersects with our search circle where RA, Dec and the search radius are given in decimal degrees:

The output has been directly converted into a pandas dataframe. For simplicity, we only display the first 5 rows.

The ALMA TAP table contains 63 columns with the following column names and units:

Example 0b: Query by coordinate and request only few columns

The query returns all ALMA observations where the footprint (s_region) intersects with the search circle specified by RA, Dec and the search radius, all in decimal degrees. Compared to the example above, the result table has now a much smaller width as only the target name, RA and Dec have been requested.