Skip to content

TUDelftGeodesy/snap-coregistration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coregistration with SNAP

This repository contains material related to the coregistration of Sentinel-1 IW SLC products using the ESA SNAP software

Installing SNAP

Workstation

On local workstations, one can follow the regular SNAP installation procedure (via GUI): download and run the OS-specific installer from here.

The procedure also takes care of installing and configuring the Python interface to SNAP (esa-snappy), so that when the installation is completed no more steps should be taken.

It should be enough to follow the given instructions. Note that you can install esa-snappy in a virtual environment (as created using e.g. conda, venv, virtualenv). To do so you should provide the path to the environment where you want to install the package during the installation procedure. For more informations see here

Spider

SNAP is installed and made available as a module on Spider. Make sure you can load modules from /project/caroline/Software by running:

module use /project/caroline/Software/modulefiles

SNAP can be used after running:

module load snap/12.0.0
gpt -h  # test that the GPT command line tool is available

In order to install the Python interface to SNAP, it is best to create a Python environment using virtualenv:

module load python/3.10  # base environment on python 3.10
virtualenv venv
source venv/bin/activate

Install and configure esa-snappy as:

pip install esa-snappy
cd venv/lib/python3.10/site-packages/esa_snappy
python snappyutil.py --snap_home /project/caroline/Software/snap/12.0.0  --java_module /project/caroline/Software/snap/12.0.0/esasnappy/modules/eu-esa-snap-esa-snappy.jar --jvm_max_mem 32G --log_file ./snappyutil.log

In order to use esa-snappy, make sure all the required modules as well as the virtual environment are loaded:

module load snap/12.0.0
module load python/3.10
source venv/bin/activate

Troubleshooting for ARM64 architecture (assuming you are on MacOS)

If you are using an ARM64 architecture (e.g. Apple M1/M2), when importing esa_snappy you might encounter the following error:

OSError: dlopen(/SNAP_PATH/.install4j/jre.bundle/Contents/Home/lib/server/libjvm.dylib, 0x000A): tried: '/SNAP_PATH//.install4j/jre.bundle/Contents/Home/lib/server/libjvm.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))

This can be solved by manually configure the Java Home path of esa-snappy. To do this, first make sure your terminal is running with ARM64:

uname -m

We expect the output to be arm64. Then you can run the following script to find out the Java Home path:

/usr/libexec/java_home

This should return a path similar to: /Library/Java/JavaVirtualMachines/zulu-24.jdk/Contents/Home. Copy this path. This is the Java Home path you need to provide to esa-snappy.

Go to the package directory of esa-snappy. This directory is located in the Python environment where you installed esa-snappy. For example, if you installed it via conda, it might be in /opt/miniconda3/envs/YOUR_ENV/lib/python3.XX/site-packages/esa_snappy. We need the snappyutil.py script to perform the configuration.

cd /PATH/TO/esa_snappy

Then you can run the following command to configure esa-snappy:

python snappyutil.py --java_home /PATH/TO/JAVA_HOME

In this way, you can force esa-snappy to use the correct Java Home path, and importing esa_snappy in your Python environment should work. Note that when importing, you will still run into multiple warnings, but the functionality used in this repository should work fine.

SNAP-run

We have setup a Python command-line tool to facilitate running coregistration/interferogram tasks using SNAP, see tools/snap_run.

Examples

  • examples/gpt: Examples on using the SNAP Graph Processing Tool (GPT) to coregister and calculate the interferogram for two (or more) Sentinel-1 scenes.
  • examples/snap-run: Examples on using the Python command-line tool SNAP-run.

Resources

About

Material for Sentinel-1 IW SLC scene coregistration using ESA-SNAP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages