Architecture

Folder Structure

sarpyx/
  cli/
    __init__.py
    algorithms/AdaptiveThresholding.py
    algorithms/__init__.py
    decode.py
    focus.py
    main.py
    shipdet.py
    unzip.py
    upload.py
    utils.py
    worldsar.py
  processor/
    __init__.py
    algorithms/__init__.py
    algorithms/backprojection.py
    algorithms/constants.py
    algorithms/mbautofocus.py
    algorithms/rda.py
    core/__init__.py
    core/aux.py
    core/code2physical.py
    core/constants.py
    core/decode.py
    core/dim_updater.py
    core/focus.py
    core/meta.py
    core/signal.py
    core/spectrum.py
    ... (14 more files)
  root/
    sarpyx/__init__.py
  science/
    __init__.py
    indices.py
  sla/
    __init__.py
    core/__init__.py
    core/meta.py
    core/spectrum.py
    metrics.py
    utilis.py
  snapflow/
    __init__.py
    engine.py
    op.py
    snap2stamps.py
    snap2stamps_pipelines.py
  utils/
    __init__.py
    complex_losses-OLD.py
    dem_utils.py
    executor.py
    geos.py
    grid.py
    hf.py
    io.py
    losses.py
    meta.py
    metrics.py
    nisar_utils.py
    peorb.py
    rfigen.py
    sar_loss.py
    up.py
    ... (3 more files)

Core Modules and Responsibilities

NamespaceModulesRepresentative Modules
__init__.py1sarpyx.__init__
cli11sarpyx.cli.__init__, sarpyx.cli.algorithms.AdaptiveThresholding, sarpyx.cli.algorithms.__init__ ...
processor30sarpyx.processor.__init__, sarpyx.processor.algorithms.__init__, sarpyx.processor.algorithms.backprojection ...
science2sarpyx.science.__init__, sarpyx.science.indices
sla6sarpyx.sla.__init__, sarpyx.sla.core.__init__, sarpyx.sla.core.meta ...
snapflow5sarpyx.snapflow.__init__, sarpyx.snapflow.engine, sarpyx.snapflow.op ...
utils19sarpyx.utils.__init__, sarpyx.utils.complex_losses-OLD, sarpyx.utils.dem_utils ...

Data Flow

  1. Input ingestion (raw products, SAFE archives, or Zarr arrays).
  2. Decode/focus transforms in sarpyx.processor.core.
  3. Optional SNAP pipeline operations via sarpyx.snapflow.engine.GPT.
  4. Persistence via Zarr and export utilities.
  5. Metric/analysis stages in sarpyx.sla and sarpyx.science.

External Integrations

  • ESA SNAP GPT command-line tooling.
  • Hugging Face Hub for upload workflows.
  • Numerical and geospatial stack (NumPy, SciPy, rasterio, geopandas, zarr, dask).

Design Patterns

  • Command-style CLI dispatch in sarpyx.cli.main.
  • Wrapper abstraction for external GPT execution in sarpyx.snapflow.engine.GPT.
  • Pipeline orchestration helpers in sarpyx.snapflow.snap2stamps with a deprecated compatibility alias at sarpyx.snapflow.snap2stamps_pipelines.
  • Manager-style APIs for structured Zarr data access in sarpyx.utils.zarr_utils.

Figma Diagram Specifications

The following JSON blocks are export-ready structured specs for recreation in Figma.

High-level system architecture

Module dependency graph

Data flow diagram

Request lifecycle

Deployment architecture