Skip to main content

Integration package bridging ARC crop parameter retrieval with SCOPE radiative transfer simulations

Project description

ARC-SCOPE

Bridge ARC crop-parameter retrieval with SCOPE radiative-transfer simulations.

PyPI version Python versions Tests Docs License: MIT

ARC-SCOPE is an integration package that connects the ARC (Automated Retrieval of Crop biophysical parameters) system with the SCOPE (Soil-Canopy Observation of Photosynthesis and Energy fluxes) radiative-transfer model. It converts Sentinel-2-derived biophysical parameters into SCOPE-ready inputs, fetches meteorological forcing data, orchestrates the full simulation pipeline, and supports parameter optimisation against observed SIF, thermal, or flux data.

The repo has two example tracks:

  • a real ARC retrieval -> SCOPE reflectance/SIF/thermal example for the heavy runtime
  • a core-dependency showcase for fast onboarding without ARC or SCOPE

Architecture

                         ARC-SCOPE Data Flow
 ================================================================

  GeoJSON + Dates ──> ARC Retrieval
                         |
                         v
                    post_bio_tensor ──> Bridge ──> post_bio_da
                    scale_data              |      post_bio_scale_da
                                            |
                    ERA5 / Local ───> Weather Provider ──> weather_ds
                                            |
                    Field centroid ──> Observation Geometry ──> obs_ds
                                            |
                                            v
                                   prepare_scope_dataset()
                                            |
                                            v
                                     SCOPE Simulation
                                     (PyTorch runner)
                                            |
                                            v
                                  Reflectance / SIF / LST
                                  Energy-balance fluxes
                                            |
                                            v
                                   [Optional] Optimisation
                                   Tune fqe, rss, rbs, ...
                                   against observations

Installation

Requires Python 3.9 – 3.14.

What you want Install command
Core bridge + pipeline pip install arcope
+ ARC satellite retrieval (GDAL, JAX) pip install arcope && pip install git+https://github.com/MarcYin/ARC
+ SCOPE radiative transfer (PyTorch) pip install "arcope[scope]"
+ ERA5 weather downloads pip install "arcope[weather]"
Everything pip install "arcope[all]"
Development (tests + build tools) pip install -e ".[dev]"

The core package only needs numpy, xarray, scipy, and pandas — the heavy ARC, SCOPE, and ERA5 dependencies are opt-in via extras. This means you can run the bridge and the core-dependency showcase with a minimal install.

See docs/installation.md for detailed instructions including GDAL setup and ERA5 credential configuration.

Quick Start

1. Full run example (ARC + SCOPE)

Run the real end-to-end example from the bundled Belgium test field in 2021:

pip install "arcope[all]"
scope fetch-upstream --dest ./upstream/SCOPE
python3 -m arc_scope.experiments.dual_workflow \
  --start-date 2021-05-15 \
  --end-date 2021-10-01 \
  --growth-season-length 60 \
  --weather-provider local \
  --weather-file ./src/arc_scope/data/showcase_weather.csv \
  --scope-root-path ./upstream/SCOPE \
  --workflow reflectance \
  --workflow fluorescence \
  --workflow thermal \
  --simulation-subset-size 8 \
  --dtype float32 \
  --output-dir ./full-run-output

This run performs one real ARC retrieval, prepares SCOPE inputs from weather and observation geometry, runs the validated reflectance, fluorescence, and thermal workflows, and writes a markdown report plus an extensive figure suite and browser explorer.

See docs/full-run-example.md for the artifact bundle and figure inventory.

2. Core showcase (core dependencies only)

Run the primary in-repo showcase to assemble SCOPE-shaped inputs, inspect forcing diagnostics, and fit a proxy fluorescence response without requiring ARC, SCOPE, or ERA5 credentials:

pip install arcope
python3 -m arc_scope.experiments.showcase --output-dir ./showcase-output

If you are working from a repo checkout, examples/05_showcase_experiment.py wraps the same packaged entry point.

See docs/showcase-experiment.md for the full walkthrough and generated artifacts.

3. Bridge conversion (standalone, from NPZ)

Convert saved ARC outputs to SCOPE-ready xarray DataArrays without needing ARC or SCOPE installed:

from arc_scope.bridge import arc_npz_to_scope_inputs

post_bio_da, post_bio_scale_da = arc_npz_to_scope_inputs(
    "arc_output.npz", year=2021
)
print(post_bio_da.dims)   # ('y', 'x', 'band', 'time')
print(post_bio_da.coords["band"].values)  # ['N', 'cab', 'cm', ...]

4. Full pipeline (requires ARC + SCOPE)

Run the complete workflow from a GeoJSON field boundary to SCOPE outputs:

from arc_scope.pipeline import ArcScopePipeline, PipelineConfig

config = PipelineConfig(
    geojson_path="field.geojson",
    start_date="2021-05-15",
    end_date="2021-10-01",
    crop_type="wheat",
    start_of_season=170,
    year=2021,
    scope_workflow="reflectance",
)
pipeline = ArcScopePipeline(config)
result = pipeline.run()

5. Parameter optimisation

Optimise SCOPE parameters (e.g., fluorescence quantum efficiency) against observations:

from arc_scope.optim.parameters import ParameterSet, ParameterSpec
from arc_scope.optim.protocols import ScipyOptimizer
from arc_scope.optim.objective import ScopeObjective

params = ParameterSet([
    ParameterSpec("fqe", initial=0.01, lower=0.001, upper=0.1, transform="log"),
])
optimizer = ScipyOptimizer(method="L-BFGS-B", max_iter=50)
optimised = optimizer.step(objective, params)

Module Overview

Module Purpose Key classes/functions
arc_scope.bridge Convert ARC arrays to SCOPE format arc_arrays_to_scope_inputs, arc_npz_to_scope_inputs, validate_soil_params
arc_scope.weather Fetch meteorological forcing data WeatherProvider, ERA5Provider, LocalProvider
arc_scope.pipeline End-to-end orchestration PipelineConfig, ArcScopePipeline
arc_scope.optim Parameter optimisation ParameterSpec, ParameterSet, ScopeObjective, ScipyOptimizer, TorchOptimizer
arc_scope.experiments Reproducible showcase experiments run_full_experiment, write_full_run_artifacts, run_showcase_experiment, write_showcase_artifacts
arc_scope.utils Geometry, I/O, type aliases solar_position, load_geojson_bounds, BBox, PathLike
arc_scope.data Bundled test data TEST_FIELD_GEOJSON, SHOWCASE_WEATHER_CSV

Configuration Reference

PipelineConfig is a dataclass that controls the entire pipeline:

Field Type Default Description
geojson_path PathLike required Path to field boundary GeoJSON
start_date str required Start date (YYYY-MM-DD)
end_date str required End date (YYYY-MM-DD)
crop_type str required Crop identifier (e.g., "wheat")
start_of_season int required Growth season start (day of year)
year int required Calendar year
num_samples int 100000 ARC archetype samples
growth_season_length int 45 Season length in days
weather_provider str "era5" "era5" or "local"
scope_workflow str "reflectance" Simulation workflow
device str "cpu" PyTorch device
output_dir PathLike "./output" Output directory

SCOPE Workflows

Workflow calc_fluor calc_planck Description
reflectance 0 0 Directional reflectance only (fastest)
fluorescence 1 0 Reflectance + SIF (F685, F740)
thermal 0 1 Reflectance + thermal emission (LST)
energy-balance 1 1 Full energy balance with SIF + thermal + fluxes

Examples

Working examples are in the examples/ directory:

Development

git clone https://github.com/MarcYin/ARCOPE.git
cd ARCOPE
pip install -e ".[dev]"
python -m pytest --tb=short -q

CI runs the full test suite against Python 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14 on every push.

Releases

License

MIT -- 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

arcope-0.1.0.tar.gz (9.3 MB view details)

Uploaded Source

Built Distribution

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

arcope-0.1.0-py3-none-any.whl (75.3 kB view details)

Uploaded Python 3

File details

Details for the file arcope-0.1.0.tar.gz.

File metadata

  • Download URL: arcope-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for arcope-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4734787d3004f4a073f0be12a6ab0b813a13cfecaa236f05c4fd72eaceb477fa
MD5 12b0c7658a4714eefd29fb9a2b5d01fa
BLAKE2b-256 189d1a9eeb011762efdf368ff6daa337e5c133726a5177fefcd361c7546f41e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for arcope-0.1.0.tar.gz:

Publisher: release.yml on MarcYin/ARCOPE

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arcope-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: arcope-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 75.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for arcope-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40861a1c2d7e82ec2cc391c1a63e91a7d5cde7da1ed6a280094cf942798fd67f
MD5 2aa7ba194c05aff75838fb28c36db2d9
BLAKE2b-256 33a9233757e481c451a3a08f16b5d0e3f30c17b4961e2a55c1e0a3fc00914260

See more details on using hashes here.

Provenance

The following attestation bundles were made for arcope-0.1.0-py3-none-any.whl:

Publisher: release.yml on MarcYin/ARCOPE

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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