Skip to main content

🛰️ SatHarmony

Sensor emulation and harmonization for Earth Observation.

PyPI Python License

SatHarmony provides physically-based sensor emulation to create synthetic historical satellite imagery from modern sensors. Currently supports Sentinel-2 → Landsat MSS emulation with realistic degradation modeling.

Installation

pip install satharmony

# With GeoTIFF I/O support
pip install satharmony[io]

Quick Start

import numpy as np
import satharmony

# Load your Sentinel-2 image (C, H, W) and CloudSEN12 labels (H, W)
s2_image = ...      # shape: (13, 512, 512), float32, [0, 1]
s2_labels = ...     # shape: (512, 512), uint8, classes 0-3

# Emulate both together (recommended - guarantees matching dimensions)
mss, mss_labels, scale_factor = satharmony.emulate_s2_with_labels(
    s2_image, s2_labels, seed=42
)
# mss.shape:        (4, 73, 73)
# mss_labels.shape: (73, 73)

# Or emulate separately (must pass scale_factor to labels)
mss, sf = satharmony.emulate_s2(s2_image, seed=42)
mss_labels = satharmony.emulate_labels(s2_labels, scale_factor=sf)

Features

The MSS emulator applies physically-motivated degradations:

Degradation Description
Spectral Band selection (B3, B4, B7, B8 → MSS 4 bands)
Spatial PSF convolution + downsampling (10m → 60-80m)
Radiometric 6-bit quantization, sqrt compression, saturation
Striping 6-detector gain/offset mismatch artifacts
Memory Effect Bright target recovery trailing
Noise Coherent (periodic) + random (gaussian/poisson)
Scan Artifacts Line dropouts and transmission errors

API Reference

# Combined emulation (recommended)
mss, labels, sf = satharmony.emulate_s2_with_labels(image, labels, seed=42)

# Independent emulation
mss, sf = satharmony.emulate_s2(image, seed=42)
mss, sf = satharmony.emulate_s2(image, scale_factor=8)  # fixed scale
labels = satharmony.emulate_labels(labels, scale_factor=sf)

# Low-level access
from satharmony import MSSEmulator, PipelineConfig

config = PipelineConfig()
config.spatial.target_gsd.min = 60.0
config.spatial.target_gsd.max = 60.0  # fixed 60m

emulator = MSSEmulator(config)
mss = emulator(image)

Label Aggregation

CloudSEN12 labels (10m) are aggregated using conservative criteria from Roy et al.:

  • Precedence: cloud > shadow > thin_cloud > clear
  • Classes: 0=clear, 1=thin_cloud, 2=cloud, 3=shadow

Citation

@software{satharmony2025,
  author  = {Contreras, Julio},
  title   = {SatHarmony: Sensor Emulation for Earth Observation},
  year    = {2025},
  url     = {https://github.com/IPL-UV/satharmony}
}

License

MIT License - see LICENSE for details.

Metadata

Release files for satharmony 0.1.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for satharmony 0.1.13
File Size Uploaded Provenance Actions
satharmony-0.1.13.tar.gz 14.0 kB Without provenance Details for satharmony-0.1.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for satharmony 0.1.13
File Interpreter ABI Platform Actions
satharmony-0.1.13-py3-none-any.whl Python 3 none any Details for satharmony-0.1.13-py3-none-any.whl

Total release size: 33.1 kB

Release files / satharmony-0.1.13.tar.gz

Download URL satharmony-0.1.13.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d2d332c4006c7023b4984972de020922c4d2212030698d4484205fd5e9d41273
BLAKE2b-256 checksum
How to use checksums
34dbed7953076178d34f2f9393336e00ea5053b323d687f8aebddfa4d27dfa58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.3 Linux/6.14.0-24-generic

Release files / satharmony-0.1.13-py3-none-any.whl

Download URL satharmony-0.1.13-py3-none-any.whl
Size 19.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ef96caa664b18e640692f756733ce98daa728ce8220493fc0af9a2fe408d9da
BLAKE2b-256 checksum
How to use checksums
db519f1ef058300b3f46b0bd50b73b4c7b4b9bee162f6337215e0b01665459da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.3 Linux/6.14.0-24-generic

Security for satharmony 0.1.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page