logo

Exploring Fire Burned Area products available through the C3S#

This notebook can be run on free online platforms, such as Binder, Kaggle and Colab, or they can be accessed from GitHub. The links to run this notebook in these environments are provided here, but please note they are not supported by ECMWF.

binder kaggle colab github

Introduction#

Biomass burning is one of the key processes affecting vegetation productivity, land cover, soil erosion, hydrological cycles and atmospheric emissions. Fire is affected by climate, as burning is associated with high to extreme weather conditions, but fire affects climate too, as it impacts carbon budgets and atmospheric emissions. These mutual influences between fire and climate explain why Fire Disturbance is considered one of the Essential Climate Variables (ECV) by the Global Climate Observing System (GCOS) programme (WMO 2022). The Fire Disturbance Essential Climate Variable includes Burned Area as the primary variable and two supplementary variables: Active Fire and Fire Radiated Power (or Fire Radiative Power - FRP). Burned Area is defined as the area affected by human-made or natural fire and is expressed in units of area such as hectare (ha) or square kilometre (km²) (Csiszar et al.,2009).

Learning objectives 🎯#

At the end of this notebook, the user will be able to:

  • Understand and use key terminology;

  • Retrieve data on Burned Area from the C3S Climate Data Store, examining, subsetting, saving and re-projecting it using Python code;

  • Create a time series of Burned Area information using the product;

  • Generate informative maps of burned area estimates, at a continental scale.

Key Terms & context#

The Burned Area products provide global information of total burned area (BA) at pixel and grid scale. The BA is identified with the date of first detection of the burned signal in the case of the pixel product, and with the total BA per grid cell in the case of the grid product. The products were obtained through the analysis of reflectance changes from medium resolution sensors (Terra MODIS, Sentinel-3 OLCI), supported by the use of MODIS thermal information. The burned area products also include information related to the land cover that has been burned, which has been extracted from the Climate Change Initiative (CCI) and Copernicus Climate Change Service (C3S) land cover datasets, thus assuring consistency between the datasets. (v5.1.1.cds uses the LC_cci dataset).

The algorithms for BA retrieval were developed by the University of Alcala (Spain), and processed by Brockmann Consult GmbH (Germany). Different product versions are available. FireCCI v5.0cds and FireCCI v5.1cds were developed as part of the Fire ECV Climate Change Initiative Project (Fire CCI) and brokered to C3S, offering the first global burned area time series at 250m spatial resolution. FireCCI v5.1cds used a more mature algorithm than the previous version 5.0cds, which has been deprecated. This algorithm was adapted to Sentinel-3 OLCI data to create the C3S v1.1 (previous v1.0 has been deprecated) burned area product, extending the BA database to the present.

The BA products are useful for researchers studying climate change, as they provide crucial information on burned biomass, which can be translated to greenhouse gases emissions amongst other contaminants. Burned area is also useful for land cover change studies, fire management and risk analysis.

Grid product#

Burned area (BA) dataset provided at a reduced resolution (0.25 degrees). This resolution is provided as requested by BA product users focused on global studies and climate modelling, who usually work at this scale.

Pixel product#

Burned area dataset provided at the maximum possible spatial resolution, which corresponds to the spatial resolution of the surface reflectance product used as input in the algorithm.

logo

Figure 1: Map of the day of first detection from the Pixel Burned Area product of December 2016

References:

  • Csiszar et al. (2009) Assessment of the status of the development of the standards for the Terrestrial Essential Climate Variables T13 - FIRE Fire Disturbance - Global Terrestrial Observing System - GTOS 68 v27, Rome, 2009

  • WMO (2022) The 2022 GCOS ECVs Requirements, GCOS – 245, Geneva, Switzerland.

Prepare your environment#

Set up CDSAPI and your credentials#

The code below will ensure that the cdsapi package is installed. If you have not setup your ~/.cdsapirc file with your credenials, you can replace None with your credentials that can be found on the how to api page (you will need to log in to see your credentials).

!pip install -q cdsapi
# If you have already setup your .cdsapirc file you can leave this as None
cdsapi_key = None
cdsapi_url = None
[notice] A new release of pip is available: 25.1.1 -> 25.3
[notice] To update, run: python.exe -m pip install --upgrade pip

(Install and) Import libraries#

The Jupyter Notebook must be set up with all the necessary available tools from the Jupyter Notebook ecosystem. Make sure to have all the necessary libraries already pre-installed. Here is the list of the modules we will be using in this exercise.

Module name

Description

numpy

NumPy is the fundamental package for scientific computing with Python and for managing ND-arrays.

rasterio

Rasterio is a library that allows operations on gridded raster data such as satellite images or terrain models.

xarray

Xarray is a very user friendly library to manipulate NetCDF files within Python. It introduces labels in the form of dimensions, coordinates and attributes on top of raw NumPy-like arrays, which allows for a more intuitive, more concise, and less error-prone developer experience.

matplotlib

Matplotlib is a Python 2D plotting library which produces high quality figures.

cartopy

Cartopy is a library for plotting maps and geospatial data analyses in Python.

geopandas

Geopandas is a library that allows spatial operation on geometric data.

# Modules system
# import warnings
# warnings.filterwarnings('ignore')
import os

# Modules related to data retrieving
import earthkit as ek
import cdsapi
# import json

# Modules related to plot and EO data manipulation
import numpy as np
# import xarray as xr
# import matplotlib
import math
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
# from matplotlib.colors import LogNorm
# import cartopy
import cartopy.crs as ccrs
# import cartopy.feature as cfeature
import pandas as pd
# import geopandas as gpd
# from shapely.geometry import box, Polygon, MultiPolygon
# from fiona.crs import from_epsg

# import rasterio
# from rasterio.mask import mask

Specify data directory#

Below we define a directory to store the files locally, and create this directory if it does not already exist.

# Directory to store data
# Please ensure that data_dir is a location where you have write permissions
DATADIR = './data_dir/'
# Create this directory if it doesn't exist
os.makedirs(DATADIR, exist_ok=True)

Explore data#

The data used in the examples are the satellite-based Fire Burned Area products that provide global information of total burned area (BA) at pixel and grid scale.

For documentation and other information on Fire Burned Area available through the CDS, please visit the CDS Fire Burned Area page.

Note

During July 2020, an error in some files in the version v5.1cds were identified, affecting the files of the grid product of January 2018, and the pixel and grid products of October, November and December 2019. These errors were fixed, and a new version, v5.1.1cds, was created for the whole time series, to replace version v5.1cds. The latter product has been deprecated, but it is temporally kept in the database for transparency and traceability reasons. Only version v5.1.1cds should be used.


The C3S Fire BA data collection comprises datasets of global burned area developed and tailored for use by climate, vegetation and atmospheric modellers, as well as by fire researchers or fire managers interested in historical burned patterns. The collection is comprised of two Burned Area dataset products at different spatial resolutions, the Pixel product, at the original resolution of the sensor (MODIS or OLCI), and the Grid product, at 0.25-degree resolution.

Both products are provided in NetCDF format, and while the Grid product is comprised of one global file, the Pixel product is divided into six continental subsets. All data are provided in monthly files. The main variable in the Pixel product is the day of detection of the fire, with two additional attributes corresponding to the confidence level and the land cover burned. In the case of the Grid product, the main variable is the sum of surface burned area in each grid cell, with ancillary attributes corresponding to the standard error, the fraction of burnable area, the fraction of observed area, and the total BA for each land cover types.

Table 1: Data description

DATA

DESCRIPTION

Data type

Gridded

Projection

Plate Carrée

Horizontal coverage

Grid product: Global
Pixel product: Continents

Horizontal resolution

Grid product: 0.25° latitude x 0.25° longitude
Pixel product: 250m (v5.1.1cds); 300m (v1.1)

Vertical coverage

Surface

Vertical resolution

Single level

Temporal coverage

From 2001 to 2019 for v5.1.1cds
From 2017 to present for v1.1

Temporal resolution

Grid product: 1 month (v5.1.1cds and v1.1)
Pixel product: Daily detections in a Monthly file

File format

NetCDF4

Conventions

Climate and Forecast (CF) Metadata Convention v1.6 and ESA CCI Data Standards [DSWG 2015]

Versions

Versions v5.1.1cds provide data from the European Space Agency Climate Change Initiative
Version 1.1 is the first burned area product developed especifically for the Copernicus Climate Change Service.
Versions v5.0cds, v5.1cds and v1.0 have been deprecated, and replaced by versions v5.1.1cds and v1.1, respectively.
Versions v5.0cde, v5.1cds and v1.0 are kept for traceability, transparency and reproducibility.
All versions are produced with the same processing chain.

Update frequency

Yearly

Table 2: Main variables

MAIN VARIABLES

Name

Units

Description

Burned area (Grid product)

Total burned area within each pixel in the monthly period.

Burned area in vegetation class (Grid product)

Sum of burned area by land cover classes; land cover classes are from CCI Land Cover (for version 5.1.1cds) or C3S Land Cover (for version v1.1).

Confidence level (Pixel product)

%

Probability of detecting a pixel as burned. Possible values: 0 when the pixel is not observed in the month, or it is not burnable; 1 to 100 probability values when the pixel was observed. The closer to 100, the higher the confidence that the pixel is actually burned.

Flag of pixel detection (Pixel product)

Dimensionless

Day in which the fire was first detected. Possible values: 0 if the pixel is not burned; 1 to 366 day of the first detection when the pixel is burned; -1 when the pixel is not observed in the month; -2 when pixel is not burnable: water bodies, bare areas, urban areas and permanent snow and ice.

Fraction of burnable area (Grid product)

Dimensionless

The fraction of burnable area is the fraction of the cell that corresponds to vegetated land covers that could burn. The land cover classes are those from CCI Land Cover for version 5.0cds or C3S Land Cover for the rest of the versions.

Fraction of observed area (Grid product)

Dimensionless

The fraction of the total burnable area in the cell that was observed during the time interval and was not marked as unsuitable/not observable. The latter refers to the area where it was not possible to obtain observational burned area information for the whole time interval because of lack of input data (non-existing images for that location and period), cloud cover, haze or pixels that fell below the quality thresholds of the algorithm.

Land cover of burned pixels (Pixel product)

Dimensionless

Land cover of the burned pixel, extracted from the CCI LandCover v1.6.1 for version 5.0cds or C3S Land Cover for the rest of the versions. Possible values: 0 when the pixel is not burned in the month, either because it was observed and not classified as burned, or because it is non burnable or was not observed; 10 to 180: land cover code when the pixel is burned

Standard error (Grid product)

Error on the estimation of burned area in each grid cell, based on the aggregation of the confidence level of the pixel product.

Download the data#

There are different ways to download data in the Climate Data Store. You can do it manually from the Download tab, or you can download the data using the CDS-API as we do in this notebook. To write a new request, the easiest way is to select your data parameters on the Download tab, then click on “Show API request”, and copy/paste it in a file (or directly in a notebook code block).

Warning Please remember to accept the terms and conditions of the dataset, at the bottom of the CDS download form.

First we will connect our cdsapi client.
c = cdsapi.Client(url=cdsapi_url, key=cdsapi_key)

Fire BA grid product April 2022

# Define a download filename:
download_filename_gridded = f"{DATADIR}/ba_grid_04_2022.zip"

# Downloading ba-pixel product over Europe
dataset = "satellite-fire-burned-area"
request = {
    "origin": "c3s",
    "sensor": "olci",
    "variable": "grid_variables",
    "version": "1_1",
    "year": ["2022"],
    "month": ["04"],
    "nominal_day": ["01"]
}

if not os.path.exists(download_filename_gridded):
    c.retrieve(dataset, request, download_filename_gridded)
else:
    print(f"File {download_filename_gridded} already exists. Skipping download.")

ba_grid_data = ek.data.from_source("file", download_filename_gridded)
ba_grid_data
File ./data_dir//ba_grid_04_2022.zip already exists. Skipping download.
                                             
NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-5a47b5ac31abc7252b9090b70fde232d9587f67fa289c51acd599fecb88e676d.d\20220401-C3S-L4_FIRE-BA-OLCI-fv1.1.nc)

Fire BA pixel product April 2022 over Europe

# Define a download filename:
download_filename_pixel = f"{DATADIR}/ba_pixel_04_2022.zip"

# Downloading ba-pixel product over Europe
dataset = "satellite-fire-burned-area"
request = {
    "origin": "c3s",
    "sensor": "olci",
    "variable": "pixel_variables",
    "version": "1_1",
    "region": ["europe"],
    "year": ["2022"],
    "month": ["04"],
    "nominal_day": ["01"]
}

if not os.path.exists(download_filename_pixel):
    c.retrieve(dataset, request, download_filename_pixel)
else:
    print(f"File {download_filename_pixel} already exists. Skipping download.")

ba_pixel_data = ek.data.from_source("file", download_filename_pixel)

ba_pixel_data
File ./data_dir//ba_pixel_04_2022.zip already exists. Skipping download.
                                     
NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-861c160bda5d193309591eda81959db74250116d25c1062960747273662e08d6.d\20220401-C3S-L3S_FIRE-BA-OLCI-AREA_3-fv1.1.nc)

Visualise the C3S & CCI Fire Burned Area dataset#

The C3S & CCI Fire Burned Area products provide global information of total burned area (BA) at pixel and grid scale. For visualization of these products — whether using the pixel or grid product — the following key steps can be applied:

Application main steps:

  • Define the color map

  • Define a subset based on the latitude and longitude values

  • Retrieve the corresponding subset**

  • Show the result on a map using the chosen title

  • Save the subset and the image

The Fire Burned Area gridded product#

Let’s take a first quick look at the dataset! Let’s plot for example April of the year 2022!

cmap = mcolors.ListedColormap([
    ( 49/256.,  57/256., 149/256.),    # <1         # <5
    ( 57/256.,  94/256., 196/256.),    # 1-5        # 5-10
    ( 96/256., 143/256., 204/256.),    # 5-10       # 10-25
    (171/256., 217/256., 233/256.),    # 10-25      # 25-50
    (255/256., 255/256., 191/256.),    # 25-50      # 50-100
    (253/256., 174/256.,  97/256.),    # 50-100     # 100-250
    (215/256.,  48/256.,  39/256.),    # 100-200    # 250-500
    (165/256.,   0/256.,  38/256.),    # 200-300    # 500-750
    (135/256.,   0/256.,   0/256.),    # >300       # >750
])

bounds = [0.5, 5, 50, 100, 250, 500, 1000, 1500, 2500, 5000]
norm = mcolors.BoundaryNorm(bounds, cmap.N) 
data_ba_grid=ba_grid_data.to_xarray()
data_ba_grid_2D=data_ba_grid['burned_area']

# Set plot title
time_0= data_ba_grid_2D['time'].values[0]
time_str = pd.to_datetime(time_0).strftime('%Y/%m')
title = 'Fire Burned Area ' + time_str

# Create the figure
ax = plt.axes(projection=ccrs.PlateCarree())
data_ba_grid_2D[0].plot(cmap=cmap, norm=norm, ax=ax)
ax.coastlines()
ax.set_title(title)

#show figure
plt.show()
../../_images/cbdde1f6eec397b6fb89110a278ff9fbc0ccc63bd130d2ca7507e6a03d27af15.png

Figure 2: Fire Burned Area map of April 2022

Define a subset based on the latitude and longitude values.

# Spatial subset selection 
min_lon = -26
min_lat = 83
max_lon = 53
max_lat =25

data_subset_ba_grid = data_ba_grid.sel(lat=slice(min_lat,max_lat), lon=slice(min_lon,max_lon))
data_subset_ba_grid_2D=data_subset_ba_grid['burned_area']

# Set plot title
time_0= data_subset_ba_grid_2D['time'].values[0]
time_str = pd.to_datetime(time_0).strftime('%Y/%m')
title_subset = 'Fire Burned Area ' + time_str

# Create the figure
ax = plt.axes(projection=ccrs.PlateCarree())
fig=data_subset_ba_grid_2D[0].plot(cmap=cmap, norm=norm)
gl=ax.gridlines(draw_labels=True, linewidth=1, color='gray', alpha=0.5, linestyle='--')
gl.ylabels_right = False
gl.xlabels_top=False
ax.coastlines()
plt.title(title)
plt.show()
../../_images/82dff8fc13cc44ee5e502c5ca8ba937b6e17070a5eb0ec72668aaff9ad6e8e23.png

Figure 3: Fire Burned Area map of April 2022 in Europe

# Show the complete dataset
data_ba_grid
<xarray.Dataset> Size: 91MB
Dimensions:                          (lat: 720, bounds: 2, lon: 1440, time: 1,
                                      vegetation_class: 18)
Coordinates:
  * lat                              (lat) float32 3kB 89.88 89.62 ... -89.88
  * lon                              (lon) float32 6kB -179.9 -179.6 ... 179.9
  * time                             (time) datetime64[ns] 8B 2022-04-01
  * vegetation_class                 (vegetation_class) int32 72B 10 20 ... 180
Dimensions without coordinates: bounds
Data variables:
    lat_bounds                       (lat, bounds) float32 6kB dask.array<chunksize=(720, 2), meta=np.ndarray>
    lon_bounds                       (lon, bounds) float32 12kB dask.array<chunksize=(1440, 2), meta=np.ndarray>
    time_bounds                      (time, bounds) datetime64[ns] 16B dask.array<chunksize=(1, 2), meta=np.ndarray>
    vegetation_class_name            (vegetation_class) |S150 3kB dask.array<chunksize=(18,), meta=np.ndarray>
    burned_area                      (time, lat, lon) float32 4MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    standard_error                   (time, lat, lon) float32 4MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    fraction_of_burnable_area        (time, lat, lon) float32 4MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    fraction_of_observed_area        (time, lat, lon) float32 4MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    burned_area_in_vegetation_class  (time, vegetation_class, lat, lon) float32 75MB dask.array<chunksize=(1, 18, 720, 1440), meta=np.ndarray>
    crs                              int32 4B ...
Attributes: (12/40)
    title:                      ECMWF C3S Gridded OLCI Burned Area product
    institution:                University of Alcala
    source:                     ESA Sentinel-3 A+B OLCI FR, MODIS MCD14ML Col...
    history:                    Created on 2022-11-12 06:36:15
    references:                 See https://climate.copernicus.eu/
    tracking_id:                842603aa-9703-42ea-8db0-b8f553ae5c6f
    ...                         ...
    sensor:                     OLCI
    spatial_resolution:         0.25 degrees
    geospatial_lon_units:       degrees_east
    geospatial_lat_units:       degrees_north
    geospatial_lon_resolution:  0.25
    geospatial_lat_resolution:  0.25
# Show the subset of the dataset regarding the variable
data_ba_grid_2D
<xarray.DataArray 'burned_area' (time: 1, lat: 720, lon: 1440)> Size: 4MB
dask.array<open_dataset-burned_area, shape=(1, 720, 1440), dtype=float32, chunksize=(1, 720, 1440), chunktype=numpy.ndarray>
Coordinates:
  * lat      (lat) float32 3kB 89.88 89.62 89.38 89.12 ... -89.38 -89.62 -89.88
  * lon      (lon) float32 6kB -179.9 -179.6 -179.4 -179.1 ... 179.4 179.6 179.9
  * time     (time) datetime64[ns] 8B 2022-04-01
