EMIT Methane Point Source Plume Complexes

Daily aggregated, global point source methane emission plume estimates from the EMIT instrument on the International Space Station (ISS)
Author

Siddharth Chaudhary, Vishal Gaur

Approach

  1. Identify available dates and temporal frequency of observations for the given collection using the GHGC API /stac endpoint. The collection processed in this notebook is the Earth Surface Mineral Dust Source Investigation (EMIT) methane emission plumes data product.
  2. Pass the STAC item into the raster API /stac/tilejson.json endpoint.
  3. Using folium.Map, visualize the plumes.
  4. After the visualization, perform zonal statistics for a given polygon.

About the Data

The Earth Surface Mineral Dust Source Investigation (EMIT) instrument builds upon NASA’s long history of developing advanced imaging spectrometers for new science and applications. EMIT launched to the International Space Station (ISS) on July 14, 2022. The data shows high-confidence research grade methane plumes from point source emitters - updated as they are identified - in keeping with Jet Propulsion Laboratory (JPL) Open Science and Open Data policy. For more information regarding this dataset, please visit the EMIT Methane Point Source Plume Complexes data overview page.

Install the Required Libraries

Required libraries are pre-installed on the GHG Center Hub. If you need to run this notebook elsewhere, please install them with this line in a code cell:

%pip install requests folium rasterstats pystac_client pandas matplotlib –quiet

Querying the STAC API

First, we are going to import the required libraries. Once imported, they allow better executing a query in the GHG Center Spatio Temporal Asset Catalog (STAC) Application Programming Interface (API) where the granules for this collection are stored.

# Import the following libraries
import requests
import folium
import folium.plugins
from folium import Map, TileLayer
from pystac_client import Client
import branca
import pandas as pd
import matplotlib.pyplot as plt
import branca.colormap as cm
import seaborn as sns
# Provide the STAC and RASTER API endpoints
# The endpoint is referring to a location within the API that executes a request on a data collection nesting on the server.

# The STAC API is a catalog of all the existing data collections that are stored in the GHG Center.
STAC_API_URL = "https://earth.gov/ghgcenter/api/stac"

# The RASTER API is used to fetch collections for visualization
RASTER_API_URL = "https://earth.gov/ghgcenter/api/raster"

# The collection name is used to fetch the dataset from the STAC API. First, we define the collection name as a variable
# Name of the collection for methane emission plumes 
collection_name = "emit-ch4plume-v1"
# Fetch the collection from the STAC API using the appropriate endpoint
# The 'requests' library allows a HTTP request possible
collection = requests.get(f"{STAC_API_URL}/collections/{collection_name}").json()

# Print the properties of the collection to the console
collection
{'id': 'emit-ch4plume-v1',
 'type': 'Collection',
 'links': [{'rel': 'items',
   'type': 'application/geo+json',
   'href': 'https://ghg.center/api/stac/collections/emit-ch4plume-v1/items'},
  {'rel': 'parent',
   'type': 'application/json',
   'href': 'https://ghg.center/api/stac/'},
  {'rel': 'root',
   'type': 'application/json',
   'href': 'https://ghg.center/api/stac/'},
  {'rel': 'self',
   'type': 'application/json',
   'href': 'https://ghg.center/api/stac/collections/emit-ch4plume-v1'}],
 'title': 'CH4 plumes emissions',
 'assets': None,
 'extent': {'spatial': {'bbox': [[-121.90662384033203,
     -46.6751594543457,
     151.46371459960938,
     51.3333740234375]]},
  'temporal': {'interval': [['2022-08-10T06:49:57+00:00',
     '2024-04-23T06:09:58+00:00']]}},
 'license': 'CC0-1.0',
 'keywords': None,
 'providers': None,
 'summaries': {'datetime': ['2022-08-10T06:49:57Z',
   '2022-08-10T06:50:21Z',
   '2022-08-10T06:51:32Z',
   '2022-08-11T04:26:30Z',
   '2022-08-14T05:14:12Z',
   '2022-08-15T04:28:26Z',
   '2022-08-15T04:28:38Z',
   '2022-08-15T07:46:45Z',
   '2022-08-15T14:08:23Z',
   '2022-08-16T03:44:09Z',
   '2022-08-16T10:10:35Z',
   '2022-08-16T10:10:58Z',
   '2022-08-16T11:45:05Z',
   '2022-08-17T04:32:35Z',
   '2022-08-17T09:20:38Z',
   '2022-08-18T03:42:31Z',
   '2022-08-18T07:01:05Z',
   '2022-08-18T08:35:06Z',
   '2022-08-18T11:44:40Z',
   '2022-08-19T09:22:31Z',
   '2022-08-19T12:30:47Z',
   '2022-08-20T05:28:04Z',
   '2022-08-20T08:33:24Z',
   '2022-08-20T10:07:39Z',
   '2022-08-20T10:09:37Z',
   '2022-08-20T10:10:39Z',
   '2022-08-21T11:00:23Z',
   '2022-08-22T06:57:13Z',
   '2022-08-22T10:06:53Z',
   '2022-08-23T07:45:04Z',
   '2022-08-26T06:54:35Z',
   '2022-08-26T08:29:15Z',
   '2022-08-26T17:46:42Z',
   '2022-08-27T06:07:30Z',
   '2022-08-27T06:07:53Z',
   '2022-08-27T07:40:30Z',
   '2022-08-27T10:49:27Z',
   '2022-08-28T05:18:53Z',
   '2022-08-28T05:19:05Z',
   '2022-08-28T05:19:17Z',
   '2022-08-28T05:19:29Z',
   '2022-08-28T05:19:41Z',
   '2022-08-28T06:53:00Z',
   '2022-08-28T06:53:24Z',
   '2022-08-28T06:55:50Z',
   '2022-08-28T06:56:26Z',
   '2022-08-28T08:28:47Z',
   '2022-08-29T06:06:27Z',
   '2022-08-29T06:09:13Z',
   '2022-08-29T16:55:53Z',
   '2022-08-30T06:52:44Z',
   '2022-08-31T06:07:02Z',
   '2022-08-31T06:07:38Z',
   '2022-09-01T03:43:18Z',
   '2022-09-01T05:17:09Z',
   '2022-09-01T05:17:20Z',
   '2022-09-01T05:19:20Z',
   '2022-09-01T08:25:25Z',
   '2022-09-03T05:19:24Z',
   '2022-09-03T06:50:56Z',
   '2022-09-03T06:52:42Z',
   '2022-09-03T08:25:37Z',
   '2022-09-09T07:02:54Z',
   '2022-09-09T07:03:06Z',
   '2023-01-07T14:38:18Z',
   '2023-01-11T13:01:07Z',
   '2023-01-11T13:02:18Z',
   '2023-01-19T04:02:23Z',
   '2023-01-21T16:18:34Z',
   '2023-01-22T15:31:51Z',
   '2023-01-23T08:53:11Z',
   '2023-01-25T00:47:44Z',
   '2023-01-26T06:27:16Z',
   '2023-01-26T12:43:35Z',
   '2023-01-27T16:21:04Z',
   '2023-01-28T12:41:18Z',
   '2023-01-28T12:41:30Z',
   '2023-01-29T08:46:11Z',
   '2023-01-29T13:03:21Z',
   '2023-01-29T13:03:33Z',
   '2023-01-30T09:35:55Z',
   '2023-01-30T18:49:23Z',
   '2023-01-31T05:39:24Z',
   '2023-01-31T05:39:36Z',
   '2023-01-31T05:43:17Z',
   '2023-01-31T05:43:40Z',
   '2023-01-31T08:49:13Z',
   '2023-02-01T07:53:26Z',
   '2023-02-02T07:08:03Z',
   '2023-02-02T19:38:21Z',
   '2023-02-03T06:22:56Z',
   '2023-02-03T06:26:29Z',
   '2023-02-03T17:14:34Z',
   '2023-02-04T04:06:49Z',
   '2023-02-04T04:10:09Z',
   '2023-02-04T07:07:01Z',
   '2023-02-04T07:11:17Z',
   '2023-02-04T07:11:44Z',
   '2023-02-04T08:41:39Z',
   '2023-02-04T08:42:03Z',
   '2023-02-05T17:12:44Z',
   '2023-02-05T17:12:55Z',
   '2023-02-06T16:25:14Z',
   '2023-02-14T07:24:57Z',
   '2023-02-14T08:57:15Z',
   '2023-02-14T10:34:22Z',
   '2023-02-14T10:34:57Z',
   '2023-02-15T06:36:26Z',
   '2023-02-15T11:19:33Z',
   '2023-02-15T20:33:54Z',
   '2023-02-16T13:36:26Z',
   '2023-02-16T13:37:01Z',
   '2023-02-17T06:32:21Z',
   '2023-02-17T11:16:03Z',
   '2023-02-17T20:31:34Z',
   '2023-02-17T20:34:32Z',
   '2023-02-18T08:56:51Z',
   '2023-02-18T08:57:03Z',
   '2023-02-18T08:57:39Z',
   '2023-02-18T10:27:23Z',
   '2023-02-18T12:02:10Z',
   '2023-02-18T18:10:54Z',
   '2023-02-19T06:31:55Z',
   '2023-02-19T08:05:03Z',
   '2023-02-19T08:05:27Z',
   '2023-02-19T08:05:39Z',
   '2023-02-19T09:39:08Z',
   '2023-02-19T09:39:43Z',
   '2023-02-19T09:41:18Z',
   '2023-02-19T09:41:30Z',
   '2023-02-19T19:05:39Z',
   '2023-02-20T05:45:40Z',
   '2023-02-20T07:15:30Z',
   '2023-02-20T10:32:20Z',
   '2023-02-20T19:43:24Z',
   '2023-02-20T19:45:46Z',
   '2023-02-20T19:47:23Z',
   '2023-02-21T04:56:04Z',
   '2023-02-21T06:30:01Z',
   '2023-02-21T09:39:54Z',
   '2023-02-22T08:51:06Z',
   '2023-02-23T04:56:45Z',
   '2023-02-23T04:57:20Z',
   '2023-02-23T06:30:22Z',
   '2023-02-23T06:30:33Z',
   '2023-02-23T06:30:57Z',
   '2023-02-23T06:31:09Z',
   '2023-02-23T08:04:47Z',
   '2023-02-23T08:04:59Z',
   '2023-02-24T04:11:58Z',
   '2023-02-24T08:58:31Z',
   '2023-02-24T10:22:19Z',
   '2023-02-24T18:10:00Z',
   '2023-02-24T18:14:29Z',
   '2023-02-24T18:14:41Z',
   '2023-02-25T05:06:19Z',
   '2023-02-25T08:05:31Z',
   '2023-02-25T08:05:43Z',
   '2023-02-26T04:10:22Z',
   '2023-02-26T05:47:14Z',
   '2023-02-27T15:57:14Z',
   '2023-03-11T12:59:54Z',
   '2023-03-18T04:52:50Z',
   '2023-03-23T14:48:05Z',
   '2023-03-24T09:49:19Z',
   '2023-03-24T09:49:43Z',
   '2023-03-25T12:11:18Z',
   '2023-03-25T13:41:23Z',
   '2023-03-25T13:41:35Z',
   '2023-03-25T13:41:47Z',
   '2023-03-25T15:17:28Z',
   '2023-03-26T08:19:20Z',
   '2023-03-26T08:19:55Z',
   '2023-03-26T11:25:21Z',
   '2023-03-26T14:28:44Z',
   '2023-03-26T14:30:19Z',
   '2023-03-27T07:33:31Z',
   '2023-03-27T12:08:58Z',
   '2023-03-27T12:09:57Z',
   '2023-03-30T09:49:34Z',
   '2023-03-30T09:50:33Z',
   '2023-03-30T09:50:45Z',
   '2023-03-30T12:52:50Z',
   '2023-03-30T12:53:02Z',
   '2023-03-31T07:23:49Z',
   '2023-03-31T12:06:33Z',
   '2023-03-31T19:49:37Z',
   '2023-04-03T08:10:31Z',
   '2023-04-03T08:12:19Z',
   '2023-04-03T08:14:57Z',
   '2023-04-03T09:45:39Z',
   '2023-04-03T11:18:37Z',
   '2023-04-03T11:18:49Z',
   '2023-04-04T08:58:44Z',
   '2023-04-04T08:59:08Z',
   '2023-04-04T09:00:19Z',
   '2023-04-04T09:00:31Z',
   '2023-04-04T09:00:42Z',
   '2023-04-05T06:35:43Z',
   '2023-04-05T08:12:46Z',
   '2023-04-13T09:57:29Z',
   '2023-04-16T12:22:03Z',
   '2023-04-16T21:37:35Z',
   '2023-04-17T09:58:36Z',
   '2023-04-17T09:58:48Z',
   '2023-04-18T06:06:02Z',
   '2023-04-18T06:06:25Z',
   '2023-04-18T09:09:31Z',
   '2023-04-18T09:10:53Z',
   '2023-04-18T09:11:17Z',
   '2023-04-18T09:11:28Z',
   '2023-04-18T09:11:52Z',
   '2023-04-18T09:12:16Z',
   '2023-04-18T20:01:18Z',
   '2023-04-19T08:23:52Z',
   '2023-04-19T11:33:35Z',
   '2023-04-19T13:06:50Z',
   '2023-04-20T06:01:48Z',
   '2023-04-20T07:35:54Z',
   '2023-04-20T10:45:34Z',
   '2023-04-21T08:23:29Z',
   '2023-04-21T08:26:38Z',
   '2023-04-21T10:00:17Z',
   '2023-04-21T19:14:23Z',
   '2023-04-22T07:34:37Z',
   '2023-04-22T09:10:58Z',
   '2023-04-22T09:11:10Z',
   '2023-04-23T05:15:16Z',
   '2023-04-23T06:44:21Z',
   '2023-04-23T08:22:23Z',
   '2023-04-23T10:01:36Z',
   '2023-04-23T11:26:19Z',
   '2023-04-23T11:29:08Z',
   '2023-04-23T19:12:32Z',
   '2023-04-24T04:24:44Z',
   '2023-04-24T06:08:59Z',
   '2023-04-24T09:08:18Z',
   '2023-04-24T16:49:49Z',
   '2023-04-24T18:25:45Z',
   '2023-04-25T03:40:28Z',
   '2023-04-25T03:40:40Z',
   '2023-04-25T05:12:16Z',
   '2023-04-25T06:46:28Z',
   '2023-04-25T08:19:23Z',
   '2023-04-26T02:53:02Z',
   '2023-04-26T05:57:03Z',
   '2023-04-26T07:31:30Z',
   '2023-04-26T18:22:39Z',
   '2023-04-27T06:44:04Z',
   '2023-04-27T06:44:16Z',
   '2023-04-27T17:36:30Z',
   '2023-04-27T17:51:26Z',
   '2023-04-28T02:49:00Z',
   '2023-04-28T05:55:24Z',
   '2023-04-28T05:55:36Z',
   '2023-04-28T09:03:09Z',
   '2023-04-29T05:08:11Z',
   '2023-04-29T05:08:23Z',
   '2023-04-29T05:08:35Z',
   '2023-04-29T06:44:05Z',
   '2023-04-30T05:55:56Z',
   '2023-04-30T05:56:08Z',
   '2023-04-30T07:28:53Z',
   '2023-04-30T16:44:07Z',
   '2023-05-02T04:22:34Z',
   '2023-05-02T04:22:58Z',
   '2023-05-02T07:27:54Z',
   '2023-05-04T13:54:42Z',
   '2023-05-04T13:54:54Z',
   '2023-05-26T14:21:26Z',
   '2023-05-27T13:32:35Z',
   '2023-05-29T08:55:41Z',
   '2023-05-29T08:56:40Z',
   '2023-05-29T11:57:40Z',
   '2023-05-30T06:35:04Z',
   '2023-05-30T09:37:28Z',
   '2023-05-30T09:40:18Z',
   '2023-05-30T18:57:54Z',
   '2023-05-31T10:23:16Z',
   '2023-05-31T10:24:39Z',
   '2023-06-01T09:36:23Z',
   '2023-06-01T09:39:03Z',
   '2023-06-02T07:19:17Z',
   '2023-06-02T08:47:26Z',
   '2023-06-03T07:59:14Z',
   '2023-06-03T07:59:26Z',
   '2023-06-03T08:03:27Z',
   '2023-06-03T09:32:09Z',
   '2023-06-04T07:06:41Z',
   '2023-06-04T18:02:05Z',
   '2023-06-04T18:02:17Z',
   '2023-06-04T18:02:29Z',
   '2023-06-05T08:00:26Z',
   '2023-06-06T05:34:48Z',
   '2023-06-06T05:35:23Z',
   '2023-06-06T07:09:19Z',
   '2023-06-06T08:50:11Z',
   '2023-06-06T10:14:59Z',
   '2023-06-07T06:20:35Z',
   '2023-06-07T06:23:33Z',
   '2023-06-07T06:24:32Z',
   '2023-06-07T08:00:31Z',
   '2023-06-07T09:26:29Z',
   '2023-06-07T09:26:41Z',
   '2023-06-08T05:31:35Z',
   '2023-06-08T16:23:22Z',
   '2023-06-08T16:23:34Z',
   '2023-06-08T16:23:46Z',
   '2023-06-09T04:51:06Z',
   '2023-06-09T07:50:16Z',
   '2023-06-09T17:10:10Z',
   '2023-06-09T17:11:33Z',
   '2023-06-10T03:57:59Z',
   '2023-06-10T05:30:19Z',
   '2023-06-10T16:21:55Z',
   '2023-06-11T04:44:27Z',
   '2023-06-11T04:45:26Z',
   '2023-06-11T06:16:38Z',
   '2023-06-12T02:24:18Z',
   '2023-06-12T05:32:53Z',
   '2023-06-12T16:21:03Z',
   '2023-06-13T04:43:14Z',
   '2023-06-13T11:13:48Z',
   '2023-06-14T10:24:03Z',
   '2023-06-14T10:24:15Z',
   '2023-06-14T10:24:39Z',
   '2023-06-14T10:24:51Z',
   '2023-06-14T19:37:06Z',
   '2023-06-16T11:59:49Z',
   '2023-06-16T21:13:43Z',
   '2023-06-16T21:14:19Z',
   '2023-06-16T21:14:31Z',
   '2023-06-17T11:00:03Z',
   '2023-06-19T08:03:47Z',
   '2023-06-19T11:07:48Z',
   '2023-06-20T08:44:14Z',
   '2023-06-20T08:44:26Z',
   '2023-06-22T11:50:37Z',
   '2023-06-22T19:32:01Z',
   '2023-06-22T19:32:13Z',
   '2023-06-24T05:29:00Z',
   '2023-06-24T05:30:36Z',
   '2023-06-25T03:13:55Z',
   '2023-06-25T06:16:49Z',
   '2023-06-25T06:18:46Z',
   '2023-06-25T07:52:48Z',
   '2023-06-26T08:40:04Z',
   '2023-06-26T10:12:32Z',
   '2023-06-26T10:13:43Z',
   '2023-06-27T03:08:22Z',
   '2023-06-27T04:42:31Z',
   '2023-06-27T07:52:01Z',
   '2023-06-28T05:29:39Z',
   '2023-06-28T05:32:36Z',
   '2023-06-28T05:33:24Z',
   '2023-06-28T16:19:24Z',
   '2023-06-29T01:34:53Z',
   '2023-06-29T01:35:16Z',
   '2023-06-29T04:40:14Z',
   '2023-06-29T04:40:50Z',
   '2023-06-29T04:41:01Z',
   '2023-06-29T06:14:16Z',
   '2023-06-29T06:15:03Z',
   '2023-06-29T06:16:26Z',
   '2023-06-29T06:16:38Z',
   '2023-06-29T06:16:50Z',
   '2023-06-29T06:17:27Z',
   '2023-06-29T06:18:50Z',
   '2023-06-29T15:40:42Z',
   '2023-06-30T07:06:49Z',
   '2023-06-30T10:23:58Z',
   '2023-06-30T16:17:28Z',
   '2023-07-23T17:36:39Z',
   '2023-07-25T10:05:32Z',
   '2023-07-25T11:39:04Z',
   '2023-07-25T11:39:27Z',
   '2023-07-26T10:53:55Z',
   '2023-07-26T10:54:54Z',
   '2023-07-26T13:57:14Z',
   '2023-07-28T10:53:13Z',
   '2023-07-29T10:02:52Z',
   '2023-07-29T10:06:30Z',
   '2023-07-29T13:08:54Z',
   '2023-07-29T13:10:41Z',
   '2023-07-29T20:53:42Z',
   '2023-07-30T09:14:51Z',
   '2023-07-30T10:48:00Z',
   '2023-07-30T12:20:47Z',
   '2023-07-31T06:58:04Z',
   '2023-07-31T13:07:06Z',
   '2023-07-31T13:08:04Z',
   '2023-07-31T19:18:10Z',
   '2023-07-31T19:18:22Z',
   '2023-07-31T19:18:34Z',
   '2023-07-31T19:18:46Z',
   '2023-08-01T09:16:36Z',
   '2023-08-01T09:16:48Z',
   '2023-08-02T08:25:47Z',
   '2023-08-02T08:26:10Z',
   '2023-08-02T08:29:53Z',
   '2023-08-02T11:34:11Z',
   '2023-08-03T09:21:03Z',
   '2023-08-03T10:48:31Z',
   '2023-08-04T05:22:23Z',
   '2023-08-04T08:25:59Z',
   '2023-08-04T08:29:48Z',
   '2023-08-04T11:31:11Z',
   '2023-08-04T17:41:29Z',
   '2023-08-04T17:41:41Z',
   '2023-08-05T06:08:27Z',
   '2023-08-05T07:38:38Z',
   '2023-08-05T07:40:37Z',
   '2023-08-05T09:08:52Z',
   '2023-08-05T09:09:04Z',
   '2023-08-05T09:09:15Z',
   '2023-08-06T03:46:59Z',
   '2023-08-06T03:48:03Z',
   '2023-08-06T06:52:31Z',
   '2023-08-07T07:35:11Z',
   '2023-08-07T07:36:22Z',
   '2023-08-07T09:06:55Z',
   '2023-08-09T04:30:25Z',
   '2023-08-09T06:01:51Z',
   '2023-08-09T06:03:49Z',
   '2023-08-09T07:32:00Z',
   '2023-08-09T07:32:12Z',
   '2023-08-09T16:50:40Z',
   '2023-08-10T05:15:16Z',
   '2023-08-10T05:15:28Z',
   '2023-08-10T05:15:52Z',
   '2023-08-10T06:51:40Z',
   '2023-08-14T06:57:12Z',
   '2023-08-14T10:07:20Z',
   '2023-08-14T10:08:19Z',
   '2023-08-14T10:10:18Z',
   '2023-08-14T10:11:06Z',
   '2023-08-14T10:11:17Z',
   '2023-08-14T10:11:29Z',
   '2023-08-14T14:51:26Z',
   '2023-08-14T14:52:25Z',
   '2023-08-15T09:20:26Z',
   '2023-08-16T10:10:38Z',
   '2023-08-16T10:10:50Z',
   '2023-08-16T11:48:56Z',
   '2023-08-16T13:17:16Z',
   '2023-08-17T09:24:16Z',
   '2023-08-17T10:58:03Z',
   '2023-08-17T20:15:10Z',
   '2023-08-18T21:00:19Z',
   '2023-08-19T12:29:33Z',
   '2023-08-20T05:28:22Z',
   '2023-08-20T10:14:14Z',
   '2023-08-20T11:42:34Z',
   '2023-08-20T19:28:43Z',
   '2023-08-20T19:28:55Z',
   '2023-08-21T09:25:16Z',
   '2023-08-21T18:41:29Z',
   '2023-08-22T07:00:14Z',
   '2023-08-22T10:11:03Z',
   '2023-08-22T17:52:29Z',
   '2023-08-22T19:25:19Z',
   '2023-08-22T19:25:31Z',
   '2023-08-23T09:17:47Z',
   '2023-08-23T09:23:49Z',
   '2023-08-23T10:56:29Z',
   '2023-08-23T17:06:09Z',
   '2023-08-24T07:00:37Z',
   '2023-08-24T07:00:49Z',
   '2023-08-24T07:01:01Z',
   '2023-08-24T08:39:07Z',
   '2023-08-24T08:39:31Z',
   '2023-08-24T17:53:37Z',
   '2023-08-24T17:54:01Z',
   '2023-08-25T06:13:13Z',
   '2023-08-25T07:47:43Z',
   '2023-08-25T07:50:05Z',
   '2023-08-25T17:05:57Z',
   '2023-08-25T17:06:09Z',
   '2023-08-26T05:26:20Z',
   '2023-08-26T08:35:22Z',
   '2023-08-26T08:35:46Z',
   '2023-08-26T10:06:04Z',
   '2023-08-26T10:07:35Z',
   '2023-08-26T10:08:34Z',
   '2023-08-28T07:02:35Z',
   '2023-08-28T07:03:10Z',
   '2023-08-28T08:34:09Z',
   '2023-08-28T08:34:21Z',
   '2023-09-01T03:52:04Z',
   '2023-09-03T01:00:49Z',
   '2023-09-08T14:10:43Z',
   '2023-09-15T04:26:28Z',
   '2023-09-22T14:48:28Z',
   '2023-09-24T11:42:53Z',
   '2023-09-24T11:44:13Z',
   '2023-09-24T20:57:57Z',
   '2023-09-25T14:01:34Z',
   '2023-09-26T11:41:19Z',
   '2023-09-26T11:41:31Z',
   '2023-09-26T11:41:43Z',
   '2023-09-26T11:43:17Z',
   '2023-09-27T20:11:14Z',
   '2023-09-28T08:36:55Z',
   '2023-09-28T10:01:33Z',
   '2023-09-28T10:10:11Z',
   '2023-09-28T11:45:38Z',
   '2023-09-29T07:44:59Z',
   '2023-09-29T12:25:34Z',
   '2023-09-30T10:05:31Z',
   '2023-09-30T10:05:43Z',
   '2023-09-30T11:37:06Z',
   '2023-09-30T11:37:30Z',
   '2023-10-01T07:42:25Z',
   '2023-10-02T08:24:55Z',
   '2023-10-02T08:31:11Z',
   '2023-10-02T11:39:07Z',
   '2023-10-03T06:09:28Z',
   '2023-10-03T07:42:03Z',
   '2023-10-03T07:46:17Z',
   '2023-10-03T07:46:41Z',
   '2023-10-03T07:47:04Z',
   '2023-10-03T07:47:16Z',
   '2023-10-03T07:47:52Z',
   '2023-10-03T09:16:35Z',
   '2023-10-04T08:31:36Z',
   '2023-10-04T17:47:32Z',
   '2023-10-04T17:47:44Z',
   '2023-10-05T06:07:19Z',
   '2023-10-05T09:21:54Z',
   '2023-10-06T05:21:52Z',
   '2023-10-06T06:55:21Z',
   '2023-10-06T06:55:45Z',
   '2023-10-06T06:55:57Z',
   '2023-10-06T08:27:35Z',
   '2023-10-06T10:02:06Z',
   '2023-10-07T09:14:07Z',
   '2023-10-08T05:15:36Z',
   '2023-10-08T05:15:48Z',
   '2023-10-08T05:26:16Z',
   '2023-10-08T10:02:18Z',
   '2023-10-08T16:11:15Z',
   '2023-10-08T16:11:27Z',
   '2023-10-08T17:46:13Z',
   '2023-10-09T04:30:59Z',
   '2023-10-09T06:09:56Z',
   '2023-10-09T09:14:23Z',
   '2023-10-09T17:00:25Z',
   '2023-10-10T02:16:46Z',
   '2023-10-10T05:18:48Z',
   '2023-10-10T05:19:00Z',
   '2023-10-10T05:19:23Z',
   '2023-10-11T01:31:58Z',
   '2023-10-11T04:35:57Z',
   '2023-10-13T11:00:35Z',
   '2023-10-14T10:15:54Z',
   '2023-10-14T10:16:06Z',
   '2023-10-15T07:55:58Z',
   '2023-10-15T09:24:58Z',
   '2023-10-16T10:10:18Z',
   '2023-10-16T11:48:53Z',
   '2023-10-18T10:14:46Z',
   '2023-10-19T11:04:39Z',
   '2023-10-20T05:27:29Z',
   '2023-10-20T05:27:52Z',
   '2023-10-23T03:09:00Z',
   '2023-10-23T07:50:04Z',
   '2023-10-23T09:21:42Z',
   '2023-10-24T07:01:57Z',
   '2023-10-24T07:02:09Z',
   '2023-10-24T10:09:47Z',
   '2023-10-25T06:15:31Z',
   '2023-10-25T17:03:54Z',
   '2023-10-25T17:04:06Z',
   '2023-10-26T02:21:45Z',
   '2023-10-26T05:26:47Z',
   '2023-10-26T05:27:35Z',
   '2023-10-26T07:01:06Z',
   '2023-10-26T08:36:53Z',
   '2023-10-27T06:14:34Z',
   '2023-10-27T15:32:39Z',
   '2023-10-27T17:07:14Z',
   '2023-10-28T07:01:04Z',
   '2023-10-28T07:01:16Z',
   '2023-10-28T08:34:16Z',
   '2023-10-28T16:19:00Z',
   '2023-10-29T03:10:32Z',
   '2023-10-29T06:15:39Z',
   '2023-10-30T03:55:33Z',
   '2023-10-30T03:55:45Z',
   '2023-11-01T08:34:38Z',
   '2023-11-05T15:00:54Z',
   '2023-11-07T00:53:49Z',
   '2023-11-21T12:25:43Z',
   '2023-11-24T14:26:42Z',
   '2023-11-25T09:22:20Z',
   '2023-11-25T10:55:40Z',
   '2023-11-27T09:19:46Z',
   '2023-11-27T14:00:54Z',
   '2023-11-28T23:44:58Z',
   '2023-11-29T09:20:12Z',
   '2023-11-29T09:20:24Z',
   '2023-11-30T08:31:54Z',
   '2023-11-30T10:05:25Z',
   '2023-11-30T10:07:36Z',
   '2023-11-30T11:38:00Z',
   '2023-11-30T22:06:44Z',
   '2023-12-01T07:43:07Z',
   '2023-12-01T18:35:25Z',
   '2023-12-01T18:35:49Z',
   '2023-12-01T18:36:01Z',
   '2023-12-02T08:32:56Z',
   '2023-12-02T08:33:39Z',
   '2023-12-02T08:33:51Z',
   '2023-12-04T08:30:32Z',
   '2023-12-04T10:00:51Z',
   '2023-12-04T17:46:18Z',
   '2023-12-05T06:05:47Z',
   '2023-12-05T07:43:38Z',
   '2023-12-05T16:58:25Z',
   '2023-12-05T16:58:37Z',
   '2023-12-06T08:25:58Z',
   '2023-12-06T08:26:10Z',
   '2023-12-17T09:26:25Z',
   '2023-12-17T12:30:27Z',
   '2023-12-17T20:13:38Z',
   '2023-12-20T08:35:56Z',
   '2023-12-22T03:50:01Z',
   '2023-12-23T09:21:03Z',
   '2023-12-23T12:30:06Z',
   '2023-12-24T06:57:46Z',
   '2023-12-24T17:45:33Z',
   '2023-12-24T17:45:45Z',
   '2023-12-25T04:37:07Z',
   '2023-12-26T06:54:26Z',
   '2023-12-26T06:54:50Z',
   '2023-12-26T06:55:14Z',
   '2023-12-26T08:27:57Z',
   '2023-12-26T18:07:07Z',
   '2024-01-05T14:51:50Z',
   '2024-01-09T13:14:23Z',
   '2024-01-20T15:49:41Z',
   '2024-01-22T15:47:54Z',
   '2024-01-25T09:08:38Z',
   '2024-01-26T13:01:03Z',
   '2024-01-27T19:59:04Z',
   '2024-01-28T19:11:03Z',
   '2024-01-28T19:11:15Z',
   '2024-01-29T04:22:45Z',
   '2024-01-29T09:07:50Z',
   '2024-01-29T15:05:16Z',
   '2024-01-29T18:26:22Z',
   '2024-01-29T19:58:57Z',
   '2024-01-29T19:59:56Z',
   '2024-01-30T05:17:28Z',
   '2024-01-30T05:17:52Z',
   '2024-01-30T05:18:16Z',
   '2024-01-30T11:26:10Z',
   '2024-01-30T12:36:34Z',
   '2024-01-30T17:39:50Z',
   '2024-01-31T09:08:23Z',
   '2024-01-31T18:24:59Z',
   '2024-02-01T08:23:10Z',
   '2024-02-01T08:24:18Z',
   '2024-02-01T14:24:58Z',
   '2024-02-02T16:51:56Z',
   '2024-02-03T09:51:38Z',
   '2024-02-05T05:16:01Z',
   '2024-02-05T05:16:13Z',
   '2024-02-12T21:48:20Z',
   '2024-02-12T21:48:32Z',
   '2024-02-12T21:48:43Z',
   '2024-02-13T11:45:18Z',
   '2024-02-14T09:20:53Z',
   '2024-02-14T09:21:17Z',
   '2024-02-14T10:56:58Z',
   '2024-02-14T10:57:33Z',
   '2024-02-15T19:34:25Z',
   '2024-02-15T19:34:36Z',
   '2024-02-16T10:57:41Z',
   '2024-02-17T05:27:07Z',
   '2024-02-17T05:27:31Z',
   '2024-02-17T10:08:16Z',
   '2024-02-18T12:26:51Z',
   '2024-02-23T16:10:50Z',
   '2024-02-24T06:09:41Z',
   '2024-02-24T06:10:16Z',
   '2024-02-24T09:14:58Z',
   '2024-02-24T16:58:01Z',
   '2024-02-25T02:13:02Z',
   '2024-02-25T02:13:14Z',
   '2024-02-25T02:13:26Z',
   '2024-02-25T02:13:38Z',
   '2024-02-25T02:13:49Z',
   '2024-02-25T02:14:01Z',
   '2024-02-25T04:11:08Z',
   '2024-02-25T16:09:27Z',
   '2024-02-26T07:40:44Z',
   '2024-02-26T07:40:56Z',
   '2024-02-26T07:41:43Z',
   '2024-02-26T07:43:53Z',
   '2024-02-26T09:13:16Z',
   '2024-02-26T09:14:15Z',
   '2024-02-26T09:14:27Z',
   '2024-02-26T17:01:04Z',
   '2024-02-26T17:01:40Z',
   '2024-02-27T06:53:31Z',
   '2024-02-27T18:06:46Z',
   '2024-02-28T03:02:50Z',
   '2024-02-28T04:35:21Z',
   '2024-02-28T04:35:57Z',
   '2024-03-02T16:32:57Z',
   '2024-03-03T06:10:34Z',
   '2024-03-05T12:33:25Z',
   '2024-03-19T19:12:59Z',
   '2024-03-21T08:34:55Z',
   '2024-03-22T21:45:09Z',
   '2024-03-27T07:05:05Z',
   '2024-03-27T10:07:08Z',
   '2024-03-27T13:13:34Z',
   '2024-03-28T06:17:14Z',
   '2024-03-28T06:17:26Z',
   '2024-03-28T10:53:28Z',
   '2024-03-28T10:54:36Z',
   '2024-03-28T12:25:08Z',
   '2024-03-28T20:10:48Z',
   '2024-03-31T11:37:53Z',
   '2024-04-01T09:18:51Z',
   '2024-04-01T09:19:15Z',
   '2024-04-01T09:19:38Z',
   '2024-04-03T07:46:26Z',
   '2024-04-03T16:58:15Z',
   '2024-04-04T06:53:36Z',
   '2024-04-04T06:57:51Z',
   '2024-04-04T08:28:37Z',
   '2024-04-04T16:08:51Z',
   '2024-04-05T07:41:39Z',
   '2024-04-05T17:01:29Z',
   '2024-04-08T05:22:54Z',
   '2024-04-09T07:44:35Z',
   '2024-04-13T07:53:28Z',
   '2024-04-14T14:54:36Z',
   '2024-04-15T06:21:41Z',
   '2024-04-15T06:21:52Z',
   '2024-04-15T09:25:56Z',
   '2024-04-20T08:35:01Z',
   '2024-04-20T10:14:48Z',
   '2024-04-21T07:46:19Z',
   '2024-04-21T18:42:22Z',
   '2024-04-22T06:58:49Z',
   '2024-04-23T03:04:34Z',
   '2024-04-23T03:04:46Z',
   '2024-04-23T06:09:58Z']},
 'description': 'Methane plumes from point source emitters',
 'item_assets': {'ch4-plume-emissions': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized',
   'roles': ['data', 'layer'],
   'title': 'CH4 Plumes Emissions',
   'description': 'Methane plumes from point source emitters.'}},
 'stac_version': '1.0.0',
 'stac_extensions': None,
 'dashboard:is_periodic': False,
 'dashboard:time_density': 'day'}

Examining the contents of our collection under the temporal variable, we note that data is available from August 2022 to May 2023. By looking at the dashboard: time density, we can see that observations are conducted daily and non-periodically (i.e., there are plumes emissions for multiple places on the same dates).

def get_item_count(collection_id):
    count = 0
    items_url = f"{STAC_API_URL}/collections/{collection_id}/items"

    while True:
        response = requests.get(items_url)

        if not response.ok:
            print("error getting items")
            exit()

        stac = response.json()
        count += int(stac["context"].get("returned", 0))
        next = [link for link in stac["links"] if link["rel"] == "next"]

        if not next:
            break
        items_url = next[0]["href"]

    return count
# Check total number of items available
number_of_items = get_item_count(collection_name)
items = requests.get(f"{STAC_API_URL}/collections/{collection_name}/items?limit={number_of_items}").json()["features"]
print(f"Found {len(items)} items")
Found 1266 items
# Examining the first item in the collection
items[0]

Below, we are entering the minimum and maximum values to provide our upper and lower bounds in rescale_values.

Exploring Methane Emission Plumes (CH₄) using the Raster API

In this notebook, we will explore global methane emission plumes from point sources. We will visualize the outputs on a map using folium.

# To access the year value from each item more easily, this will let us query more explicitly by year and month (e.g., 2020-02)
plume_complexes = {items["id"]: items for items in items} 


