Metadata-Version: 2.4
Name: sarpyx
Version: 1.0.1
Summary: A swissknife for SAR processing.
Author: Gabriele Daga, Sebastian Fieldhouse, Juanfrancisco Amieva, Cedric Leonard, Valerio Marsocci, Eva Gmelich Mejling
Author-email: Roberto Del Prete <roberto.delprete@esa.int>
License-Expression: Apache-2.0
Requires-Python: <4,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: h5py<4,>=3.11
Requires-Dist: numpy<3,>=1.26
Requires-Dist: pandas<3,>=2.2
Requires-Dist: pyproj<4,>=3.6
Requires-Dist: rasterio<1.5,>=1.4.4; python_version < "3.12"
Requires-Dist: rasterio<1.6,>=1.5.0; python_version >= "3.12"
Requires-Dist: scipy<2,>=1.11
Requires-Dist: shapely<3,>=2
Requires-Dist: zarr<4,>=3
Provides-Extra: copernicus
Requires-Dist: phidown<0.2,>=0.1.26; extra == "copernicus"
Provides-Extra: geo
Requires-Dist: geographiclib<3,>=2.1; extra == "geo"
Requires-Dist: geopandas<2,>=1.1.1; extra == "geo"
Requires-Dist: tqdm<5,>=4.66; extra == "geo"
Provides-Extra: hf
Requires-Dist: huggingface-hub<1,>=0.34.1; extra == "hf"
Requires-Dist: python-dotenv<2,>=1; extra == "hf"
Provides-Extra: io
Requires-Dist: fastparquet<2027.0.0,>=2025.12.0; extra == "io"
Requires-Dist: numcodecs<1,>=0.15; extra == "io"
Requires-Dist: openpyxl<4,>=3.1; extra == "io"
Requires-Dist: pyarrow<24,>=23; extra == "io"
Requires-Dist: pyyaml<7,>=6.0.2; extra == "io"
Requires-Dist: tifffile<2027.0.0,>=2025.6.11; extra == "io"
Provides-Extra: notebook
Requires-Dist: jupyter<2,>=1.1.1; extra == "notebook"
Requires-Dist: sarpyx[viz]; extra == "notebook"
Provides-Extra: processing
Requires-Dist: dask[array]<2027.0.0,>=2025.5.1; extra == "processing"
Requires-Dist: joblib<2,>=1.5.1; extra == "processing"
Requires-Dist: lxml<7,>=5.4.0; extra == "processing"
Requires-Dist: numba<0.66,>=0.60; extra == "processing"
Requires-Dist: psutil<8,>=5.9; extra == "processing"
Provides-Extra: torch
Requires-Dist: kornia<1,>=0.8.1; extra == "torch"
Requires-Dist: pytorch-msssim<2,>=1; extra == "torch"
Requires-Dist: torch<3,>=2.3; extra == "torch"
Provides-Extra: training
Requires-Dist: lightning<3,>=2.5.3; extra == "training"
Requires-Dist: sarpyx[torch]; extra == "training"
Requires-Dist: tensorboard<3,>=2.20.0; extra == "training"
Requires-Dist: tensorboardX<3,>=2.6.4; extra == "training"
Requires-Dist: wandb<1,>=0.21.3; extra == "training"
Provides-Extra: ml
Requires-Dist: einops<1,>=0.8.1; extra == "ml"
Requires-Dist: opt-einsum<4,>=3.4.0; extra == "ml"
Requires-Dist: pykeops<3,>=2.3; extra == "ml"
Requires-Dist: sarpyx[training]; extra == "ml"
Requires-Dist: scikit-image<1,>=0.25.2; extra == "ml"
Requires-Dist: scikit-learn<2,>=1.7.2; extra == "ml"
Provides-Extra: viz
Requires-Dist: adjustText<2,>=1.4; extra == "viz"
Requires-Dist: folium<1,>=0.20.0; extra == "viz"
Requires-Dist: matplotlib<4,>=3.8; extra == "viz"
Requires-Dist: plotly<7,>=6.2.0; extra == "viz"
Requires-Dist: seaborn<1,>=0.13.2; extra == "viz"
Provides-Extra: all
Requires-Dist: sarpyx[copernicus,geo,hf,io,ml,notebook,processing,viz]; extra == "all"
Dynamic: license-file

<div align="center">

<img src="src/sarpyx_logo.png" width="1400px" alt="sarpyx">

