Skip to main content

Adjeff

Adjeff simulates and corrects the adjacency effect in Sentinel-2 imagery: the light that the atmosphere scatters from neighbouring pixels into the one observed.

  • Forward simulation: top-of-atmosphere reflectance of any surface, by GPU Monte Carlo radiative transfer (Smart-G).
  • PSF learning: the atmospheric point spread function $P$, fitted per band and atmospheric state as an analytical kernel.
  • Correction: surface reflectance recovered from an observed scene, with the learned PSF.

$$\rho_{toa} = \rho_{atm} + T^\downarrow \frac{T^\uparrow_{dir},\rho_s + T^\uparrow_{dif},(\rho_s \ast P)}{1 - s,(\rho_s \ast P)}$$

Installation

Adjeff is managed with pixi: Smart-G and part of its dependencies come from conda-forge.

git clone https://github.com/walcark/Adjeff.git && cd Adjeff
pixi install -e gpu          # or -e cpu, without Smart-G simulations
export SMARTG_DIR_AUXDATA=/path/to/smartg/auxdata

Simulations need a CUDA 12.6 GPU and the Smart-G auxiliary data. Analysis, PSF models and the 5S formulas run on CPU.

Example

import adjeff
from adjeff.core import KingPSF, S2Band, disk_image_dict
from adjeff.modules.models import Unif2Surface
from adjeff.optim import TrainingImages

bands = [S2Band.B03]
cfg = adjeff.make_full_config(bands, aot=0.2, rh=50.0, h=0.0, sza=30.0, vza=5.0)

# Bright disks of 1, 5 and 50 km on a dark ground, 120 m pixels.
disks = [
    disk_image_dict(radius=r, res_km=0.12, rho_max=0.5, bands=bands, n=1999)
    for r in (1.0, 5.0, 50.0)
]

# Simulate their radiative terms, rho_toa and rho_unif (GPU).
disks = adjeff.run_forward_pipeline(disks, **cfg)

# Fit the King PSF that recovers rho_s from rho_unif.
model = adjeff.make_model(
    Unif2Surface, KingPSF, bands, res_km=0.12, n=1999,
    init_parameters={"sigma": 0.5, "gamma": 2.0},
)
tree = adjeff.fit(model, TrainingImages(disks))

# Correct a scene carrying rho_unif and the radiative terms.
corrected = adjeff.apply_psf(disks[0], tree, S2Band.B03)

adjeff.fit_psf(scene, bands, KingPSF, ...) does the same in one call, at the mean atmosphere of a loaded product.

Documentation

User guide Concepts, configuration, samplers, PSF, fitting, cache, logging
Notebooks Six worked examples, from a synthetic scene to a PSF fitted and measured
Changelog What changed, and why
Roadmap Open questions and planned work

Development

pixi install -e dev
pixi run -e dev all                    # format, lint, mypy --strict, tests
pixi run -e dev-gpu test-integration   # Smart-G tests, on GPU

License

Apache-2.0.

Metadata

Release files for adjeff 1.2.5

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

Source distribution (sdist)

Source distribution for adjeff 1.2.5
File Size Uploaded Provenance Actions
adjeff-1.2.5.tar.gz 1.6 MB With provenance Details for adjeff-1.2.5.tar.gz

Built distribution (wheel)

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

Total release size: 1.7 MB

Release files / adjeff-1.2.5.tar.gz

Download URL adjeff-1.2.5.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
1b9f36bc3269147a619750fc8dd5e9cbc2a8081f0a984646bce242f5e880f03e
BLAKE2b-256 checksum
How to use checksums
1e6a0006a8e5fbdc11db2dbb4bb55a822242da58e72d3ad1ef2759e25a4a1bf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / adjeff-1.2.5-py3-none-any.whl

Download URL adjeff-1.2.5-py3-none-any.whl
Size 138.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
71f7076574a72c034e23ce2e6088b57410f0da9a3f41ae7c0692a0147ba3eea3
BLAKE2b-256 checksum
How to use checksums
3f0ec31ec27b3adaf1eac498ff30282e2ed059b119876548c1f7f330205b0f7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for adjeff 1.2.5

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for adjeff-1.2.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

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