# Set the asset value to the appropriate parameter 
asset_name = "ch4-plume-emissions"
# Fetching the min and max values for a specific item
rescale_values = {"max":plume_complexes[list(plume_complexes.keys())[0]]["assets"][asset_name]["raster:bands"][0]["histogram"]["max"], "min":plume_complexes[list(plume_complexes.keys())[0]]["assets"][asset_name]["raster:bands"][0]["histogram"]["min"]}

Now we will pass the item id, collection name, and rescaling_factor to the Raster API endpoint. We will do this for only one item so that we can visualize the event.

# Select the item ID which you want to visualize. Item ID is in the format yyyymmdd followed by the timestamp. This ID can be extracted from the COG name as well.
item_id = "EMIT_L2B_CH4PLM_001_20230418T200118_000829"
color_map = "magma"
methane_plume_tile = requests.get(
    f"{RASTER_API_URL}/stac/tilejson.json?collection={plume_complexes[item_id]['collection']}&item={plume_complexes[item_id]['id']}"
    f"&assets={asset_name}"
    f"&color_formula=gamma+r+1.05&colormap_name={color_map}"
    f"&rescale={rescale_values['min']},{rescale_values['max']}", 
).json()
methane_plume_tile
{'tilejson': '2.2.0',
 'version': '1.0.0',
 'scheme': 'xyz',
 'tiles': ['https://ghg.center/api/raster/stac/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?collection=emit-ch4plume-v1&item=EMIT_L2B_CH4PLM_001_20230418T200118_000829&assets=ch4-plume-emissions&color_formula=gamma+r+1.05&colormap_name=magma&rescale=-775.518310546875%2C2180.226318359375'],
 'minzoom': 0,
 'maxzoom': 24,
 'bounds': [-104.76285251117253,
  39.85322425220504,
  -104.74658553556483,
  39.86515336765068],
 'center': [-104.75471902336868, 39.85918880992786, 0]}

