ICESat-2 and Landsat cloud access and data integration
Contents
ICESat-2 and Landsat cloud access and data integration#
This notebook (download
) builds off of the icepyx IS2_cloud_data_access.ipynb and ICESat-2 Hackweek Data Integration 1 tutorials. It illustrates the use of icepyx for accessing ICESat-2 data currently available through the AWS (Amazon Web Services) us-west2 hub s3 data bucket as well as data integration with Landsat (cloud-optimized geotiff) and ATM (downloaded csv) datasets.
Learning Objectives
Goals
Identify and locate ICESat-2 and Landsat data
Acquire data from the cloud
Open data in
pandas
andxarray
and basic functioning of DataFrames
Key Takeaway
By the end of this tutorial, you will be able to visualize Landsat Cloud Optimized Geotiffs with ICESat-2 and ATM data.
Notes#
ICESat-2 data became publicly available on the cloud on 29 September 2022. Thus, access methods and example workflows are still being developed by NSIDC, and the underlying code in icepyx will need to be updated now that these data (and the associated metadata) are available. We appreciate your patience and contributions (e.g. reporting bugs, sharing your code, etc.) during this transition!
This example and the code it describes are part of ongoing development. Current limitations to using these features are described throughout the example, as appropriate.
You MUST be working within an AWS instance. Otherwise, you will get a permissions error.
Authentication is still more steps than we’d like. We’re working to address this - let us know if you’d like to join the conversation!
For this tutorial, feel free to run the code along with us as we live code by downsizing the zoom window and splitting your screen (or using two screens). Or you can simply watch the zoom walkthrough. Don’t worry if you fall behind on the code. The notebook is standalone and you can easily run the code at your own pace another time to catch anything you missed.
Computing environment#
We’ll be using the following open source Python libraries in this notebook:
# Suppress library deprecation warnings
import logging
logging.captureWarnings(True)
import ipyleaflet
from ipyleaflet import Map, basemaps, basemap_to_tiles, Polyline
import ipywidgets
import datetime
import re
%matplotlib widget
import pystac_client
import geopandas as gpd
import h5py
import ast
import pandas as pd
import geoviews as gv
import hvplot.pandas
from ipywidgets import interact
from IPython.display import display, Image
import intake # if you've installed intake-STAC, it will automatically import alongside intake
import intake_stac
import xarray as xr
import matplotlib.pyplot as plt
import boto3
import rasterio as rio
from rasterio.session import AWSSession
from rasterio.plot import show
import rioxarray as rxr
from dask.utils import SerializableLock
import os
import fiona
import hvplot.xarray
import numpy as np
from pyproj import Proj, transform
import cartopy.crs as ccrs
1. Identify and acquire the ICESat2 product(s) of interest#
Download ICESat-2 ATL06 data from desired region#
We are going to use icepyx to download some ICESat-2 ATL06 data over our region of interest.
import icepyx as ipx
# Specifying the necessary icepyx parameters
short_name = 'ATL06'
spatial_extent = 'hackweek_kml_jakobshavan.kml' # KML polygon centered on Sermeq Kujalleq
date_range = ['2019-04-01', '2019-04-30']
rgts = ['338'] # IS-2 RGT of interest
You may notice that we specified a RGT track. As seen below, a large number of ICESat-2 overpasses occur for Sermeq Kujalleq (briefly known as Jakobshavn Isbrae). In the interest of time (and computer memory), we are going to look at only one of these tracks.
# Open KML file for use
fiona.drvsupport.supported_drivers['LIBKML'] = 'rw' # enable KML support which is disabled by default
jk = gpd.read_file(spatial_extent)
# Setup the Query object
region = ipx.Query(short_name, spatial_extent, date_range, tracks=rgts)
# Visualize area of interest
region.visualize_spatial_extent()
Looks like we have an ICESat-2 track! Let’s quickly visualize the data to ensure that there are no clouds impacting the photon returns.
Note: While preparing this tutorial, we found a bug in the icepyx code (missed after recent changes to spatial information handling to deal with cross-dateline regions). We’re in the process of correcting it there, but implemented this inline fix for now.
plotspat_ext = list(region.spatial.extent_as_gdf.geometry.unary_union.minimum_rotated_rectangle.bounds)
plotreg = ipx.Query(short_name, plotspat_ext, date_range, tracks=rgts)
# Request information from OpenAltimetry
cyclemap, rgtmap = plotreg.visualize_elevation()
rgtmap
Generating urls
Sending request to OpenAltimetry, please wait...
100%|██████████| 1/1 [00:01<00:00, 1.59s/it]
Plot elevation, please wait...