Attributes:
    units:          m2
    standard_name:  burned_area
    long_name:      total burned_area
    cell_methods:   time: sum
# Show the subset of the dataset regarding the variable and spatial content 
data_subset_ba_grid_2D
<xarray.DataArray 'burned_area' (time: 1, lat: 232, lon: 316)> Size: 293kB
dask.array<getitem, shape=(1, 232, 316), dtype=float32, chunksize=(1, 232, 316), chunktype=numpy.ndarray>
Coordinates:
  * lat      (lat) float32 928B 82.88 82.62 82.38 82.12 ... 25.62 25.38 25.12
  * lon      (lon) float32 1kB -25.88 -25.62 -25.38 -25.12 ... 52.38 52.62 52.88
  * time     (time) datetime64[ns] 8B 2022-04-01
Attributes:
    units:          m2
    standard_name:  burned_area
    long_name:      total burned_area
    cell_methods:   time: sum

Write dataset contents to a netCDF file#

data_subset_ba_grid_2D.to_netcdf(
    path=os.path.join(DATADIR, "ba_042022_europe_grid.nc"),
)

Re-project the data into another projection#

Let’s visualise the April of the year 2022 once again, but in a different projection!

ax = plt.axes(projection=ccrs.Orthographic(30, 10))
ax.set_global()
data_ba_grid_2D[0].plot(ax=ax, transform=ccrs.PlateCarree(),cmap=cmap, norm=norm )
ax.coastlines()
plt.title(title)
plt.show()
../../_images/419a0f19b968c2ed21665f8720130a15bf5f8567849205435664d50064a380f6.png

Figure 4: Fire Burned Area map of April 2022 - orthographic projection

The Fire Burned Area pixel product#

Let’s take a first quick look at the dataset! Let’s plot for example April of the year 2022 over SE-Europe!

cmap = mcolors.ListedColormap([
    ( 49/256.,  57/256., 149/256.),    # <1         # <5
    ( 57/256.,  94/256., 196/256.),    # 1-5        # 5-10
    ( 96/256., 143/256., 204/256.),    # 5-10       # 10-25
    (171/256., 217/256., 233/256.),    # 10-25      # 25-50
    (255/256., 255/256., 191/256.),    # 25-50      # 50-100
    (253/256., 174/256.,  97/256.),    # 50-100     # 100-250
    (215/256.,  48/256.,  39/256.),    # 100-200    # 250-500
    (165/256.,   0/256.,  38/256.),    # 200-300    # 500-750
    (135/256.,   0/256.,   0/256.),    # >300       # >750
])

bounds = [-2, -1, 0, 1, 25, 50, 100, 200, 300, 365]
norm = mcolors.BoundaryNorm(bounds, cmap.N) 
# Spatial subset selection 
min_lon = 10
min_lat = 48
max_lon = 20
max_lat = 42

data_ba_pixel=ba_pixel_data.to_xarray()
#data_ba_pixel=ba_pixel_data.to_xarray(xarray_open_mfdataset_kwargs=dict(decode_cf=False, decode_times=False)
data_subset_ba_pixel = data_ba_pixel.sel(
    lat=slice(min_lat,max_lat), lon=slice(min_lon,max_lon)
)

str_first_day_of_obs_year= str(data_subset_ba_pixel.coords['time'].values[0]).split('-')[-3] + '-01-01T00:00:00.000'
data_subset_ba_pixel_2D = (data_subset_ba_pixel['JD']-np.datetime64(str_first_day_of_obs_year)).dt.days

# Set plot title
time_0= data_subset_ba_pixel_2D['time'].values[0]
time_str = pd.to_datetime(time_0).strftime('%Y/%m')
title_subset = 'Fire Burned Area ' + time_str

# Create the figure
ax = plt.axes(projection=ccrs.PlateCarree())
gl = ax.gridlines(
    draw_labels=True, linewidth=1, color='gray', alpha=0.5, linestyle='--'
)
gl.right_labels = False
gl.top_labels = False
data_subset_ba_pixel_2D[0].plot(cmap=cmap, norm=norm, ax=ax)

ax.coastlines()
ax.set_title(title)

# Show figure
plt.show()
../../_images/3fa6c692ee11e95fcb2186515fbb54a1630039365b0928a6a404f514d396375a.png

Figure 5: Map of the day of first detection from the Pixel Burned Area product of April 2022 over SE-Europe (fire, e.g. in grid - 44-45°N and 15-16.5!°E)

# Show the complete dataset
data_ba_pixel
<xarray.Dataset> Size: 6GB
Dimensions:      (time: 1, lat: 20880, lon: 28440, bounds: 2)
Coordinates:
  * lon          (lon) float64 228kB -26.0 -26.0 -25.99 ... 52.99 53.0 53.0
  * lat          (lat) float64 167kB 83.0 83.0 82.99 82.99 ... 25.01 25.0 25.0
  * time         (time) datetime64[ns] 8B 2022-04-01
Dimensions without coordinates: bounds
Data variables:
    JD           (time, lat, lon) datetime64[ns] 5GB dask.array<chunksize=(1, 1200, 1200), meta=np.ndarray>
    CL           (time, lat, lon) int8 594MB dask.array<chunksize=(1, 1200, 1200), meta=np.ndarray>
    LC           (time, lat, lon) uint8 594MB dask.array<chunksize=(1, 1200, 1200), meta=np.ndarray>
    lon_bounds   (lon, bounds) float64 455kB dask.array<chunksize=(16384, 2), meta=np.ndarray>
    lat_bounds   (lat, bounds) float64 334kB dask.array<chunksize=(16384, 2), meta=np.ndarray>
    time_bounds  (time, bounds) datetime64[ns] 16B dask.array<chunksize=(1, 2), meta=np.ndarray>
    crs          int32 4B ...
Attributes: (12/38)
    title:                      ECMWF C3S Pixel OLCI Burned Area product
    institution:                University of Alcala
    source:                     Sentinel-3 A+B OLCI FR, MODIS MCD14ML Collect...
    history:                    Created on 2022-11-12 06:35:08
    references:                 https://climate.copernicus.eu/
    tracking_id:                cfc08ed4-b87d-4e95-bb14-960378a53ccb
    ...                         ...
    geospatial_lon_units:       degrees_east
    geospatial_lat_units:       degrees_north
    geospatial_lon_resolution:  0.00277778
    geospatial_lat_resolution:  0.00277778
    product_version:            v1.1
    id:                         20220401-C3S-L3S_FIRE-BA-OLCI-AREA_3-fv1.1.nc
# Show the subset of the dataset regarding the variable and spatial content
data_subset_ba_pixel_2D
<xarray.DataArray 'days' (time: 1, lat: 2160, lon: 3600)> Size: 62MB
dask.array<_access_through_series, shape=(1, 2160, 3600), dtype=int64, chunksize=(1, 1200, 1200), chunktype=numpy.ndarray>
Coordinates:
  * lon      (lon) float64 29kB 10.0 10.0 10.01 10.01 ... 19.99 19.99 20.0 20.0
  * lat      (lat) float64 17kB 48.0 48.0 47.99 47.99 ... 42.01 42.01 42.0 42.0
  * time     (time) datetime64[ns] 8B 2022-04-01

Write dataset contents to a netCDF file

data_subset_ba_pixel_2D.to_netcdf(
    os.path.join(DATADIR, "ba_042022_SE-Europe_pixel.nc")
)

Re-project the data into another projection#

Let’s visualise the April of the year 2022 once again, but in a different projection!

ax = plt.axes(projection=ccrs.Orthographic(15, 45))
ax.set_global()
data_subset_ba_pixel_2D[0].plot(ax=ax, transform=ccrs.PlateCarree(),cmap=cmap, norm=norm )
ax.coastlines()
plt.title(title)
plt.show()
../../_images/ec0514ea34e74c0429696ae42f4206607508e04b9107fb7ae9fd5caf281e5497.png

Figure 6: Map of the day of first detection from the Pixel Burned Area product of April 2022 over SE-Europe - orthographic projection

Use case I - Explore C3S & CCI Fire Burned Area dataset over time#

Application main steps:

  • Define the time period and download the data

  • Define a point based on the latitude and longitude values

  • Retrieve the corresponding subset

  • Show the time series and save the image

# Define a download filename:
download_filename_gridded_ts = f"{DATADIR}/ba_grid_2020-2021.zip"

# Downloading ba-pixel product over Europe
dataset = "satellite-fire-burned-area"
request = {
    "origin": "c3s",
    "sensor": "olci",
    "variable": "grid_variables",
    "version": "1_1",
    "year": ["2020", "2021"],
    "month": [
        "02", "04", "06",
        "09", "12"
    ],
    "nominal_day": ["01"]
}

if not os.path.exists(download_filename_gridded_ts):
    c.retrieve(dataset, request, download_filename_gridded_ts)
else:
    print(f"File {download_filename_gridded_ts} already exists. Skipping download.")

ba_grid_data_multiple_years = ek.data.from_source("file", download_filename_gridded_ts)
ba_grid_data_multiple_years
File ./data_dir//ba_grid_2020-2021.zip already exists. Skipping download.
                                               
NetCDFMultiFieldList(NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-da6708872eb3510c8e9f3be35ffbf845eab752f936cb4a8473471d0c99440bf7.d\20200201-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-da6708872eb3510c8e9f3be35ffbf845eab752f936cb4a8473471d0c99440bf7.d\20200401-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-da6708872eb3510c8e9f3be35ffbf845eab752f936cb4a8473471d0c99440bf7.d\20200601-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-da6708872eb3510c8e9f3be35ffbf845eab752f936cb4a8473471d0c99440bf7.d\20200901-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-da6708872eb3510c8e9f3be35ffbf845eab752f936cb4a8473471d0c99440bf7.d\20201201-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-da6708872eb3510c8e9f3be35ffbf845eab752f936cb4a8473471d0c99440bf7.d\20210201-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-da6708872eb3510c8e9f3be35ffbf845eab752f936cb4a8473471d0c99440bf7.d\20210401-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-da6708872eb3510c8e9f3be35ffbf845eab752f936cb4a8473471d0c99440bf7.d\20210601-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-da6708872eb3510c8e9f3be35ffbf845eab752f936cb4a8473471d0c99440bf7.d\20210901-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-da6708872eb3510c8e9f3be35ffbf845eab752f936cb4a8473471d0c99440bf7.d\20211201-C3S-L4_FIRE-BA-OLCI-fv1.1.nc))
# Show the dataset
data_grid=ba_grid_data_multiple_years.to_xarray()
data_grid
<xarray.Dataset> Size: 913MB
Dimensions:                          (time: 10, lat: 720, bounds: 2, lon: 1440,
                                      vegetation_class: 18)
Coordinates:
  * lat                              (lat) float32 3kB 89.88 89.62 ... -89.88
  * lon                              (lon) float32 6kB -179.9 -179.6 ... 179.9
  * time                             (time) datetime64[ns] 80B 2020-02-01 ......
  * vegetation_class                 (vegetation_class) int32 72B 10 20 ... 180
Dimensions without coordinates: bounds
Data variables:
    lat_bounds                       (time, lat, bounds) float32 58kB dask.array<chunksize=(1, 720, 2), meta=np.ndarray>
    lon_bounds                       (time, lon, bounds) float32 115kB dask.array<chunksize=(1, 1440, 2), meta=np.ndarray>
    time_bounds                      (time, bounds) datetime64[ns] 160B dask.array<chunksize=(1, 2), meta=np.ndarray>
    vegetation_class_name            (time, vegetation_class) |S150 27kB dask.array<chunksize=(1, 18), meta=np.ndarray>
    burned_area                      (time, lat, lon) float32 41MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    standard_error                   (time, lat, lon) float32 41MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    fraction_of_burnable_area        (time, lat, lon) float32 41MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    fraction_of_observed_area        (time, lat, lon) float32 41MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    burned_area_in_vegetation_class  (time, vegetation_class, lat, lon) float32 746MB dask.array<chunksize=(1, 18, 720, 1440), meta=np.ndarray>
    crs                              (time) int32 40B -2147483647 ... -214748...
Attributes: (12/40)
    title:                      ECMWF C3S Gridded OLCI Burned Area product
    institution:                University of Alcala
    source:                     ESA Sentinel-3 A+B OLCI FR, MODIS MCD14ML Col...
    history:                    Created on 2021-05-13 16:42:16
    references:                 See https://climate.copernicus.eu/
    tracking_id:                6848e827-7c22-4c97-a346-ad8666f5332b
    ...                         ...
    sensor:                     OLCI
    spatial_resolution:         0.25 degrees
    geospatial_lon_units:       degrees_east
    geospatial_lat_units:       degrees_north
    geospatial_lon_resolution:  0.25
    geospatial_lat_resolution:  0.25
# Point selection 
lon = 20.0
lat = -10.0

data_grid_subset = data_grid.sel(lat=lat, lon=lon, method='nearest')
data_ba_grid_timeseries=data_grid_subset['burned_area']
title = 'Fire Burned Area'
data_ba_grid_timeseries.coords['time'].values
# Create the figure
fig, ax = plt.subplots()
ax.plot(data_ba_grid_timeseries.coords['time'].values, data_ba_grid_timeseries,  marker="D", linestyle='None', color ='red')
ax.set_xlim(np.datetime64('2020-01-01'), np.datetime64('2022-01-01'))
#ax.set_ylim(0, 255)
ax.set_title(title + ' - Point lat:' + str(lat) + ' lon:' + str(lon))
ax.set_ylabel("area [m²]")

# Show figure
plt.show()
../../_images/aee437fe78b66515679324dfc473c40f7dfeb1908681a3c749f517a43ac2debd.png

Figure 7: Fire burned area [km²] on a selected location in Angola for February, April,June, September and December of 2020 and 2021

Use case II - Create a map of total area burned#

Application main steps:

  • Retrieve burned area data over a defined time range and area, defined by longitude and latitude coordinates

  • Calculate the total area burned

  • Show the result as a map of the total area burned

# Define a download filename:
download_filename_gridded_2020 = f"{DATADIR}/ba_grid_2020.zip"

# Downloading ba-pixel product over Europe
dataset = "satellite-fire-burned-area"
request =     {
    "origin": "c3s",
    "sensor": "olci",
    "variable": "grid_variables",
    "version": "1_1",
    "year": ["2020"],
    "month": [
        "01", "02", "03",
        "04", "05", "06",
        "07", "08", "09",
        "10", "11", "12"
    ],
    "nominal_day": ["01"]
}


if not os.path.exists(download_filename_gridded_2020):
    c.retrieve(dataset, request, download_filename_gridded_2020)
else:
    print(f"File {download_filename_gridded_2020} already exists. Skipping download.")

ba_grid_data_2020 = ek.data.from_source("file", download_filename_gridded_2020)
ba_grid_data_2020
File ./data_dir//ba_grid_2020.zip already exists. Skipping download.
                                               
NetCDFMultiFieldList(NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-c8d5c90fbadf01fa83b9bbd5c61073ffe43fc7e4d5b69b5d22db0e95901c46bb.d\20200101-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-c8d5c90fbadf01fa83b9bbd5c61073ffe43fc7e4d5b69b5d22db0e95901c46bb.d\20200201-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-c8d5c90fbadf01fa83b9bbd5c61073ffe43fc7e4d5b69b5d22db0e95901c46bb.d\20200301-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-c8d5c90fbadf01fa83b9bbd5c61073ffe43fc7e4d5b69b5d22db0e95901c46bb.d\20200401-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-c8d5c90fbadf01fa83b9bbd5c61073ffe43fc7e4d5b69b5d22db0e95901c46bb.d\20200501-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-c8d5c90fbadf01fa83b9bbd5c61073ffe43fc7e4d5b69b5d22db0e95901c46bb.d\20200601-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-c8d5c90fbadf01fa83b9bbd5c61073ffe43fc7e4d5b69b5d22db0e95901c46bb.d\20200701-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-c8d5c90fbadf01fa83b9bbd5c61073ffe43fc7e4d5b69b5d22db0e95901c46bb.d\20200801-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-c8d5c90fbadf01fa83b9bbd5c61073ffe43fc7e4d5b69b5d22db0e95901c46bb.d\20200901-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-c8d5c90fbadf01fa83b9bbd5c61073ffe43fc7e4d5b69b5d22db0e95901c46bb.d\20201001-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-c8d5c90fbadf01fa83b9bbd5c61073ffe43fc7e4d5b69b5d22db0e95901c46bb.d\20201101-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-c8d5c90fbadf01fa83b9bbd5c61073ffe43fc7e4d5b69b5d22db0e95901c46bb.d\20201201-C3S-L4_FIRE-BA-OLCI-fv1.1.nc))
# Show the dataset
data_grid_2020=ba_grid_data_2020.to_xarray()
data_grid_2020
<xarray.Dataset> Size: 1GB
Dimensions:                          (time: 12, lat: 720, bounds: 2, lon: 1440,
                                      vegetation_class: 18)
Coordinates:
  * lat                              (lat) float32 3kB 89.88 89.62 ... -89.88
  * lon                              (lon) float32 6kB -179.9 -179.6 ... 179.9
  * time                             (time) datetime64[ns] 96B 2020-01-01 ......
  * vegetation_class                 (vegetation_class) int32 72B 10 20 ... 180
Dimensions without coordinates: bounds
Data variables:
    lat_bounds                       (time, lat, bounds) float32 69kB dask.array<chunksize=(1, 720, 2), meta=np.ndarray>
    lon_bounds                       (time, lon, bounds) float32 138kB dask.array<chunksize=(1, 1440, 2), meta=np.ndarray>
    time_bounds                      (time, bounds) datetime64[ns] 192B dask.array<chunksize=(1, 2), meta=np.ndarray>
    vegetation_class_name            (time, vegetation_class) |S150 32kB dask.array<chunksize=(1, 18), meta=np.ndarray>
    burned_area                      (time, lat, lon) float32 50MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    standard_error                   (time, lat, lon) float32 50MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    fraction_of_burnable_area        (time, lat, lon) float32 50MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    fraction_of_observed_area        (time, lat, lon) float32 50MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    burned_area_in_vegetation_class  (time, vegetation_class, lat, lon) float32 896MB dask.array<chunksize=(1, 18, 720, 1440), meta=np.ndarray>
    crs                              (time) int32 48B -2147483647 ... -214748...
Attributes: (12/40)
    title:                      ECMWF C3S Gridded OLCI Burned Area product
    institution:                University of Alcala
    source:                     ESA Sentinel-3 A+B OLCI FR, MODIS MCD14ML Col...
    history:                    Created on 2021-05-13 16:12:01
    references:                 See https://climate.copernicus.eu/
    tracking_id:                1d0af64d-662e-4874-b0a0-c08da1602edc
    ...                         ...
    sensor:                     OLCI
    spatial_resolution:         0.25 degrees
    geospatial_lon_units:       degrees_east
    geospatial_lat_units:       degrees_north
    geospatial_lon_resolution:  0.25
    geospatial_lat_resolution:  0.25