Visualizing CH₄ Emission Plume

# Set a colormap for the granule
# Please refer to matplotlib library if you'd prefer choosing a different color ramp (https://matplotlib.org/stable/users/explain/colors/colormaps.html)
colormap = "magma" 


#Defining the breaks in the colormap 
color_map = cm.LinearColormap(colors = ['#310597', '#4C02A1', '#6600A7', '#7E03A8', '#9511A1', '#AA2395', '#BC3587', '#CC4778', '#DA5A6A', '#E66C5C', '#F0804E', '#F89540','#FDAC33', '#FDC527', '#F8DF25'], vmin = 0, vmax = 1500 )


# Add an appropriate caption, in this case it would be Parts per million meter
color_map.caption = 'ppm-m'

# Set initial zoom and center of map for plume Layer
map_ = folium.Map(location=(methane_plume_tile["center"][1], methane_plume_tile["center"][0]), zoom_start=13, tiles=None, tooltip = 'test tool tip')
folium.TileLayer(tiles='https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}.png', name='ESRI World Imagery', attr='Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',overlay='True').add_to(map_)


# Use the 'TileLayer' library to display the raster layer, add an appropriate caption, and adjust the transparency of the layer on the map
map_layer = TileLayer(
    tiles=methane_plume_tile["tiles"][0],
    name='Plume Complex Landfill',
    overlay='True',
    attr="GHG",
    opacity=1,
)
map_layer.add_to(map_)


