Skip to main content

Utility for searching and downloading satellite images of Sentinel 2

Project description

Sentinel-2 Band Downloader

Overview

Sentinel-2 Band Downloader is a simple Python package that allows users to download individual bands from Sentinel-2 satellite data.

This package simplifies the process of connecting to the Sentinel API, retrieving product information, creating output folders, obtaining band links, and downloading bands.

Installation

Using pip

You can install the package using pip:

pip install Sentinel_2_band_downloader

Clone repository

git clone https://github.com/beatriznattrodtdavila/Sentinel_2_band_downloader.git cd Sentinel_2_band_downloader pip install -e .

Example

# Import the Sentinel2_Band_Downloader class
from scr.main.sentinel_2_band_downloader import Sentinel2_Band_Downloader

# Initialize the downloader with log and output paths (replace "/path/to/log and "/path/to/output")
downloader = Sentinel2_Band_Downloader(log_path="/path/to/log", output_base_path="/path/to/output")

# Connect to the Copernicus API (replace 'your_username' and 'your_password')
access_token = downloader.connect_to_api(username="your_username", password="your_password")

# Construct a query for Sentinel-2 products
""" The parameters must be like:
        footprint: str
            The spatial geometry (POLYGON) of the area of interest.
        start_date: str
            The start date for the time range of interest in the format 'YYYY-MM-DD'.
        end_date: str
            The end date for the time range of interest in the format 'YYYY-MM-DD'.
        cloud_cover_percentage: str
            The maximum allowable cloud cover percentage.
        type: str or list
            Type of MSI to download
        platform_name: str, optional
            The name of the Sentinel platform (default: 'SENTINEL-2').
"""
query_params = downloader.construct_query(footprint="your_footprint", start_date="start_date", 
                                          end_date="end_date", cloud_cover_percentage="cloud_cover", 
                                          type="your_type", platform_name="your_platform_name")


# Write the bands to download
bands_dict = {"L1C":["B01", "B02", "B03", "B04", "B05", "B06", "B07", "B08", "B8A", "B09", "B10", "B11", "B12", "TCI"],
                  "L2A":{"10m": ["AOT", "B02", "B03", "B04", "B08", "TCI", "WVP"],
                  "20m": ["AOT","B01", "B02", "B03", "B04", "B05","B06", "B07", "B8A", "B11", "B12", "SCL", "TCI", "WVP"],
                  "60m": ["AOT","B01", "B02", "B03", "B04", "B05","B06", "B07", "B8A", "B09","B11", "B12", "SCL", "TCI", "WVP"]}}

# Download Sentinel2 Bands
downloader.download_sentinel2_bands(access_token, query_params, bands_dict)

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_2_band_downloader-0.2.9.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

Sentinel_2_band_downloader-0.2.9-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file Sentinel_2_band_downloader-0.2.9.tar.gz.

File metadata

File hashes

Hashes for Sentinel_2_band_downloader-0.2.9.tar.gz
Algorithm Hash digest
SHA256 1a60d9689b13a53c516243b2e01d06f3d2d0eb90d3367929a9b952cef9d4f186
MD5 c925e0c085e92af4a600614ca8575260
BLAKE2b-256 44f2ffe835bf2dc9b2094b25ec42b3579803a97ec4ca9d785f84b08bd0a5cfcd

See more details on using hashes here.

File details

Details for the file Sentinel_2_band_downloader-0.2.9-py3-none-any.whl.

File metadata

File hashes

Hashes for Sentinel_2_band_downloader-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1cceb48ce6b434de8dd3adc739ddcfad44ff3dae651ad34fa74a9c8ddecb6570
MD5 86add6c0298cf208364cc76ec5d7decf
BLAKE2b-256 970d5c8c1f7ce1eaa9a3d09c45509cfe834c3555a5ccf1ca311eaca895b5a9e9

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