# Definition of the color map 

cmap = mcolors.ListedColormap([
    ( 49/256.,  57/256., 149/256.),    # <1         # <5
    ( 57/256.,  94/256., 196/256.),    # 1-5        # 5-10
    ( 96/256., 143/256., 204/256.),    # 5-10       # 10-25
    (171/256., 217/256., 233/256.),    # 10-25      # 25-50
    (255/256., 255/256., 191/256.),    # 25-50      # 50-100
    (253/256., 174/256.,  97/256.),    # 50-100     # 100-250
    (215/256.,  48/256.,  39/256.),    # 100-200    # 250-500
    (165/256.,   0/256.,  38/256.),    # 200-300    # 500-750
    (135/256.,   0/256.,   0/256.),    # >300       # >750
])

bounds = [0.5, 5, 50, 100, 250, 500, 1000, 1500, 2500, 5000]
norm = mcolors.BoundaryNorm(bounds, cmap.N) 
# Spatial subset selection 
min_lon = -20
min_lat = 40
max_lon = 50
max_lat = -40

data_grid_2020_subset = data_grid_2020.sel(lat=slice(min_lat,max_lat), lon=slice(min_lon,max_lon))    
data_grid_2020_subset_2D=data_grid_2020_subset['burned_area']

# Calculate the total burned area per pixel over the time period
data_grid_2020_subset_2D_sum=data_grid_2020_subset_2D.sum(dim='time', skipna=True)/1000000.

# Calculate the total burned area per pixel over the time period and region
sum_all=math.floor(data_grid_2020_subset_2D_sum.sum(dim=["lat", "lon"], skipna=True)*100.)/100.

# Set plot title		
title = 'Map of total area burned per grid cell - 2020 - total area burned[km²]=' + str(sum_all)

# Create the figure
ax = plt.axes(projection=ccrs.PlateCarree())
fig=data_grid_2020_subset_2D_sum.plot(cmap=cmap, norm=norm)
gl=ax.gridlines(draw_labels=True, linewidth=1, color='gray', alpha=0.5, linestyle='--')
gl.ylabels_right = False
gl.xlabels_top=False
ax.coastlines()
plt.title(title)
# Show figure
plt.show()
../../_images/e4b741dc78494205cf1e815342f48d09ef5985c776e32452b756b50326813d6f.png

Figure 8: Map of the total area burned of 2020

The C3S and CCI Fire Burned Area products indicate a burned area of around 2,521,029 square kilometres in Africa in 2020.

Use case III - Create a map of burned area anomaly#

Application main steps:

  • Retrieve burned area data of a reference year(s) and over area, defined by longitude and latitude coordinates & calculate mean and standard deviation

  • Retrieve burned area data of selected date and over area, defined by longitude and latitude coordinates

  • Calculate the anomaly of the burned area regarding the reference year(s)

  • Show the result as a map of the anomaly

# Definition of the color map 

cmap = mcolors.ListedColormap([
    ( 49/256.,  57/256., 149/256.),    # <1         # <5
    ( 57/256.,  94/256., 196/256.),    # 1-5        # 5-10
    ( 96/256., 143/256., 204/256.),    # 5-10       # 10-25
    (171/256., 217/256., 233/256.),    # 10-25      # 25-50
    (255/256., 255/256., 191/256.),    # 25-50      # 50-100
    (253/256., 174/256.,  97/256.),    # 50-100     # 100-250
    (215/256.,  48/256.,  39/256.),    # 100-200    # 250-500
    (165/256.,   0/256.,  38/256.),    # 200-300    # 500-750
    (135/256.,   0/256.,   0/256.),    # >300       # >750
])

bounds = [0.5, 5, 50, 100, 250, 500, 1000, 1500, 2500, 5000]
norm = mcolors.BoundaryNorm(bounds, cmap.N) 
# Spatial subset selection 
min_lon = -20
min_lat = 40
max_lon = 50
max_lat = -40

data_grid_2020_subset = data_grid_2020.sel(lat=slice(min_lat,max_lat), lon=slice(min_lon,max_lon))    
data_grid_2020_subset_2D=data_grid_2020_subset['burned_area']/1000000.

# Calculate the mean and standard deviation of the burned area per pixel over the time period
data_grid_2020_subset_2D_mean=data_grid_2020_subset_2D.mean(dim='time', skipna=True)
data_grid_2020_subset_2D_std=data_grid_2020_subset_2D.std(dim='time', skipna=True)

# Calculate the anomaly 
anomaly_data = (data_grid_2020_subset_2D-data_grid_2020_subset_2D_mean)/data_grid_2020_subset_2D_std

# Set plot title		
title = 'Map of burned area anomaly per grid cell - July 2020 (reference year 2020)' 

# Create the figure
ax = plt.axes(projection=ccrs.PlateCarree())

fig=anomaly_data[6].plot()
gl=ax.gridlines(draw_labels=True, linewidth=1, color='gray', alpha=0.5, linestyle='--')
gl.ylabels_right = False
gl.xlabels_top  =False
ax.coastlines()
plt.title(title)
# Show figure
plt.show()
../../_images/410b88b2313483ecf4cedbbd7b0dff66171ea4c80f51c9490ba0daade78ffa10.png
# Define a download filename:
download_filename_gridded_07_2017_2022 = f"{DATADIR}/ba_grid_07-2017-2022.zip"

# Downloading ba-pixel product over Europe
dataset = "satellite-fire-burned-area"
request = {
    "origin": "c3s",
    "sensor": "olci",
    "variable": "grid_variables",
    "version": "1_1",
    "year": [
        "2017", "2018", "2019",
        "2020", "2021", "2022"
    ],
    "month": ["07"],
    "nominal_day": ["01"]
}


if not os.path.exists(download_filename_gridded_07_2017_2022):
    c.retrieve(dataset, request, download_filename_gridded_07_2017_2022)
else:
    print(f"File {download_filename_gridded_07_2017_2022} already exists. Skipping download.")

ba_grid_data_07_2017_2022 = ek.data.from_source("file", download_filename_gridded_07_2017_2022)
ba_grid_data_07_2017_2022
File ./data_dir//ba_grid_07-2017-2022.zip already exists. Skipping download.
                                             