# Adjust map elements 
folium.LayerControl(collapsed=False, position='bottomleft').add_to(map_)
map_.add_child(color_map)
svg_style = '<style>svg#legend {font-size: 14px; background-color: white;}</style>'
map_.get_root().header.add_child(folium.Element(svg_style))


# Visualizing the map
map_
Make this Notebook Trusted to load map: File -> Trust Notebook

Calculating Zonal Statistics

To perform zonal statistics, first we need to create a polygon. In this use case we will create a polygon around the plume.

# Plume AOI 
plumes_coordinates = items[item_id]["geometry"]["coordinates"]
methane_plume_aoi = {
    "type": "Feature",
    "properties": {},
    "geometry": {
        "coordinates":
            plumes_coordinates,
        "type": "Polygon",
    },
}
# We'll plug in the coordinates for a location
# central to the study area and a reasonable zoom level
region_name = "Place_Holder" # please put the name of the place you are trying to visualize
aoi_map = Map(
    tiles="OpenStreetMap",
    location=[
        plumes_coordinates[0][0][1],
        plumes_coordinates[0][0][0]
    ],
    zoom_start=12,
)

folium.GeoJson(methane_plume_aoi, name=region_name).add_to(aoi_map)
aoi_map
# Check total number of items available
items = requests.get(
    f"{STAC_API_URL}/collections/{collection_name}/items?limit={number_of_items}"
).json()["features"]
print(f"Found {len(items)} items")
# Explore the first item
items[0]
# The bounding box should be passed to the geojson param as a geojson Feature or FeatureCollection
def generate_stats(item, geojson):
    result = requests.post(
        f"{RASTER_API_URL}/cog/statistics",
        params={"url": item["assets"][asset_name]["href"]},
        json=geojson,
    ).json()
    print(result)
    return {
        **result["properties"],
        "item_id": item["id"][20:],
    }
