Skip to main content

Download Sentinel-1 and Sentinel-2 images from Copernicus Data Space

Project description

Sentinel Images Downloader

A Python library for downloading Sentinel-1 and Sentinel-2 satellite images from the Copernicus Data Space Ecosystem.


🚀 Features

  • ✅ Supports Sentinel-1 and Sentinel-2 satellites
  • ☁️ Cloud coverage filtering (for Sentinel-2)
  • 📅 Flexible date range (±N days from target)
  • 🗺️ Input via WKT polygon format
  • 🎯 Download individual bands or prebuilt visualizations
  • 📦 TIFF output with geospatial metadata
  • ⚙️ Resolution control (default: 512×512)
  • 🧠 In-memory or file output

📦 Installation

pip install sentinel_images_downloader

🔐 How to Get CLIENT_ID and CLIENT_SECRET

  1. Go to Copernicus Data Space Ecosystem
  2. Create an account or log in
  3. Go to My Profile → API Keys
  4. Click Create API Key
  5. Save your Client ID and Client Secret

Basic Usage

from sentinel_images_downloader import download_sentinel_image

polygon = "POLYGON((30.0 50.0, 30.1 50.0, 30.1 50.1, 30.0 50.1, 30.0 50.0))"

img_data, date = download_sentinel_image(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
    polygon_wkt=polygon,
    target_date="2024-05-10",
    days_range=3,                  # +/- N days from target_date
    max_cloud_cover=20,            # Applied only for Sentinel-2 
    visualization="true_color",   # Options: 'true_color', 'false_color', 'ndvi', 'ndwi', etc.
    platform="sentinel-2",        # Options: 'sentinel-1' or 'sentinel-2'
    save_dir="results",           # Optional. If omitted, image is returned in memory (BytesIO)
    resolution=1024                # Optional. Default is 512 Max: 2500 (API dependent)
)

print(f"Image saved to {img_data} from date {date}")

Download a Specific Band

img_data, date = download_sentinel_image(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
    polygon_wkt=polygon,
    target_date="2024-05-10",
    days_range=3,
    max_cloud_cover=10,
    band="B08",                   # Sentinel-2 band (e.g., B01..B12)
    platform="sentinel-2",
    resolution=512
)

Download from Sentinel-1

img_data, date = download_sentinel_image(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
    polygon_wkt=polygon,
    target_date="2024-05-10",
    days_range=5,
    visualization="rvi",         # Options: 'rvi', or use band="VV" / "VH"
    platform="sentinel-1"
)

Output Structure

If save_dir is used, files are saved as:

{save_dir}/YYYY-MM-DD/{visualization_or_band}/{name}.tiff

If save_dir is omitted, function returns BytesIO, suitable for:

import rasterio
with rasterio.open(img_data) as src:
    image = src.read(1)  # or [1, 2, 3] if RGB

⚠️ Notes

  • Sentinel-1 ignores cloud cover value
  • Default resolution is 512×512 (can be changed via resolution)
  • Default max_cloud_cover is 100
  • Images returned as TIFFs (georeferenced)
  • For displaying in Jupyter use rasterio + matplotlib

📄 License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sentinel_images_downloader-0.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sentinel_images_downloader-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file sentinel_images_downloader-0.1.0.tar.gz.

File metadata

File hashes

Hashes for sentinel_images_downloader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a6dc5827d714e81327c63a087f5ba4b883d39135616a2a52f24cd320da23f946
MD5 1b4f1405f7096c810acd64cf0fac6d56
BLAKE2b-256 e88d5bec7c4536b63620a8fdc83c0dce451ec6c16af8a889147aae3b41054386

See more details on using hashes here.

File details

Details for the file sentinel_images_downloader-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sentinel_images_downloader-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d85f4f8c0e650fc3edd7f99e2151a94d19346f29d241137cce9a3746e4641a3
MD5 a5c358dde3259f5a2476ea1dabec07a0
BLAKE2b-256 2c68c1fcc72e3707144afb2ba6a9c305f51c1eeedf00e7dea802514062bc3823

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page