<br />

<a href="docs/user_guide/README.md">
  <img alt="User Manual" src="https://img.shields.io/badge/Read-User%20Manual-111827?style=for-the-badge" />
</a>
<a href="docs/user_guide/getting_started.md">
  <img alt="Quick Start" src="https://img.shields.io/badge/Start-Quick%20Start-0f766e?style=for-the-badge" />
</a>
<a href="LICENSE">
  <img alt="License" src="https://img.shields.io/badge/License-Apache--2.0-374151?style=for-the-badge" />
</a>
<a href="https://github.com/ESA-PhiLab/sarpyx/releases/tag/v1.0.0">
  <img alt="Version" src="https://img.shields.io/badge/Version-1.0.0-2563eb?style=for-the-badge" />
</a>
</div>

##

**sarpyx** is a specialized Python toolkit for **Synthetic Aperture Radar (SAR)** processing with tight integration to ESA **SNAP**. It focuses on reproducible SAR workflows, SNAP GPT orchestration, fast tiling, validation, and research features such as **sub-aperture decomposition**.

## Highlights

- SNAP GPT integration with configurable graphs and operator chaining.
- WorldSAR preprocessing, tiling, validation, and H5-to-Zarr conversion.
- Generic pipeline CLI with built-in recipes for Sentinel-1, TSX, CSG, Biomass, NISAR, and Sentinel-1 InSAR.
- Sub-aperture decomposition for Sentinel-style BEAM-DIMAP products.
- Geocoded outputs ready for GIS and downstream ML.
- Utilities compatible with `rasterio`, `geopandas`, `pyproj`, `h5py`, `zarr`, and `dask`.

## Commands

```bash
sarpyx --help           # Top-level command dispatcher
sarpyx worldsar --help  # WorldSAR preprocessing, tiling, validation, H5-to-Zarr
sarpyx pipeline --help  # Explicit built-in or external pipeline recipes
sarpyx-worldsar --help  # Compatibility WorldSAR entry point
sarpyx-pipeline --help  # Compatibility pipeline entry point
```

## Documentation

- [Documentation site](https://esa-philab.github.io/sarpyx/)
- [Installation guide](docs/user_guide/installation.md)
- [CLI usage examples](docs/user_guide/cli_examples.md)
- [User guide](docs/user_guide/README.md)
- [API reference](docs/api/README.md)

## Install

The recommended installation uses **conda first** to provide ESA SNAP and `gpt`, then installs `sarpyx` with pip from this checkout. This keeps SNAP/native dependencies managed by conda while keeping the Python package editable.

```bash
conda create -n sarpyx -c sirbastiano/label/dev -c conda-forge \
  python=3.12 pip snap13=13.0.0

conda activate sarpyx
python -m pip install -e .
```

Verify the installation:

```bash
gpt -h
sarpyx --help
sarpyx worldsar --help
sarpyx pipeline --help
```

For development and tests:

```bash
python -m pip install -e ".[copernicus]"
python -m pip install pytest
pytest -q
```

<details>
<summary><strong>Using uv for repository maintenance</strong></summary>

```bash
uv sync
uv sync --group dev
uv sync --group dev --extra copernicus
uv run pytest -q
uv build
```

</details>

<details>
<summary><strong>Published pip package</strong></summary>

```bash
python -m pip install sarpyx
```

The pip package is suitable for Python-side usage, but SNAP GPT workflows require a working SNAP installation available in the environment.

</details>

## Container usage

For container workflows, use the Docker Compose CLI plugin:

```bash
docker compose version
make recreate
```

At startup, the container expects a mounted grid file. Provide either `GRID_PATH` or place a `*.geojson` file under `/workspace/grid`.

```bash
mkdir -p ./grid
# put any grid GeoJSON here, e.g. ./grid/my_region.geojson
docker compose up
```

You can also pass `--grid-path` to `sarpyx worldsar`.

## Project Links

- [Contributing guide](CONTRIBUTING.md)
- [Security policy](SECURITY.md)
- [Citation metadata](CITATION.cff)
- [JOSS paper draft](paper.md)
- [License](LICENSE)

##

<div align="center">

**Maintainers:** Roberto Del Prete, Gabriele Daga, Sebastian Fieldhouse, Juanfrancisco Amieva, Cedric Leonard, Valerio Marsocci, Eva Gmelich Mejling

</div>