NetCDFMultiFieldList(NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-bc69e257d891782abbbbd5f145c3a9b0bbedb1a8657b2c81b3f7dc25109cb9d9.d\20170701-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-bc69e257d891782abbbbd5f145c3a9b0bbedb1a8657b2c81b3f7dc25109cb9d9.d\20180701-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-bc69e257d891782abbbbd5f145c3a9b0bbedb1a8657b2c81b3f7dc25109cb9d9.d\20190701-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-bc69e257d891782abbbbd5f145c3a9b0bbedb1a8657b2c81b3f7dc25109cb9d9.d\20200701-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-bc69e257d891782abbbbd5f145c3a9b0bbedb1a8657b2c81b3f7dc25109cb9d9.d\20210701-C3S-L4_FIRE-BA-OLCI-fv1.1.nc),NetCDFFieldListReader(C:\Users\Grit\AppData\Local\Temp\tmp50p7wcvf\file-bc69e257d891782abbbbd5f145c3a9b0bbedb1a8657b2c81b3f7dc25109cb9d9.d\20220701-C3S-L4_FIRE-BA-OLCI-fv1.1.nc))
# Show the dataset
data_grid_07_2017_2022=ba_grid_data_07_2017_2022.to_xarray()
data_grid_07_2017_2022
<xarray.Dataset> Size: 548MB
Dimensions:                          (time: 6, lat: 720, bounds: 2, lon: 1440,
                                      vegetation_class: 18)
Coordinates:
  * lat                              (lat) float32 3kB 89.88 89.62 ... -89.88
  * lon                              (lon) float32 6kB -179.9 -179.6 ... 179.9
  * time                             (time) datetime64[ns] 48B 2017-07-01 ......
  * vegetation_class                 (vegetation_class) int32 72B 10 20 ... 180
Dimensions without coordinates: bounds
Data variables:
    lat_bounds                       (time, lat, bounds) float32 35kB dask.array<chunksize=(1, 720, 2), meta=np.ndarray>
    lon_bounds                       (time, lon, bounds) float32 69kB dask.array<chunksize=(1, 1440, 2), meta=np.ndarray>
    time_bounds                      (time, bounds) datetime64[ns] 96B dask.array<chunksize=(1, 2), meta=np.ndarray>
    vegetation_class_name            (time, vegetation_class) |S150 16kB dask.array<chunksize=(1, 18), meta=np.ndarray>
    burned_area                      (time, lat, lon) float32 25MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    standard_error                   (time, lat, lon) float32 25MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    fraction_of_burnable_area        (time, lat, lon) float32 25MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    fraction_of_observed_area        (time, lat, lon) float32 25MB dask.array<chunksize=(1, 720, 1440), meta=np.ndarray>
    burned_area_in_vegetation_class  (time, vegetation_class, lat, lon) float32 448MB dask.array<chunksize=(1, 18, 720, 1440), meta=np.ndarray>
    crs                              (time) int32 24B -2147483647 ... -214748...
Attributes: (12/40)
    title:                      ECMWF C3S Gridded OLCI Burned Area product
    institution:                University of Alcala
    source:                     ESA Sentinel-3 A+B OLCI FR, MODIS MCD14ML Col...
    history:                    Created on 2020-02-20 10:09:51
    references:                 See https://climate.copernicus.eu/
    tracking_id:                43565b8a-8cfc-4265-833f-979b6b6e9026
    ...                         ...
    sensor:                     OLCI
    spatial_resolution:         0.25 degrees
    geospatial_lon_units:       degrees_east
    geospatial_lat_units:       degrees_north
    geospatial_lon_resolution:  0.25
    geospatial_lat_resolution:  0.25
# Spatial subset selection 
min_lon = -20
min_lat = 40
max_lon = 50
max_lat = -40

data_grid_07_2017_2022_subset = data_grid_07_2017_2022.sel(lat=slice(min_lat,max_lat), lon=slice(min_lon,max_lon)) 
data_grid_07_2017_2022_subset_2D=data_grid_07_2017_2022_subset['burned_area']/1000000.

# Calculate the mean and standard deviation of the burned area per pixel over the time period
data_grid_07_2017_2022_subset_2D_mean=data_grid_07_2017_2022_subset_2D.mean(dim='time', skipna=True)
data_grid_07_2017_2022_subset_2D_std=data_grid_07_2017_2022_subset_2D.std(dim='time', skipna=True)

# Calculate the anomaly 
anomaly_data_timeseries = (data_grid_2020_subset_2D-data_grid_07_2017_2022_subset_2D_mean)/data_grid_07_2017_2022_subset_2D_std
anomaly_data_timeseries
<xarray.DataArray 'burned_area' (time: 12, lat: 320, lon: 280)> Size: 4MB
dask.array<truediv, shape=(12, 320, 280), dtype=float32, chunksize=(1, 320, 280), chunktype=numpy.ndarray>
Coordinates:
  * lat      (lat) float32 1kB 39.88 39.62 39.38 39.12 ... -39.38 -39.62 -39.88
  * lon      (lon) float32 1kB -19.88 -19.62 -19.38 -19.12 ... 49.38 49.62 49.88
  * time     (time) datetime64[ns] 96B 2020-01-01 2020-02-01 ... 2020-12-01
# Set plot title		
title_anomaly = 'Map of burned area anomaly per grid cell - July 2020 (reference July 2017 - 2022)' 

# Create the second figure
ax = plt.axes(projection=ccrs.PlateCarree())

fig=anomaly_data_timeseries[6].plot()
gl=ax.gridlines(draw_labels=True, linewidth=1, color='gray', alpha=0.5, linestyle='--')
gl.ylabels_right = False
gl.xlabels_top = False
ax.coastlines()
plt.title(title_anomaly)
# Show figure
plt.show()
../../_images/3ab9dde01d9271e5b45e900b9ca3e188da84663e51515a2ba9cdb015338256cc.png

Figure 10: Map of burned area anomaly per grid cell for July 2020 (reference July 2017 - 2022)

The anomaly map for July shows that more burned area was observed in the south in July 2020 compared to the mean value for 2020 as expected. Additionally, the anomaly map comparing July 2020 to the mean July values from 2017 to 2022 reveals variations in both directions, indicating some areas with more and others with less burned area than the multi-year July average.

Take home messages 📌#

This tutorial demonstrated how C3S & CCI Fire Burned Area products available through the C3S can be downloaded and visualised, as well as sub-setted and saved. In addition, two other aspects - map of total burned area and map of burned area anomaly - were also generated from the data, using code that is transferable and highly applicable to this Fire Burned area, as well as other domains.