Global Fire Emissions Database (GFED)¶
This shows how to load the GFED dataset into emiproc.
First we need to download the files from the GFED website.
For this purpose we can use the emiproc function.
[ ]:
from pathlib import Path
from emiproc.inventories.gfed import download_gfedv51
local_dir = Path("./gfed5")
local_dir.mkdir(exist_ok=True)
year = 2020
[ ]:
download_gfedv51(local_dir, year)
Downloaded gfed5 files for year=2020.
Look at the files¶
Below we open the first file, which is the file for january.
It contains gridded emissions for every day of the mounth and for every grid cell in the domain.
[3]:
import xarray as xr
ds = xr.open_dataset(local_dir / f"GFED5.1_daily_{year}-01.nc")
ds
[3]:
<xarray.Dataset> Size: 5GB
Dimensions: (time: 31, lat: 720, lon: 1440)
Coordinates:
* time (time) datetime64[ns] 248B 2020-01-01T01:00:00 ... 2020-0...
* lat (lat) float32 3kB -89.88 -89.62 -89.38 ... 89.38 89.62 89.88
* lon (lon) float32 6kB -179.9 -179.6 -179.4 ... 179.4 179.6 179.9
Data variables: (12/40)
DM (time, lat, lon) float32 129MB ...
C (time, lat, lon) float32 129MB ...
CO2 (time, lat, lon) float32 129MB ...
CO (time, lat, lon) float32 129MB ...
CH4 (time, lat, lon) float32 129MB ...
NMOC_g (time, lat, lon) float32 129MB ...
... ...
HCN (time, lat, lon) float32 129MB ...
HCOOH (time, lat, lon) float32 129MB ...
CH3COOH (time, lat, lon) float32 129MB ...
MEK (time, lat, lon) float32 129MB ...
CH3COCHO (time, lat, lon) float32 129MB ...
HOCH2CHO (time, lat, lon) float32 129MB ...
Attributes:
title: GFED5.1 daily 2020-01
subtitle: Global Fire Emissions Database (GFED) extension ver...
creation_date: 2025-08-30 22:54:45 UTC
license: Data in this file is licensed under a Creative Comm...
region: Global
spatial_resolution: 0.25x0.25 degree
temporal_resolution: Day
institution: Wageningen Univerity & Research, and University of ...
contact: Guido van der Werf (guido.vanderwerf@wur.nl), Yang ...Load with emiproc¶
emiproc hopefully makes it easy to load and process the data. You need simply to specify which of the substances you want to load.
[ ]:
from emiproc.inventories.gfed import GFEDv51
gfed = GFEDv51(file_dir=local_dir, year=year, substances=["CO2", "CH4"])
[8]:
from emiproc.plots import plot_inventory
import matplotlib.pyplot as plt
plt.style.use("default")
plot_inventory(gfed)
Temporal distribution¶
The gfed inventory also has a temporal distribution of the emissions.
With emiproc we can get the temporally distributed emissions of the inventory. This is what we do below, where we get for each cell/day/category/substance the emissions.
[6]:
from emiproc.exports.utils import get_temporally_scaled_array
import pandas as pd
emissions = get_temporally_scaled_array(gfed, time_range=year, sum_over_cells=False)
emissions
[6]:
<xarray.DataArray (substance: 2, category: 1, cell: 1036800, time: 366)> Size: 6GB
array([[[[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
...,
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.]]],
[[[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
...,
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.]]]], shape=(2, 1, 1036800, 366))
Coordinates:
* substance (substance) <U3 24B 'CH4' 'CO2'
* category (category) <U4 16B 'gfed'
* cell (cell) int64 8MB 0 1 2 3 4 ... 1036796 1036797 1036798 1036799
* time (time) datetime64[ns] 3kB 2020-01-01 2020-01-02 ... 2020-12-31
Attributes:
units: kg/year/cell
description: Emissions of GFED51_Inventory
history: ["Inventory(GFED51_Inventory) created as type:'GFED51_Inven...
source: Created by emiproc.inv_to_xarray Now we can plot this results.
We see a large correlation between the 2 substances but we can see that the emissions are not the same.
[7]:
total = emissions.sum(dim="cell") / 365
fig, ax = plt.subplots(nrows=len(gfed.substances), figsize=(10, 5), sharex=True)
for i, substance, ax in zip(range(len(gfed.substances)), gfed.substances, ax):
ax.plot(total["time"], total.sel(substance=substance).values.ravel())
ax.set_ylabel(f"{substance} [kg/day]")
ax.set_ylim(0, None)
ax.set_xlabel("Time")
plt.show()