Air Quality and COVID-19

An exploration of how the atmosphere responded to wide spread government shutdowns and sudden change in human behavior.
Author

Kathryn Berger

Published

April 12, 2023

Run this notebook

You can launch this notebook using mybinder, by clicking the button below.

Binder

Approach

  1. Identify available dates and temporal frequency of observations for a given collection - NO₂
  2. Pass the STAC item into raster API /stac/tilejson.json endpoint
  3. We’ll visualize two tiles (side-by-side) allowing for comparison of each of the time points using folium.plugins.DualMap

About the Data

This dataset is of monthly nitrogen dioxide (NO₂) levels values across the globe. Darker colors indicate higher NO₂ levels and more activity. Lighter colors indicate lower levels of NO₂ and less activity. Missing pixels indicate areas of no data most likely associated with cloud cover or snow.

The Case Study - Air Quality and COVID-19

In this notebook, we’ll walk through the development of side-by-side comparisons of NO₂ levels before and after government lockdowns as demonstrated Seeing Rebounds in NO₂ in this VEDA Discovery story: Air Quality and COVID-19 available on the VEDA Dashboard.

Querying the STAC API

import requests
from folium import Map, TileLayer
# Provide STAC and RASTER API endpoints
STAC_API_URL = "https://staging-stac.delta-backend.com"
RASTER_API_URL = "https://staging-raster.delta-backend.com"

# Declare collection of interest - Nitrogen Oxide
collection_name = "no2-monthly"
#Fetch STAC collection
collection = requests.get(f"{STAC_API_URL}/collections/{collection_name}").json()
collection
{'id': 'no2-monthly',
 'type': 'Collection',
 'links': [{'rel': 'items',
   'type': 'application/geo+json',
   'href': 'https://staging-stac.delta-backend.com/collections/no2-monthly/items'},
  {'rel': 'parent',
   'type': 'application/json',
   'href': 'https://staging-stac.delta-backend.com/'},
  {'rel': 'root',
   'type': 'application/json',
   'href': 'https://staging-stac.delta-backend.com/'},
  {'rel': 'self',
   'type': 'application/json',
   'href': 'https://staging-stac.delta-backend.com/collections/no2-monthly'}],
 'title': 'NO₂',
 'extent': {'spatial': {'bbox': [[-180, -90, 180, 90]]},
  'temporal': {'interval': [['2016-01-01 00:00:00+00',
     '2022-12-01 00:00:00+00']]}},
 'license': 'MIT',
 'summaries': {'datetime': ['2016-01-01T00:00:00Z', '2022-12-01T00:00:00Z'],
  'cog_default': {'max': 50064805976866816, 'min': -10183824872833024}},
 'description': 'Darker colors indicate higher nitrogen dioxide (NO₂) levels and more activity. Lighter colors indicate lower levels of NO₂ and less activity. Missing pixels indicate areas of no data most likely associated with cloud cover or snow.',
 'item_assets': {'cog_default': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized',
   'roles': ['data', 'layer'],
   'title': 'Default COG Layer',
   'description': 'Cloud optimized default layer to display on map'}},
 'stac_version': '1.0.0',
 'stac_extensions': ['https://stac-extensions.github.io/item-assets/v1.0.0/schema.json'],
 'dashboard:is_periodic': True,
 'dashboard:time_density': 'month'}

Examining the contents of our collection under summaries we see that the data is available from January 2015 to December 2022. By looking at the dashboard:time density we observe that the periodic frequency of these observations is monthly.

# Check total number of items available
items = requests.get(f"{STAC_API_URL}/collections/{collection_name}/items?limit=100").json()["features"]
print(f"Found {len(items)} items")
Found 84 items

This makes sense as there are 7 years between 2016 - 2022, with 12 months per year, meaning 84 records in total.

Below, we’ll use the cog_default values to provide our upper and lower bounds in rescale_values.

rescale_values = collection["summaries"]["cog_default"]
rescale_values
{'max': 50064805976866816, 'min': -10183824872833024}

Seeing Rebounds in NO₂

Air pollutants with short lifespans, like NO₂, decreased dramatically with COVID-related shutdowns in the spring of 2020 (see lefthand side map). As the world began to re-open and mobility restrictions eased, travel increased and alongside it NO₂ pollutants. Air quality levels are now returning to pre-pandemic levels (see righthand side map).

Scroll and zoom within the maps below, the side-by-side comparison will follow wherever you explore. Darker purples indicate higher NO₂ levels and more activity. Lighter blues indicate lower levels of NO₂ and less activity.

# We'll import folium to map and folium.plugins to allow mapping side-by-side
import folium
import folium.plugins

# Set initial zoom and map for NO2 Layer
m = folium.plugins.DualMap(location=(33.6901, 118.9325), zoom_start=5)

# February 2020
map_layer_2020 = TileLayer(
    tiles=february_2020_tile["tiles"][0],
    attr="VEDA",
    opacity=0.8,
)
map_layer_2020.add_to(m.m1)

# February 2022
map_layer_2022 = TileLayer(
    tiles=february_2022_tile["tiles"][0],
    attr="VEDA",
    opacity=0.8,
)
map_layer_2022.add_to(m.m2)

m
Make this Notebook Trusted to load map: File -> Trust Notebook

Summary

In this case study we have successfully visualized how NASA monitors NO₂ emissions from space. By showcasing lockdown (February 2020) and post-lockdown (February 2022) snapshots of air quality side-by-side, we demonstrate how quickly atmospheric NO₂ responds to reductions in emissions and human behavior.