On this page...

Downloading a Jupyter Notebook from MAST

While viewing data in MAST Jdaviz, you can seamlessly transition to using Jdaviz within a Jupyter notebook in your local environment for deeper analysis. 

Notebook dependencies

To successfully run the Jupyter notebook, it requires the jdaviz and astroquery Python packages to be installed locally.

Click the Open Data In dropdown button and select Jupyter, as shown in Figure 1.  An auto-generated Jupyter notebook will be downloaded to your system, with the filename syntax of jdaviz_notebook_[PRODUCT_FILENAME].ipynb.   When run, this notebook will attempt to download the same data product you were viewing in the web, and open it within the Jdaviz Python application. 

Data need not be from MAST; you can manually download and load compatible data from any source.

Open Data in Jupyter dropdown menu

Figure 1 — Dropdown menu with the option to download a Jupyter notebook that will download and load the data product into a local Jdaviz application 

Running the Notebook

When you open the notebook, you will see something similar to Figure 2.  The top notebook cell contains a brief description of the notebook, listing the data product file that it's written to work with and some instructions on python package dependency installations.  There are four auto-generated code cells, that:

  1. Import the necessary Python packages
  2. Attempt to authenticate your user and download the data product using Astroquery
  3. Construct the local filepath to the downloaded data product
  4. Load the data product within the recommended Jdaviz configuration

For some examples of what can be done with Jdaviz in Jupyter, be sure to check out the notebooks repository dedicated to exactly that.

Example Jupyter Notebook with data from a Cubeviz file

Figure 2 — Example downloaded notebook for a 3d data product, to load into a local Cubeviz configuration

For Further Reading...

  • No labels

Data Use | Acknowledgements | DOI | Privacy

Send comments & corrections on this MAST document to: archive@stsci.edu