Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SNAP Python Project

Earth observation data processing with ESA SNAP and the esa_snappy Python interface.

Project Structure

snap-python-project/
├── README.md
├── scripts/          # Python processing scripts
│   └── test_snappy.py
├── data/
│   ├── input/        # Source EO products (e.g. Sentinel .SAFE, .zip)
│   └── output/       # Processed results
└── notebooks/        # Jupyter notebooks for analysis

Prerequisites

  • macOS (Apple Silicon or Intel)
  • ESA SNAP 13 — installed at /Applications/esa-snap
  • Miniconda — installed at ~/miniconda3

Setup

1. Install Miniconda (if not already installed)

curl -L -o /tmp/Miniconda3-latest-MacOSX-arm64.sh \
  https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh
bash /tmp/Miniconda3-latest-MacOSX-arm64.sh -b -p ~/miniconda3

2. Install ESA SNAP

Download the macOS ARM installer from step.esa.int and run it. Default install location: /Applications/esa-snap.

3. Create the conda environment

~/miniconda3/bin/conda create -n snappy python=3.12 -y

4. Install esa_snappy and dependencies

~/miniconda3/envs/snappy/bin/pip install esa-snappy numpy

5. Configure the SNAP–Python bridge

/Applications/esa-snap/bin/snappy-conf ~/miniconda3/envs/snappy/bin/python

Note: The command may hang after completing successfully. Press Ctrl+C and answer n when asked to abort.

6. Verify the installation

~/miniconda3/envs/snappy/bin/python scripts/test_snappy.py

You should see output confirming esa_snappy and snapista are working, along with available GPT operators. JAI registry and SLF4J warnings are normal and can be ignored.

Usage

Activate the environment before working:

source ~/miniconda3/bin/activate snappy

Quick import check

import esa_snappy
from esa_snappy import ProductIO

product = ProductIO.readProduct("data/input/my_product.dim")
print(product.getName(), product.getSceneRasterWidth(), product.getSceneRasterHeight())

Running a GPT graph with snapista

from snapista import Graph, Operator

g = Graph()
g.add_node(Operator("Read", file="data/input/my_product.zip"))
g.add_node(Operator("Calibration"), "Read")
g.add_node(Operator("Write", file="data/output/calibrated.dim", formatName="BEAM-DIMAP"), "Calibration")
g.run()

Key Paths

Component Location
SNAP installation /Applications/esa-snap
Conda environment ~/miniconda3/envs/snappy
Python executable ~/miniconda3/envs/snappy/bin/python
SNAP config ~/.snap
esa_snappy logs ~/.snap/system/var/log/messages.log

Resources

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages