SNAP2StaMPS v2: Using SNAP as InSAR processor for StaMPS
(Updated on 2023/09/20)
This repository and the included scripts call routines of the ESA SentiNel Application Platform (SNAP) to perform TOPSAR interferometric processing producing compatible inputs for the open-source StaMPS package.
The provided scripts with this SNAP to StaMPS package are not part of the SNAP software. The provided scripts are open-source contributions and should not be mistaken for official Applications within SNAP. The scripts are provided to you “as is” with no warranties of corrections.
This new provided package (SNAP2StaMPSv2) evolves from the initial SNAP2StaMPS package and was presented at FRINGE WORKSHOP 2023 in Leeds, September 2023 with zenodo doi 10.5281/zenodo.8362628.
Authors:
SNAP2StaMPS version 2 tries to collect feedback and it has been built to minimize issues from the user side due to package installation, or other dependencies due to software versioning, etc. Further, the new version supports the preprocessing of high-resolution TerraSAR-/TanDEM-X Stripmap data including and enhancing the TSX2Stamps package for the preparation of StaMPS PSI processing. TSX2Stamps uses a similar workflow as applied to Sentinel-1 TOPSAR data in the previous version of SNAP2StaMPS. The TSX2Stamps package is also freely available as standalone package for download on GitHub (https://github.com/jziemer1996/TSX2StaMPS). Please find below the general workflow of SNAP2StaMPS v2. For further information, please check the information given below or have a look at the tutorial provided within this repository.
This new version provides 2 different ways of using the package:
The scripts are hardcoded to use SRTM 1Sec HGT DEM which are automatically downloaded from the ESA STEP repository.
Note: Coregistration with DEM (Backgeocoding or DEM-Assisted-Coreg) or TopoPhaseRemoval might hang up if the SAR data footprint falls in areas where no valid SRTM1 tile exists. This might happen in areas near the Coastline. To avoid possible issues try to ensure SAR data footprints fall inside valid SRTM1 Sec tiles.
Note: Please note that the TSX2Stamps package was developed using an External DEM with a high spatial resolution (5m). For the processing of TSX stripmap data, we highly recommend using an External DEM with a higher spatial resolution than provided by SRTM to ensure the best possible quality for the ingestion in StaMPS.
Warning: If the user wants to use its own External DEM, please ensure it is in geotiff format with no data values as 0.0 and preprocessed using egm84 ellipsoid. Otherwise, ensure to adapt the parameters in the xml graphs accordingly.
Due to the integration of Stripmap data, the new SNAP2StaMPS package consists of two separate branches (SNAP2StaMPSv1 and TSX2Stamps) with two different config files (project_topsar.conf and project_stripmap.conf). Please spend some time understanding the (new) options available in the configuration files.
The new project configuration files include TAGS for newer options such as:
Since TSX/TDX data is not freely available, the download and auto-master selection is only available for Sentinel-1 data. Consequently, the configuration file of stripmap data comes without these parameters and is slightly different.
Note: The Sentinel-1 data download requires the provisioning of valid and registered credentials from ASF in the configuration file section [SEARCH_PARAMS] in ASF_USER and ASF_PASS. If needed, click here to register at the Alaska Satellite Facilities website
See below the detailed information that can be defined within the project_topsar.conf file:
################### TOPSAR CONFIGURATION FILE #############################
###########################################################################
[PROJECT_DEFINITION]
PROJECTFOLDER = /media/Storage/SNAP2stamps_test_small/
GRAPHSFOLDER = /home/jmdb/SNAPping/SNAP2stamps_v2/tmp/SNAP2stamps/graphs
###########################################################################
[PROC_OPTIONS]
# Y / N OPTIONS
OVERWRITE = N
SMARTHDD = Y
PLOTTING = Y
###########################################################################
[PROC_PARAMETERS]
# SENSOR : S1
SENSOR = S1
POLARISATION = VV
MASTER = /media/Storage/SNAP2stamps_test_small/Master/
# MASTER SELECTION : AUTO / FIRST / LAST / MANUAL
MASTERSEL = MANUAL
EXTDEM =
###########################################################################
[AOI_DEFINITION]
#AOI_MODE OPTIONS BBOX / SHP / KML / GeoJSON
AOI_MODE = SHP
LONMIN = 54.2
LATMIN = 24.36
LONMAX = 55.66
LATMAX = 25.42
AOI_FILE = /media/Storage/SNAP2stamps_test/aoi/aoi.shp
############################################################################
[SEARCH_PARAMS]
# autoDownload : Y / N
autoDownload = N
TRACK = 117
# beamMode : SLC / GRD
beamMode = SLC
# START/ STOP in YYYY-MM-DD
START = 2020-02-01
END = 2020-04-16
# SAT : S1 / S1A / S1B
SAT= S1A
ASF_USER =
ASF_PASS =
# Number of Parallel Downloads (NPD)
[SEARCH_PDOWNLOADS]
NPD = 4
############################################################################
[SNAP_GPT]
SNAP_INSTALLATION_FOLDER = /home/jmdb/anaconda/envs/SNAP2stamps/SNAP/
SNAP_HOME_DIR = /home/jmdb/anaconda/envs/SNAP2stamps/.SNAP
############################################################################
[COMPUTING_RESOURCES]
CPU = 8
CACHE = 16G
############################################################################
Note: Using the environment yml provided there is no need for additional installation of ESA SNAP
sudo apt update
sudo apt install git libfftw3 libgfortran #(Ubuntu 20.04)
sudo apt install fftw-dev gfortran #(Ubuntu 22.04)
git clone https://github.com/mdelgadoblasco/snap2stamps.git
conda env create -f snap2stamps_environment.yml
The user may choose to run:
python auto_run.py -F project_topsar.conf # for Sentinel-1 TOPSAR data
python auto_run.py -F project_stripmap.conf # for TSX Stripmap data
By running the above script the workflow may include the Sentinel-1 data download and the master selection according to the definition of the project_topsar.conf file. For TSX, these options are not available and the data download has to be done manually.
python asf_s1_downloader.py -F project.conf #[optional]
python topsar_step_0_secondaries_prep.py -F project.conf
python topsar_automaster.py -F project.conf -M AUTO #[optional]
python topsar_step_1_splitting_master_multi_IW.py -F project.conf
python topsar_step_2_splitting_secondaries.py -F project.conf
python topsar_step_3_coreg_ifg_topsar_smart.py -F project.conf
python topsar_step_4_plotting_all.py -F project.conf #[optional]
python topsar_step_5_stamps_export_multiIW.py -F project.conf
python stripmap_step_0a_unpack_sar_scenes.py -F project.conf
python stripmap_step_0b_secondaries_prep.py -F project.conf
python stripmap_step_1_subset_sar.py -F project.conf
python stripmap_step_1b_masterselection.py -F project.conf
python stripmap_step_2_coreg_sar.py -F project.conf
python stripmap_step_3_ifg_sar.py -F project.conf
python stripmap_step_4_plotting_all.py -F project.conf #[optional]
python stripmap_step_5_stamps_export.py -F project.conf
A new feature of this release is the plotting of the images resulting from subsetting, coregistration, and interferogram generation. To generate the plots run the following code by specifying the desired mode:
python auto_run.py -F project_topsar.conf -M split
python auto_run.py -F project_topsar.conf -M coreg
python auto_run.py -F project_topsar.conf -M ifg
The same applies to stripmap data by using the project_stripmap.conf file instead of topsar.
The team is open to new contributions, so don’t be shy and share them with the community.
We want to acknowledge:
For questions and inquiries, we want to promote the usage of the ESA STEP Forum that has been used very much until now.
CC BY-NC-SA: Creative Commons Attribution-NonCommercial-ShareAlike
This license lets others remix, adapt, and build upon your work non-commercially, as long as they credit you and license their new creations under the identical terms.