In both scenarios, we will be accessing data directly from Amazon Web Services (AWS), specifically in the us-west-2 region, which is where all cloud-hosted NASA Earthdata reside. This shared compute environment (JupyterHub) is also running in the same location. We will then load the data into Python as an xarraydataset.
See the bottom of the notebook for additional resources, including several tutorials that that served as a foundation for this clinic.
A note on subsetting
In addition to directly accessing the files archived and distributed by each of the NASA DAACs, many datasets also support services that allow us to customize the data via subsetting, reformatting, reprojection/regridding, and file aggregation. What does subsetting mean? Here’s a generalized graphic of what we mean.
Note: “direct cloud access” is also called “direct S3 access” or simply “direct access”. And “subsetting” is also called “transformation”.
Learning Objectives
Utilize the earthaccess python library to search for data using spatial and temporal filters and explore search results
Perform in-region direct access of data from an Amazon Simple Storage Service (S3) bucket
Extract variables and spatial slices from an xarray dataset
Plot data using xarray
Conceptualize data subsetting services provided by NASA Earthdata, including Harmony
Plot a polygon geojson file with a basemap using geoviews
Utilize the harmony-py library to request data over the Gulf of Mexico
Prerequisites
First we’ll import python packages and set our authentication that will be used for both of our access and subsetting methods.
You’ll also need to be aware that data in NASA’s Earthdata Cloud reside in Amazon Web Services (AWS) Simple Storage Service (S3) buckets. Access is provided via temporary credentials; this access is limited to requests made within the US West (Oregon) (code: us-west-2) AWS region. While this compute location is required for direct S3 access, all data in Earthdata Cloud are still freely available via download.
Import Required Packages
# Suppress warningsimport warningswarnings.simplefilter('ignore')warnings.filterwarnings('ignore')# Direct accessimport earthaccess from pprint import pprintimport xarray as xr# Harmonyimport geopandas as gpdimport geoviews as gvgv.extension('bokeh', 'matplotlib')from harmony import BBox, Client, Collection, Request, LinkTypeimport datetime as dtimport s3fs%matplotlib inline
/srv/conda/envs/notebook/lib/python3.9/site-packages/geoviews/operation/__init__.py:14: HoloviewsDeprecationWarning: 'ResamplingOperation' is deprecated and will be removed in version 1.17, use 'ResampleOperation2D' instead.
from holoviews.operation.datashader import (