Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Download Daymet datasets from NASA OPeNDAP

This tutorial will demonstrate how to download Daymet: Daily Surface Weather Data on a 1-km Grid for North America, Version 4 for a bounding box. Daymet dataset is available for North America (NA), including Hawaii (HI) and Puerto Rico (PR).

This tutorial will demonstrate how to directly access and subset Daymet dataset using NASA OPeNDAP Hyrax. Hyrax allows direct access to selected variables for the dataset within the spatial-temporal bounds without having to download the whole data files.

Requirements

Access to NASA OPeNDAP requires NASA Earthdata authentication. We recommend authenticating your Earthdata Login (EDL) information using the earthaccess python library as follows:

Searching for Daymet Files

Daymet data files (or granules) are natively in netCDF4 format, and each file has one year’s worth of data. Data files are organized by variables (each for dayl, prcp, tmin, tmax, srad, swe, vp) and regions (each for US, PR, HI). For this tutorial, we will download data for the year 2024. We will first search for all the granules in the area of interest within the bounds of 170 W, 67.5N and 136.5W, 71.5N degrees.

Loading...

We will now search for all the Daymet granules overlapping the above bounding box using the Earthaccess Python library. We will also limit the period of our search to the year 2024 (Jan 1 to Dec 31, 2024). The earthaccess’s search_data allows searching dataset granules using NASA’s CMR API. It requires the dataset digital object identifier (DOI), time, and the bounding box.

Total granules found: 7

Now, the day granule information, including data URLs, is stored in granules. The OPeNDAP URLs are in the RelatedUrls fields of the granule metadata. Let’s extract the OPeNDAP URLS.

['dap4://opendap.earthdata.nasa.gov/collections/C2532426483-ORNL_CLOUD/granules/Daymet_Daily_V4R1.daymet_v4_daily_na_tmin_2024.nc', 'dap4://opendap.earthdata.nasa.gov/collections/C2532426483-ORNL_CLOUD/granules/Daymet_Daily_V4R1.daymet_v4_daily_na_vp_2024.nc', 'dap4://opendap.earthdata.nasa.gov/collections/C2532426483-ORNL_CLOUD/granules/Daymet_Daily_V4R1.daymet_v4_daily_na_prcp_2024.nc']

Project the bounds to Daymet CRS

Daymet is natively in lambert_conformal_conic (LCC) coordinate reference system. We can now reproject the bounding coordinates of the above geopandas object (gdf) to bounds_lcc for requesting to OPeNDAP later.

array([-2823222.26105783, 3101471.12476104, -1401567.56219731, 4328450.66251338])

Retrieve Daymet subset with OPeNDAP

Access to NASA OPeNDAP requires NASA Earthdata authentication. Please set up a new account if you do not already have a NASA Earthdata account. We will use earthaccess module to set up the authentication and return a session instance with an authorized bearer token.

OPeNDAP allows access to the dataset of interest, so you can only download the variables you are interested in and, by doing so, save the download bandwidth.

Now, we will retrieve the dataset from the OPeNDAP Hyrax server. The following step will take time to run.

References
  1. Thornton, M. M., Shrestha, R., Wei, Y., Thornton, P. E., & Kao, S.-C. (2022). Daymet: Daily Surface Weather Data on a 1-km Grid for North America, Version 4 R1. ORNL Distributed Active Archive Center. 10.3334/ORNLDAAC/2129