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.

Calculator of Risk to Terrestrial Carbon Pool

UK Centre for Ecology & Hydrology

Challenge and Methodological Approach Summary

The Terrestrial Carbon Pool refers to the total amount of carbon stored in terrestrial (land-based) ecosystems. It is a key component of the global carbon cycle and plays a central role in regulating atmospheric carbon dioxide (CO₂) levels. Key constituents include: vegetation, dead organic matter and soil organic matter. The size of the terrestrial carbon pool is influenced by factors such as land use, climate change, and natural disturbances (e.g., wildfires, pests).

Accessing the relevant data and calculating the risk to the terrestrial carbon pool is one component of giving national and regional stakeholders (policy makers, charities, investors etc.) the right tools and information to make decisions about the implementation of Net Zero policies that balance land-based mitigation against other environmental, social and economic impacts, including the UN Sustainable Development Goals.

This notebook describes and implements a “Risk to Terrestrial C Pool” data pipeline. The Net Primary Production (NPP) is the amount of carbon dioxide that is captured by plants through photosynthesis and converted into organic matter. It is used here to quantify the size of the terrestrial C pool and capture its patterns across space and time.

The following steps are pefromed in the pipeline:

  1. Data Sourcing:

    • Download and prepare the data needed for the analysis, including MODIS Land Cover and Net Primary Production Products, European Space Agency (ESA) Climate Change Initiative (CCI) Soil Moisture Dataset and Global Standardized Precipitation-Evapotranspiration Index (SPEI) Dataset.

  2. Data Processing:

    • Calculate probability of drought, vulnerability of NPP to drought and risk posed by drought to NPP.

    • The user can select to use EO based soil moisture or the standardized precipitation-evapotranspiration index as the drought index

  3. Plot results

Import Libraries and Set Data Directory

A lot of the data for this tutorial is stored as NetCDF files, which is a common file format for gridded land-based data, such as climate and Earth Observation (EO) data. This type of data is handled efficiently by Xarray, a Python package designed for working with multi-dimensional arrays and datasets. The data is stored in a structured format that allows for easy access and manipulation of variables, dimensions, and attributes.

Note: Set the path to your home directory in the following block of code.
Source

Select Area of Interst

Loading...

Data Sourcing and Processing

Land Cover (LC) and Net Primary Production (NPP) Data

These data are used to calculate the vulnerability of the terrestrial carbon pool to drought. The data are obtained from the MODIS Land Cover product and NPP product.

The data are downloaded from the NASA Earth Data website. The data are in netcdf format and are projected to the WGS84 coordinate system. The following block of code will download 50-200MB of data depending on the size of the selected country.

Downloading LC and NPP Data

Note: Please set up an account at NASA Earthdata before proceeding with running the following blocks of code.

To get access to the data first we create a task in the NASA APPEARs system. When the task is submitted you will receive an email from “appeears-noreply@nasa.gov” with a link to monitor the progress - currently at https://appeears.earthdatacloud.nasa.gov/explore. The task may take a while to complete and the notebook could be closed/disconnected while this is going on, then once complete just skip to the downloading code block (Step 6) and enter the task ID from the email.

Steps 1-5 are only needed once to create and submit the data request to the NASA Earth Data website. In subsequent runs of the notebook skip to step 6 to download the data.

  1. Authenticate with AρρEEARS API

Source
  1. Create a list for products to be requested

Notebook Cell
Product {'Product': 'MOD17A3HGF', 'Platform': 'Terra MODIS', 'Description': 'Net Primary Production (NPP) Gap-Filled', 'RasterType': 'Tile', 'Resolution': '500m', 'TemporalGranularity': 'Yearly', 'Version': '061', 'Available': True, 'DocLink': 'https://doi.org/10.5067/MODIS/MOD17A3HGF.061', 'Source': 'LP DAAC', 'TemporalExtentStart': '2000-02-18', 'TemporalExtentEnd': 'Present', 'Deleted': False, 'DOI': '10.5067/MODIS/MOD17A3HGF.061', 'Info': {}, 'ProductAndVersion': 'MOD17A3HGF.061'}
  1. Define area of interest -- use the geometry of aoi produced previously

Source
  1. Create a task request

Source
  1. Post json to the API task service and track progress

Source
  1. Download the data

done
Downloaded files can be found at: c:\Users\jercar\OneDrive - UKCEH\VSCode\Jupyter_Books\UKCEH_Data_Science_Book\notebooks\methods\NCI_WP2A2\data\ncidata\temp/Morocco\EO_data

Reading and Plotting LC and NPP Data

Read the data. Set the CRS. Clip data to the area of interest:

Plotting the Net Primary Production (NPP) data:

<Figure size 640x480 with 2 Axes>

Plot the Land Cover (LC) data:

Source
<Figure size 600x400 with 2 Axes>

Soil Moisture (SM) data

Soil Moisture data are obtained from the European Space Agency (ESA) Climate Change Initiative (CCI) Soil Moisture dataset. The data are in netcdf format, are projected to the WGS84 coordinate system and cover the entire world (thus, can be downloaded only once when implementing this algorithm for multiple countries). See here for more information on the dataset. The following block of code will download ~ 4.5GB of data.

Downloading SM Data

Output
Fetching long content....

Reading and Plotting SM Data

Read soil moisture data. Resample to monthly-then-annual frequency. Clip to the area of interest.

Plotting the soil moisture data:

<Figure size 640x480 with 2 Axes>

Standardized Precipitation-Evapotranspiration Index (SPEI) Data

The following code downloads the pre-calculated SPEI data from the SPEI database. The data are in netcdf format, are projected to the WGS84 coordinate system and cover the entire world (thus, can be downloaded only once when implementing this algorithm for multiple countries).

Downloading SPEI Data

Reading and Plotting SPEI Data

Reading SPEI data:

Plotting the SPEI data:

<Figure size 640x480 with 2 Axes>

Merging Data

The NPP, LC, Soil Moisture and SPEI data are merged into a single dataset. The dataset is saved as a netcdf file. The resulting netcdf file will vary in size depending on the size of the selected country and can take up to 10GB of space.

Calculate Risk to Terrestrial C Pool

Risk calculation is performed using the approach presented in van Oijen et al 2013 where the risk is defined as the probability of drought multiplied by the vulnerability of NPP to drought.

The user can choose (1st line in code block below) the drought metric to use for the risk calculation: 1. the Standardized Precipitation-Evapotranspiration Index (SPEI) or 2. the Soil Moisture data.

Plotting Input Data and Risk to Terrestrial C Pool

Source
<Figure size 1200x600 with 12 Axes>
References
  1. van Oijen, M., Beer, C., Cramer, W., Rammig, A., Reichstein, M., Rolinski, S., & Soussana, J.-F. (2013). A novel probabilistic risk analysis to determine the vulnerability of ecosystems to extreme climatic events. Environmental Research Letters, 8(1), 015032. 10.1088/1748-9326/8/1/015032