How to Inspect Long Tables with mast-table#


Learning Goals#

This is a beginner tutorial on viewing long data tables using mast-table. We’ll cover the basics of creating mast-table widgets and interacting with their data. By the end of this tutorial, you will:

  • Understand how to create mast-table widgets.

  • Be able to configure your mast-table length to fit your preferences in the Roman Research Nexus (RRN).

  • Know how to open a mast-table widget in a new browser window (a “popout”).

Table of Contents#

Introduction#

This tutorial demonstrates how to create and manipulate views of mast-table, allowing you to adjust your notebook displays for your ideal table length and open your tables in popout windows. mast-table is an interactive table widget for displaying, exploring, and filtering tabular data, designed to support Mikulski Archive for Space Telescopes (MAST) query results. We use astroquery to retrieve data from MAST and then vizualize the results with mast-table. For more information about using MastMissions, see the notebook missions_mast_search.ipynb.

Imports#

We will leverage the mast-table package to create flexible app layouts, and we will use astroquery to populate the table widgets with example data.

  • mast-table to create table widgets

  • astroquery for retrieving example data to view

from mast_table import MastTable
from astroquery.mast import MastMissions

Inspecting Long Tables with mast-table#

Retrieving MAST Data#

First, we will get example MAST data from astroquery using the cell below. We are retrieving MAST data on Messier 1 from the James Webb Space Telescope (JWST). By running the cell below, we can see the astroquery results table.

# Create MastMissions object to search for JWST datasets
missions = MastMissions(mission='jwst')

# Query for Messier 1 ('M1')
results = missions.query_object('M1')

# Display the first 5 rows of the astroquery results (not using mast-table) to compare
results[:5]
Table masked=True length=5
ArchiveFileIDfileSetNameproductLeveltargproptarg_ratarg_decinstrumeexp_typeopticalElementsdate_obsdurationprogramobservtnvisitpublicReleaseDatepi_nameproposal_typeproposal_cycletargtypeaccesscal_verang_seps_region
int64str25str14str18float64float64str6str9str153str27float64int64int64int64str19str10str2int64str5str6str5float64str1417
244890661jw01714001003_02101_000011b, 2a, 2b, 2cCRAB-NEBULA83.6360495833333322.01641666666667MIRIMIR_IMAGEF560W2023-02-24T02:49:57.2040000138.7521714132024-02-24T13:38:23Temim, TeaGO1FIXEDPUBLIC2.0.10.0POLYGON ICRS 83.620763784 22.002789691 83.654481962 22.001837212 83.655563535 22.033234147 83.621792264 22.034478016
244890685jw01714001003_02101_000021b, 2a, 2b, 2cCRAB-NEBULA83.6360495833333322.01641666666667MIRIMIR_IMAGEF560W2023-02-24T02:53:39.2200000138.7521714132024-02-24T13:38:36Temim, TeaGO1FIXEDPUBLIC2.0.10.0POLYGON ICRS 83.615725007 22.003119338 83.649443299 22.002167938 83.650523705 22.033564908 83.616752308 22.034807696
244890676jw01714001003_02101_000031b, 2a, 2b, 2cCRAB-NEBULA83.6360495833333322.01641666666667MIRIMIR_IMAGEF560W2023-02-24T02:57:23.9880000138.7521714132024-02-24T13:36:13Temim, TeaGO1FIXEDPUBLIC2.0.10.0POLYGON ICRS 83.616528154 22.007520938 83.650247486 22.006569363 83.651328117 22.037966327 83.617555678 22.039209290
244890655jw01714001003_02101_000041b, 2a, 2b, 2cCRAB-NEBULA83.6360495833333322.01641666666667MIRIMIR_IMAGEF560W2023-02-24T03:01:06.0030000138.7521714132024-02-24T13:35:43Temim, TeaGO1FIXEDPUBLIC2.0.10.0POLYGON ICRS 83.620386882 22.006718593 83.654105998 22.005766255 83.655187449 22.037163195 83.621415234 22.038406922
244890605jw01714001003_02103_000011b, 2a, 2b, 2cCRAB-NEBULA83.6360495833333322.01641666666667MIRIMIR_IMAGEF1130W2023-02-24T03:06:50.0870000105.4521714132024-02-24T13:36:54Temim, TeaGO1FIXEDPUBLIC2.0.10.0POLYGON ICRS 83.620747224 22.002797268 83.654465081 22.001844591 83.655546548 22.033241738 83.621775841 22.034485516

Creating a mast-table#

We will now create an instance of mast-table using the cell below. We are displaying the widget inline below the cell.

# Create a mast-table instance
mast_table = MastTable(results)

# Display the widget below
mast_table

You now have a mast-table instance displayed inline above. By default, mast-table displays 5 rows per page, so you should see the first 5 results displayed in the table. Take a moment to compare the mast-table widget with the displayed first 5 rows of the astroquery results table from the cell above.

Using the arrow buttons on the bottom right of the table widget, change the page displayed so that you see the results “11-15”.


Changing Table Length#

Though mast-table defaults to displaying 5 rows per page, you can adjust the number of rows displayed using the “Rows per page” dropdown menu on the bottom right of the table. Using this menu, adjust the mast-table instance above to display 10 rows, 15 rows, and then all rows.


We are interacting with well over 200 rows of data, which is not the easiest to view in chunks of 5 to 10 rows or by displaying “all rows”.

Users can specify items_per_page to any length they desire when creating a mast-table instance. Let’s say that increments of 50 fit nicely on your screen. Using the cell below, create a mast-table that shows 50 rows per page.

# Create a mast-table instance
mast_table_50 = MastTable(
    results,
    items_per_page=50
)

# Display the widget below
mast_table_50

Take a moment now to scroll through the pages of data displayed (using the buttons on the bottom right of the widget) or set your own custom items_per_page to fit your screen.


Pop Out mast-table into a New Browser Window#

Displaying mast-table inline can still make your workflow more challenging if you need to scroll to interact with other parts of the notebook. mast-table offers a “popout” button that opens the widget in a separate browser window. You can then adjust the browser window dimensions to fit your screen and keep your mast-table visible while you work elsewhere in the notebook. Look for the popout button (inline below) in the header of mast_table_50. Click the button for mast_table_50 and customize your browser window so that you can see this notebook and the table.

notebooks/interactive_data_exploration/how_to/inspect_long_tables/popout_icon.png

About this Notebook#

Author(s): Celia Parts
Keyword(s): Tutorial, mast-table, introduction
First published: June 2026
Last updated: June 2026


Top of Page Space Telescope Logo