Skip to main content

Spatiotemporal Filling and Multistep Smoothing for satellite time series reconstruction

Project description

STMS: Spatiotemporal and Multistep Smoothing for Sentinel-2 Data Reconstruction

STMS is a Python package designed to reconstruct and smooth time-series vegetation index (VI) data, particularly useful in handling cloudy observations in satellite imagery like Sentinel-2.

It performs two main steps:

  1. Spatiotemporal Filling — Uses spatial neighbors and correlation to fill in cloudy or missing data.
  2. Multistep Smoothing — Applies Generalized Additive Models (GAMs) for smoothing over time.

📦 Installation

pip install stms

🔬 Features

  • Handles consecutive cloudy observations
  • Incorporates spatial proximity and temporal correlation
  • Multi-round GAM-based smoothing
  • Easy-to-use API

🧪 Example: Simulated Sentinel-2 Time Series

import numpy as np
from stms import stms

# Simulate vegetation index (VI) using sine function
def sine_func(x, A, B, C, D):
    return A * np.sin(2 * (np.pi / B) * (x - C)) + D

# Time series parameters
A, B, C, D = 0.3, 100, 90, 0.5
x = np.arange(5, 400, 5)
vi = sine_func(x, A, B, C, D) + np.random.uniform(-0.05, 0.05, len(x))
cloud = np.ones_like(vi)

# Add thick cloud contamination
vi[50:60] = np.random.uniform(0.1, 0.2, 10)
cloud[50:60] = 0.01

# Format for STMS
id_sample = np.array(["sample_0"] * len(x))
days_data = x
vi_data = vi.copy()
long_data = np.array([101.5] * len(x))
lati_data = np.array([-2.0] * len(x))
cloud_data = cloud

# Apply STMS
model = stms()
vi_filled = model.spatiotemporal_filling(id_sample, days_data, vi_data, long_data, lati_data, cloud_data)
vi_smoothed = model.multistep_smoothing(id_sample, days_data, vi_filled, cloud_data)

📚 Reference

If you use STMS in your research, please cite the following article:

Suseno, B., Brunel, G., Tisseyre, B., & Wijayanto, H. (2025). Spatiotemporal and multistep smoothing for reconstructing cloudy Sentinel-2 vegetation index time series. Smart Agricultural Technology. https://doi.org/10.1016/j.atech.2025.101378


📄 License

MIT License © Bayu Suseno


🤝 Contributing

Feel free to open issues or pull requests! Contributions are welcome.

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

stms-0.3.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

stms-0.3.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file stms-0.3.0.tar.gz.

File metadata

  • Download URL: stms-0.3.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for stms-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6d5da0e5aeaffcdcb093efe0409aa308b4deda6a71c672d99b7dd501f1bedcf0
MD5 88e0b6d05ca5ce9f7cae1cb78cc79dd9
BLAKE2b-256 e3f00b90f694e0d6b642e38edfa00a6d87fd08a7b9f4b74d7349a34a7e4b3979

See more details on using hashes here.

File details

Details for the file stms-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: stms-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for stms-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1a108ee03555f056089fae03909ab9b38a69ea4fccec6524d6719b51d97d480
MD5 8e169ed76ce15e6afc3145ef7d601cd5
BLAKE2b-256 91393ddaebb6d4ab769c02780278120215f5c0d6684c2ff6ac8449eed91d9e3c

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