for item in items:
    print(item["id"])
    break

With the function above, we can generate the statistics for the area of interest.

%%time
stats = [generate_stats(item, methane_plume_aoi) for item in items]
stats = [ stat for stat in stats if stat["statistics"]["b1"]["mean"] != None]

stats
def clean_stats(stats_json) -> pd.DataFrame:
    df = pd.json_normalize(stats_json)
    df.columns = [col.replace("statistics.b1.", "") for col in df.columns]
    # df["date"] = pd.to_datetime(df["datetime"])
    return df


df = clean_stats(stats)
df
plume_tile_2 = requests.get(
    f"{RASTER_API_URL}/stac/tilejson.json?collection={items[0]['collection']}&item={items[0]['id']}"
    f"&assets={asset_name}"
    f"&color_formula=gamma+r+1.05&colormap_name={color_map}"
    f"&rescale={rescale_values['min']},{rescale_values['max']}",
).json()
plume_tile_2
# Use bbox initial zoom and map
# Set up a map located w/in event bounds
plume_tile_2_coordinates = items[0]["geometry"]["coordinates"]
aoi_map_bbox = Map(
    tiles="OpenStreetMap",
    location=[
        plume_tile_2_coordinates[0][0][1],
        plume_tile_2_coordinates[0][0][0]
    ],
    zoom_start=10,
)

map_layer = TileLayer(
    tiles=plume_tile_2["tiles"][0],
    attr="GHG", opacity = 1
)

map_layer.add_to(aoi_map_bbox)

aoi_map_bbox

Summary

In this notebook we have successfully completed the following steps for the STAC collection for the EMIT Methane Point Source Plume Complexes dataset: 1. Install and import the necessary libraries 2. Fetch the collection from STAC collections using the appropriate endpoints 3. Count the number of existing granules within the collection 4. Map the methane emission plumes 5. Generate statistics for the area of interest (AOI)

If you have any questions regarding this user notebook, please contact us using the feedback form.

Back to top