Working with MODIS Imagery

Learn how to access and analyze MODIS satellite imagery for daily global coverage at moderate resolution.

Prerequisites: Before starting this tutorial, make sure you have:
  • An ObservEarth API key
  • Created at least one Area of Interest (AOI)
If you haven't done these steps yet, check out our Authentication and Areas of Interest tutorials first.

Introduction to MODIS

MODIS (Moderate Resolution Imaging Spectroradiometer) is an instrument aboard the Terra and Aqua satellites that provides daily global coverage at moderate spatial resolution.

Key Features:
  • Spatial resolution: 250m, 500m, and 1km (depending on the band)
  • Temporal resolution: Daily global coverage
  • Spectral resolution: 36 spectral bands
  • Coverage: Global
  • Data archive: From 2000 (Terra) and 2002 (Aqua) to present
Available MODIS Collections:
Collection Description Resolution Temporal
modis-13A1-061 Vegetation Indices 16-Day L3 Global 500m 500m 16-day
modis-13Q1-061 Vegetation Indices 16-Day L3 Global 250m 250m 16-day
modis-14A1-061 Thermal Anomalies & Fire Daily L3 Global 1km 1km Daily
modis-17A2HGF-061 Gross Primary Productivity Gap-Filled 8-Day L4 Global 500m 500m 8-day
modis-17A2H-061 Gross Primary Productivity 8-Day L4 Global 500m 500m 8-day
modis-11A2-061 Land Surface Temperature & Emissivity 8-Day L3 Global 1km 1km 8-day

Searching for MODIS Imagery

Search for Available Imagery

To find MODIS imagery for your area of interest, use the search endpoint:

API Type
POST
Endpoint
https://observearth.com/api/modis/search/
Request Parameters
Parameter Type Required Description
geometry_id UUID Yes UUID of your Area of Interest
start_date string Yes Start date in YYYY-MM-DD format
end_date string Yes End date in YYYY-MM-DD format
product string No MODIS product (e.g., "modis-13A1-061", "modis-11A2-061")
Code Example
import requests
import json

api_key = "your_api_key_here"
url = "https://observearth.com/api/modis/search/"

payload = {
    "geometry_id": "123e4567-e89b-12d3-a456-426614174000",
    "start_date": "2023-01-01",
    "end_date": "2023-01-31",
    "product": "modis-13A1-061"
}

headers = {
    "X-API-Key": api_key,
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers, data=json.dumps(payload))
data = response.json()

print(f"Found {data['count']} images")
for image in data['results']:
    print(f"ID: {image['id']}, Date: {image['date']}, Product: {image['product']}")

Getting Image Statistics

Calculate Statistics for MODIS Data

Once you've found available MODIS images, you can calculate statistics for various indices over your area of interest.

API Type
POST
Endpoint
https://observearth.com/api/modis/stats/
Request Parameters
Parameter Type Required Description
geometry_id UUID Yes UUID of your Area of Interest
start_date string Yes Start date in YYYY-MM-DD format
end_date string Yes End date in YYYY-MM-DD format
collection string Yes MODIS collection (e.g., "modis-13A1-061")
index string Yes Index to analyze (e.g., "500m_16_days_NDVI")
Code Example
import requests
import json

api_key = "your_api_key_here"
url = "https://observearth.com/api/modis/stats/"

payload = {
    "geometry_id": "123e4567-e89b-12d3-a456-426614174000",
    "start_date": "2023-01-01",
    "end_date": "2023-03-31",
    "collection": "modis-13A1-061",
    "index": "500m_16_days_NDVI"
}

headers = {
    "X-API-Key": api_key,
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers, data=json.dumps(payload))
data = response.json()

for result in data:
    print(f"Date: {result['date']}, Mean: {result['mean']:.2f}, Min: {result['min']:.2f}, Max: {result['max']:.2f}")

Retrieving MODIS Imagery

Get MODIS Imagery

You can retrieve MODIS imagery for visualization and analysis:

API Type
GET
Endpoint
https://observearth.com/api/modis/image/{geometry_id}/
Path Parameters
Parameter Type Description
geometry_id UUID UUID of your Area of Interest
Query Parameters
Parameter Type Required Description
item_id string Yes ID of the MODIS image
collection string Yes MODIS collection (e.g., "modis-13A1-061")
index string Yes Index to visualize (e.g., "500m_16_days_NDVI")
image_type string Yes Image format (png, tiff)
colormap string No Color palette for visualization (e.g., "RdYlGn")
Code Example
import requests
import os
from PIL import Image
from io import BytesIO

api_key = "your_api_key_here"
geometry_id = "123e4567-e89b-12d3-a456-426614174000"
item_id = "MODIS_ITEM_ID_HERE"

url = f"https://observearth.com/api/modis/image/{geometry_id}/"

params = {
    "item_id": item_id,
    "collection": "modis-13A1-061",
    "index": "500m_16_days_NDVI",
    "image_type": "png",
    "colormap": "RdYlGn"
}

headers = {
    "X-API-Key": api_key
}

response = requests.get(url, headers=headers, params=params)

if response.status_code == 200:
    # Save the image
    with open("modis_ndvi.png", "wb") as f:
        f.write(response.content)
    
    # Display the image
    img = Image.open(BytesIO(response.content))
    img.show()
    print("Image saved as modis_ndvi.png")
else:
    print(f"Error: {response.status_code}")
    print(response.text)

Available MODIS Indices

MODIS provides various indices and data layers across different collections:

modis-13A1-061 (500m)
Index Description Value Range
500m_16_days_NDVI Normalized Difference Vegetation Index -0.5 to 1
500m_16_days_EVI Enhanced Vegetation Index -0.5 to 1
500m_16_days_NIR_reflectance Near-infrared reflectance -0.5 to 1
500m_16_days_red_reflectance Red band reflectance -0.5 to 1
500m_16_days_blue_reflectance Blue band reflectance -0.5 to 1
500m_16_days_MIR_reflectance Mid-infrared reflectance -0.5 to 1
modis-11A2-061 (1km)
Index Description Value Range
LST_Day_1km Land Surface Temperature (Day) 7500 to 65535
QC_Day Quality Control for Day measurements 0 to 255
Day_view_time Time of day observation 0 to 240
modis-14A1-061 (Fire Detection)
Index Description Value Range
FireMask Fire mask classification 0 to 366
MaxFRP Maximum Fire Radiative Power 0 to 366
QA Quality Assessment 0 to 255

Global Monitoring Applications

MODIS's global coverage and long data record make it ideal for large-scale environmental monitoring:

Global Vegetation Monitoring

MODIS provides consistent global vegetation monitoring, allowing detection of anomalies and trends across continents.

Fire Detection

MODIS thermal bands can detect active fires globally, providing critical information for fire management and monitoring.

Other Applications:
  • Drought monitoring: Track vegetation stress over large regions
  • Snow and ice cover: Monitor seasonal and long-term changes in snow and ice
  • Land cover change: Detect large-scale land use changes
  • Air quality: Track aerosols and atmospheric conditions
  • Ocean color: Monitor phytoplankton and ocean productivity

Next Steps