Skip to main content

Simplified Sentinel-2 TIF generation and spatial-temporal tools

Project description

sentinel_2_tif

sentinel_2_tif is a Python package that simplifies the process of generating georeferenced .tif images from Sentinel-2 Level-2A satellite data. It offers tools for spatial buffering, time window generation, scene compositing, and automatic .tif file creation using Microsoft’s Planetary Computer STAC API.

With this package, you will be able to generate multiple .tif images in a single data pull, each with different bounding box sizes and time windows. This flexibility is designed to help you efficiently explore and compare composite imagery, enabling you to identify the optimal composite for your analysis.


Features

  • Access Sentinel-2 L2A imagery via Planetary Computer
  • Create minimum bounding rectangles (MBRs) from coordinates, a DataFrame, or a dictionary
  • Generate bounding box buffers in kilometers
  • Create symmetrical time windows around an event date
  • Develop scene search grids with bounding box and time window combinations
  • Composite scenes using median or mean
  • Save georeferenced .tif outputs with full metadata
  • Designed for both notebook and production workflows

Installation

Install using pip:

pip install sentinel-2-tif

Example Usage

# imports
from sentinel_2_tif.spatial import mbr_buffer, mbr_buffers
from sentinel_2_tif.temporal import time_wrapper, time_windows
from sentinel_2_tif.search import st_grid
from sentinel_2_tif.pipeline import tif_generator
from shapely.geometry import box

# instantiating minimim bounding rectangle (MBR)
bbox = mbr(west=-123.0, south=37.0, east=-121.0, north=38.5)

# generating a grid of spatial + temporal search combinations
scene_search = st_grid(
    mbr=bbox,
    buffers=[0, 1, 5],
    wrap_sizes=[1, 2],
    event_date="2022-08-07",
    as_records=False
)

# pulling scenes and generating composite .tif(s)
summary = tif_generator(
    scene_search=scene_search,
    composite="median",
    out_dir="./Collected TIFF Files"
)

Package Modules

  • spatial: MBR and MBR buffer generation
  • temporal: Time window generation to expand scene selection
  • search: Spatial-temporal search grid generator
  • pipeline: Scene extraction and .tif writer

License

MIT License. See LICENSE for details.

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_tif-0.1.1.tar.gz (10.2 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_tif-0.1.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file sentinel_2_tif-0.1.1.tar.gz.

File metadata

  • Download URL: sentinel_2_tif-0.1.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for sentinel_2_tif-0.1.1.tar.gz
Algorithm Hash digest
SHA256 880104a9ace15229cdfaae9f5d901de763b6d017e049a29f6b89976d7ab3393d
MD5 93a8278f43130ef383d967c3c5a74d36
BLAKE2b-256 f526b1011d8185a51b6f47f49a6f60cdf08e84baeccb693fac9482b572f76d0b

See more details on using hashes here.

File details

Details for the file sentinel_2_tif-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sentinel_2_tif-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for sentinel_2_tif-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5f36c4a015c64ca9908ef8c2247705474ae441118a54ade7df6fda8b575d010
MD5 b9127e3f18282bc4b9473c9afff83187
BLAKE2b-256 dc0268a6ba5372e6811d19c4dbf7a2bfde88a384193b5f056f58242718c86d18

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