API Tutorials

Maps

SPEI 90 Day vs. SPEI 2 Year

This tutorial walks you through requesting different time-period Standardized Precipitation Evapotranspiration Index (SPEI) rasters for the entire US. It uses the GRIDMET DROUGHT dataset and the variables where climatic water balance was aggregated for the last 90 days and last two years. Once the requested rasters are in your google cloud storage bucket, it walks you through copying those into your COLAB files to generate a map. You will need to update the script with three values to run: 1) Insert your API Key, 2) Insert your Google Cloud Storage Bucket, 3) Insert your Project ID.

Access a Python tutorial notebook here.

Land Surface Temperature Trend

This tutorial walks you through requesting a slope of trend (Sen's Slope) raster for Land Surface Temperature (LST)  for the entire US. It uses the MODIS Terra 8 day dataset and calculates the trend using the yearly mean between April and September. Once the requested rasters are in your google cloud storage bucket, it walks you through copying those into your COLAB files to generate a map. You will need to update the script with three values to run: 1) Insert your API Key, 2) Insert your Google Cloud Storage Bucket, 3) Insert your Project ID.

Access a Python tutorial notebook here.

GIF Map

This tutorial walks you through generating a GIF map for storytelling and data visualization. Once the requested rasters for the GIF are in your google cloud storage bucket, it walks you through copying those into your COLAB files to generate a series of maps. Then the series of maps will be converted into a GIF. You will need to update the script with three values to run: 1) Insert your API Key, 2) Insert your Google Cloud Storage Bucket, 3) Insert your Project ID.

Access a Python tutorial notebook here.

Time Series

Snotel Stations

This tutorial walks you through requesting SNODAS Snow Water Equivalent (SWE) and Snow Depth time series for all of the active Snotel Stations in the continental US and exporting them to your google drive. As part of a for loop, this tutorial generates csvs and plots for every station. You will need to update the script with your API Key to run the notebook.

Access a Python tutorial notebook here

Long-term vs. Short-term Blends

This tutorial walks you through requesting Long-term and Short-term Blend data for a point and generating a two-variable plot. You will need to update the script with your API Key to run the notebook.

Access a Python tutorial notebook here.

Access a R tutorial notebook here. See an HTML version of the R notebook here.

Chart GIF

This tutorial walks you through generating a GIF chart for storytelling and data visualization. For this example, we use a Earth Engine hosted state boundary dataset and the RAP Annual Forb & Grass Cover dataset. You will need to update the script with your API Key to run the notebook.

Access a Python tutorial notebook here.

Compare ET Models

This tutorial walks you through pulling timeseries data for different ET models available through OpenET for multiple areas of interest. We walk through making the API requests, exporting them as csv, and plotting them as png. For this example, we use a small example boundary dataset and the models available through OpenET. You will need to update the script with your API Key to run the notebook.

Access a Python tutorial notebook here.

Access a R tutorial notebook here. See an HTML version of the R notebook here.

Plot Groundwater Level vs NDVI/PPT

This tutorial walks you through pulling timeseries data at well locations to plot groundwater level vs NDVI and Precipitation at that location. We walk through requesting June-July-August NDVI and water year precipitation with the Climate Engine API, retrieving yearly well data from the USGS NWIS and applying additional processing to get June-July-August groundwater level, and then plotting them and adding trend lines. You will need to update the script with your API Key to run the notebook.

Access a Python tutorial notebook here.


Zonal Statistics

Group By Demos

This tutorial walks you through four different demos using the group_by endpoints. These endpoints return summaries

  • Demo #1: Percent Population in Each Heat Stress Category in Each US State
    • ERA5 HEAT
    • This demo explores API functionality that bins the Universal Thermal Climate Index (UTCI) into heat/cold stress categories. It then sums the population in each heat/cold stress category for each US State.
  • Demo #2: Acres of Corn in Drought Categories in Top 5 Producing States
    • gridMET Drought
    • This demo explores API functionality that bins 1 year SPI into drought categories. It then sums corn area in each drought category for each of the top five corn producing states.
  • Demo #3: Average Vulnerability in Each USDM Category in User Defined Polygon
    • USDM
    • This demo explores API functionality that selects categories in a discrete drought dataset and takes the mean vulnerability value for each drought category for a user defined polygon.
  • Demo #4: Population in Temperature Categories over July & August for California
    • gridMET
    • This demo creates a function that bins temperatures and sums population counts for each temperature category over a state. The function is then looped over multiple dates.

Access a Python tutorial notebook here.

Demo 1 Output

GridMET Drought Stacked Barchart

This tutorial demonstrates how to produce a stacked barchart of drought categories using timeseries data from gridMET Drought. In the example, we create a stacked barchart of 180-day standardized precipitation-evapotranspiration index (SPEI) over the state of Colorado from 2020-2023 using the zonal_stats/pixel_count/polygons API endpoint. We also produce annual summary tables of area in drought for the state of Colorado.

Access the RMarkdown tutorial here and see the knitted HTML file here.

Stacked barchart of 180-day SPEI for Colorado from 2020-2023

Still need help? Contact Us Contact Us