Programmatic Interfaces

Content Migration

WARNING: This page has been deprecated and the content migrated to MAST API Access.  Please update your links accordingly.

JWST data may be queried and accessed via community tools or user-written programs through an application programming interface, such as the MAST API, or various Virtual Observatory tools.

On this page

Programmatic interfaces allow a user to discover and access JWST data through scripted queries in various programming languages, instead of going through the standardized web interface. This affords a greater degree of complexity and customization in searches and retrievals. Through this mechanism the user may also cast a wider search net in an effort to discover any and all data related to a particular object or location. The 2 primary methods of performing these queries are through the MAST API or a Virtual Observatory service.



MAST API 

There are some circumstances where using the API is essential for searching and retrieving JWST data. These tend to be programs that produce very large numbers of data products (tens of thousands) per Observation, which can overload the MAST Portal download basket. Examples include:

  • Wide field slitless spectra (WFSS) configurations of NIRCam or NIRISS, which produce level-3 products for each extracted spectrum (of which there could be thousands).
  • Multicolor imaging surveys which include many dither positions as well as many spatial tiles. These produces both large numbers of science exposures, as well as many guide star files because of the associated spacecraft maneuvers.
  • Lengthy moving target observations, particularly if multiple instruments or configurations are used. Again, there may be many thousands of science files, along with many thousands of guide star files as the spacecraft tracks the target.

Astroquery.mast

Words in bold are GUI menus/
panels or data software packages; 
bold italics are buttons in GUI
tools or package parameters.

There are multiple ways of discovering and accessing data in MAST using custom scripts. By far the easiest method is to use the Python package astroquery.mast. This package calls most of the same back-end MAST web services as the MAST Portal, but the Python interface enables a great deal more options for customization and data analysis. This package can be used both for standard queries by target/coordinates, or for searches by values of instrument keywords (e.g., for time-series observations). See Using MAST APIs in the JWST Archive Manual for links to tutorials and Jupyter notebooks. 

Auth.MAST Tokens

Note that if you wish to download data that are protected under the Exclusive Access Policy, you must be both authenticated (i.e., logged in) and authorized to obtain data for the EAP program in question. The login for API queries requires a MAST API Token to download these data products.

Mashup

Mashup Application Programming Interface (API) provides a way to access data stored in the Mikulski Archive for Space Telescopes (MAST) through a programming language of the user's choice. It does this by translating customized URL requests into database queries, which allows the user to create scripts designed to assemble specific query parameters and to send those queries in batches. This includes the ability to perform cross-matching searches with various data catalogs, cone searches of a specific target location, table filtering based on specific columns, and target name resolution.

For detailed service descriptions, instructions, and examples of this API in use with Python, please refer to the Mashup API page. This page also includes a Jupyter notebook-style example of a Python MAST data search and retrieval.



VO services

The NASA Astronomical Virtual Observatories (NAVO) program aims to provide access to data stored in some of NASA’s largest archives by creating a standardized interface for submitting queries across multiple datasets. These archives include MAST along with the High-Energy Astrophysics Science Archive Research Center (HEASARC), the Infrared Science Archive (IRSA), and the NASA Extragalactic Database (NED)

Similar to the Mashup API, VO services also primarily function by translating customized URL requests into database queries. The 4 primary types of available queries follow:

SCS, SIAP, and SSAP queries all provide broad methods of data discovery within certain search parameters, while TAP is better suited to finding specific data as it supports more complex SQL-like queries.

More information on VO access to MAST holdings can be found here. Table 1 lists additional VO resources and tools.


Table 1. Additional VO resources

Canadian Virtual ObservatoryVarious VO tools hosted by the CADC.
CasJobsA tool for creating custom databases using MAST and GALEX data.
DataScopeTarget name and position searches hosted by HEASARC.
International Virtual Observatory AllianceThe IVOA sets standards and facilitates international VO cooperation. A good deal of VO information and links to more tools can be found here.
Virtual Observatory ServicesA collection of VO tools developed by researchers at Johns Hopkins University.


References

International Virtual Observatory Alliance

Mashup API for MAST

Using MAST APIs

Python astroquery.mast package



Latest updates
Originally published