PyTorch reimplementation of the SCOPE radiative transfer model.
Project description
SCOPE
PyTorch-first implementation of the SCOPE canopy radiative transfer model for reflectance, fluorescence, thermal radiance, and coupled energy-balance workflows.
What It Is
scope is designed for users who need:
- asset-backed SCOPE physics in Python
- batched ROI/time execution on
xarraydatasets - differentiable model components in PyTorch
- reproducible MATLAB parity checks in CI and local development
The current implementation supports:
- leaf optics through FLUSPECT
- canopy reflectance through 4SAIL-based transport
- layered fluorescence and thermal radiative transfer
- leaf biochemistry and coupled energy balance
- directional and vertical-profile outputs on the homogeneous canopy path
- ROI/time workflows with
xarrayinput and output assembly
Install
Published package name:
python -m pip install SCOPE-RTM
Import name:
import scope
1. Clone the repository
git clone <your-repo-url> scope
cd scope
2. Fetch the pinned upstream SCOPE assets
python scripts/fetch_upstream_scope.py
If you installed the package in an environment already, the same helper is available as:
scope-fetch-upstream
3. Create an environment and install
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
4. Verify the install
PYTHONPATH=src python examples/basic_scene_reflectance.py
PYTHONPATH=src python -m pytest -q tests/test_scope_benchmark_parity.py tests/test_scope_timeseries_benchmark_parity.py
5-Minute Quickstart
Minimal scene reflectance run
PYTHONPATH=src python examples/basic_scene_reflectance.py
Expected output:
{
"product": "reflectance",
"dims": {"y": 1, "x": 1, "time": 1, "wavelength": 2001},
"rsot_650nm": 0.047138178221010914,
"rsot_865nm": 0.4100649627325952,
"rsot_1600nm": 0.26994893328935227
}
High-level workflow run
PYTHONPATH=src python examples/scope_workflow_demo.py
Expected output:
{
"product": "scope_workflow",
"components": [
"reflectance",
"reflectance_directional",
"reflectance_profile",
"fluorescence",
"fluorescence_directional",
"fluorescence_profile"
],
"rsot_650nm_t0": 0.04522854188089004,
"LoF_peak_t0": 1.985767010834904e-05,
"LoF_peak_wavelength_t0": 744.0
}
Main Entry Points
For most users, the preferred entry points are:
ScopeGridRunner.run_scope_dataset(...)High-level reflectance/fluorescence/thermal workflow dispatch from preparedxarrayinputs.prepare_scope_input_dataset(...)Build a runner-ready dataset from weather, observation, and Sentinel-2 bio inputs.write_netcdf_dataset(...)Persist prepared or simulated outputs to NetCDF with safe backend selection and compression handling.
For direct lower-level use:
FluspectModelCanopyReflectanceModelCanopyFluorescenceModelCanopyThermalRadianceModelCanopyEnergyBalanceModel
Documentation Map
- Installation Guide
- Quickstart
- Model Mechanics
- Input / Output Reference
- Examples
- Production Notes
- Benchmark Policy
Build the docs locally with:
python -m pip install -e ".[docs]"
mkdocs build --strict
Production Notes
- Asset-backed constructors such as
from_scope_assets(...)require an upstream SCOPE checkout. The recommended path isscope-fetch-upstream. - The default CI suite runs parity tests in live-or-pregenerated mode. On machines without MATLAB, the tests compare against checked-in MATLAB fixtures.
- The self-hosted GPU and live-MATLAB lanes remain optional operational lanes; see docs/benchmark-policy.md.
- Documentation can be built locally with
mkdocs build --strictand is deployed by the dedicated GitHub Pages workflow. - Distribution artifacts can be built locally with
python -m buildand validated withpython -m twine check dist/*.
Testing
Run the default suite with:
PYTHONPATH=src python -m pytest -q
The strongest automated checks currently include:
- kernel parity and execution-mode regression tests
- ROI/time runner consistency tests
- committed scene and time-series benchmark summary regression tests
- live-or-pregenerated MATLAB parity tests for the single-scene and time-series benchmark gates
Release Workflows
.github/workflows/release.ymlBuildssdistand wheel artifacts forSCOPE-RTM, validates them withtwine check, and auto-publishes to PyPI on version tags. Manual dispatch still supports TestPyPI or PyPI..github/workflows/docs.ymlBuilds the MkDocs site and deploys it to GitHub Pages.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scope_rtm-0.1.0.tar.gz.
File metadata
- Download URL: scope_rtm-0.1.0.tar.gz
- Upload date:
- Size: 92.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d0205a155e53ab24287ac144f2fd47801dd60ca960ae693049d01a2f3d6b7ff
|
|
| MD5 |
f518bb4191e1f73deb6ef8b69fe5a32b
|
|
| BLAKE2b-256 |
c3b31187c1a89217b805be6d35b35f77923e0dcbb2854a95b57b2ec64eaa4fb9
|
Provenance
The following attestation bundles were made for scope_rtm-0.1.0.tar.gz:
Publisher:
release.yml on MarcYin/SCOPE
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scope_rtm-0.1.0.tar.gz -
Subject digest:
8d0205a155e53ab24287ac144f2fd47801dd60ca960ae693049d01a2f3d6b7ff - Sigstore transparency entry: 1102285281
- Sigstore integration time:
-
Permalink:
MarcYin/SCOPE@3263e2888a13ee83cc0b9620728454f95f184a3c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/MarcYin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3263e2888a13ee83cc0b9620728454f95f184a3c -
Trigger Event:
push
-
Statement type:
File details
Details for the file scope_rtm-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scope_rtm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 79.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36d6147e8fce64bdc55757a111fa2c23e71e175d8076d6615e133e109e1c72e2
|
|
| MD5 |
cf137fbc47b1d18d0b9d19f43a652b4d
|
|
| BLAKE2b-256 |
76eefbe467cfca9c04eb0413b83bdba5d90f53e9e72f656f232c3e8fdcf58b65
|
Provenance
The following attestation bundles were made for scope_rtm-0.1.0-py3-none-any.whl:
Publisher:
release.yml on MarcYin/SCOPE
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scope_rtm-0.1.0-py3-none-any.whl -
Subject digest:
36d6147e8fce64bdc55757a111fa2c23e71e175d8076d6615e133e109e1c72e2 - Sigstore transparency entry: 1102285315
- Sigstore integration time:
-
Permalink:
MarcYin/SCOPE@3263e2888a13ee83cc0b9620728454f95f184a3c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/MarcYin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3263e2888a13ee83cc0b9620728454f95f184a3c -
Trigger Event:
push
-
Statement type: