Part 2b: Using the icepyx python library to access ICESat-2 data (ATL06)#

Tutorial Overview#

This notebook demonstrates how to search for, access, and plot a cloud-hosted ICESat-2 dataset using the icepyx package.

icepyx logo of the word icepyx in raised letters on an iceberg with an ice ax

icepyx is a community and software library for searching, downloading, and reading ICESat-2 data. While opening data should be straightforward, there are some oddities in navigating the highly nested organization and hundreds of variables of the ICESat-2 data. icepyx provides tools to help with those oddities.

Thanks to contributions from countless community members, icepyx can (for ICESat-2 data):

  • search for available data granules (data files)

  • order and download data or access it directly in the cloud

  • order a subset of data: clipped in space, time, containing fewer variables, or a few other options provided by NSIDC

  • navigate the available ICESat-2 data variables

  • read ICESat-2 data into Xarray DataArrays, including merging data from multiple files

  • access coincident Argo data via the QUEST (Query Unify Explore SpatioTemporal) module

  • add new datasets to QUEST via a template

Under the hood, icepyx relies on earthaccess to help handle authentication, especially for obtaining S3 tokens to access ICESat-2 data in the cloud. All this happens without the user needing to take any action other than supplying their Earthdata Login credentials using one of the methods described in the earthaccess tutorial.

In this tutorial we will look at the ATL06 Land Ice Height product.

Learning Objectives#

In this tutorial you will learn:

  1. how to use icepyx to search for ICESat-2 data using spatial and temporal filters;

  2. how to open and combine data multiple HDF5 groups into an xarray.Dataset using icepyx.Read;

  3. how to begin your analysis, including plotting.


The workflow described in this tutorial forms the initial steps of an Analysis in Place workflow that would be run on a AWS cloud compute resource. You will need:

  1. a JupyterHub, such as CryoCloud, or AWS EC2 instance in the us-west-2 region.

  2. a NASA Earthdata Login. If you need to register for an Earthdata Login see the Getting an Earthdata Login section of the ICESat-2 Hackweek 2023 Jupyter Book.

  3. A .netrc file, that contains your Earthdata Login credentials, in your home directory. See Configure Programmatic Access to NASA Servers to create a .netrc file.


This notebook is based on an icepyx Tutorial originally created by Rachel Wegener, Univ. Maryland and updated by Amy Steiker, NSIDC, and Jessica Scheick, Univ. of New Hampshire for the “Cloud Computing and Open-Source Scientific Software for Cryosphere Communities” Learning Workshop at the 2023 AGU Fall Meeting (using a different data product). A version of it was presented at the 2024 NEGM meeting.

It was updated in May 2024 to utilize (at a minimum) v1.0.0 of icepyx.

Using icepyx to search and access ICESat-2 data#

We won’t dive into using icepyx to search for and download data in this tutorial, since we already discussed how to do that with earthaccess. The code to search and download is still provided below for the curious reader. The icepyx documentation shows more detail about different search parameters and how to inspect the results of a query.

import icepyx as ipx