Using StaMPS/MTI for PSI Analysis – Part 2: Pre-Processing with SNAP

Dear all,

we’re back for round two of PSI processing with StaMPS:

Define region of interest

A GeoJSON file (Simple Feature Access standard) describing the region of interest is needed. The easiest way to create a ROI polygon is by converting an existing Layer into a bounding box in QGIS (Vector / Research Tools / Extract Layer Extent) or by creating a new layer and manually mapping the ROI polygon:

  • Layer / Create Layer / New Shapefile Layer
  • Toggle Editing
  • Edit / Add Feature

Either way, results can be exported as GeoJSON via Export / Save Features As / GeoJSON. Keep in mind to choose EPSG:4326 (WGS84) as CRS when exporting.

Get SENTINEL-1 data

Download through Open Access Hub

Downloading a bulk of Sentinel images, either S1 or S2, is not very smooth if you use the GUI from the Open Access Hub. However, the sentinelsat Python package does provide a nice interface to the API:

from sentinelsat import SentinelAPI, read_geojson, geojson_to_wkt
api = SentinelAPI('username', 'password')
footprint = geojson_to_wkt(read_geojson('/path/to/roi.geojson'))
products = api.query(footprint,
                     platformname='Sentinel-1',
                     producttype='SLC',
                     orbitdirection='DESCENDING',
                     beginposition='[YYYY-MM-DDT00:00:00.000Z TO YYYY-MM-DDT00:00:00.000Z]',
                     sensoroperationalmode='IW',
                     polarisationmode='VV')
api.download_all(products, directory_path='/path/to/directory')

To see all options you can use to communicate with the server have a look at the sentinelsat documentation and the original API documentation of the data hub.

snap2stamps

General Information

This chapter is directly taken from the StaMPS-manual and the snap2stamps-manual.

StaMPS is compatible with the output generated by the ESA SentiNel Application Platform (SNAP) after the version 6.0. SNAP allows the user to define a series of xml files which contain user defined processing workflow by using its Graph Builder. These files can be used to run SNAP processing in batch mode by using the GPT command (Graph Processing Tool).

snap2stamps contains a set of graphs, together with python wrappers that allow you to automatise the interferogram processing chain for single master interferograms compatible with StaMPS PSI. Information about the provided functionalities and their instructions can be found in the user manual provided within snap2stamps, which already plans newer releases increasing functionality and compatibility maintenance of SNAP-StaMPS chain. A reference to the software package (Foumelis et al., 2018) can be found in the manual.

The following steps are needed and provided by snap2stamps:

  1. Sort the slave images in separated folders corresponding to their acquisition time.
  2. Slave splitting (and slice assembling if needed) and annotated orbits replacement with Precise/Restituted Orbits.
  3. Coregistration and interferogram generation done per slave and subswath. Here auxiliary files as DEMs and subset using a bounding box is performed. Both amplitude coregistered master-slave stack and interferogram with elevation and orthorectified latitude and longitude coordinates are saved as output.
  4. StaMPS export is done providing for each pair coregistered stack and interferogram generated StaMPS compatible products.

snap2stamps contains the following files:

  • project.conf – file with parameters and paths needed for the processing
  • slaves_prep.py – script for sorting slaves into the expected folder structure
  • splitting_slaves_logging.py – script for slave splitting (and assembling if needed) and orbit correction
  • coreg_ifg_topsar.py – script for master-slave coregistration and interferometric generation
  • stamps_export.py – script for ouput data generation in StaMPS compatible format for PSI processing

Note that snap2stamps requires Python 2.7.

snap2stamps Workflow

  • Select optimal master in SNAP using Radar / Interferometric / InSAR Stack Overview
  • Perform subsetting of whole image using TOPSAR Split via Radar / Sentinel-1 TOPS / S-1 TOPS Split. Set the processing parameters
    1. subswath (IW 1-3),
    2. polarization (vertical sent, vertical returned – VV), and
    3. bursts (using the bursts-slider)
      in the respective tab.
  • Get LAT/LON MIN/MAX (bounding box) for PSI area of interest.
    This can be obtained e.g. from ROI polygon in QGIS (Layer Properties / Metadata / Properties / Extent).
  • (To keep a backup, you might want to simply copy your snap2stamps bin and graphs folders to your working directory). Edit project.conf to set up the configuration for your project. An example configuration file might look like this:
  ######### CONFIGURATION FILE ######
  ###################################
  # PROJECT DEFINITION
  PROJECTFOLDER=/home/user/.../project
  GRAPHSFOLDER=/home/user/.../project/graphs
  ##################################
  # PROCESSING PARAMETERS
  IW1=IW2
  MASTER=/home/user/.../master/S1B_IW_SLC__1SDV_..._split.dim
  ##################################
  # AOI BBOX DEFINITION
  LONMIN=14.xx
  LATMIN=47.xx
  LONMAX=14.xx
  LATMAX=47.xx
  ##################################
  # SNAP GPT 
  GPTBIN_PATH=/usr/local/snap/bin/gpt
  ##################################
  # COMPUTING RESOURCES TO EMPLOY
  CPU=12
  CACHE=32G
  ##################################
  • Move the master (zip + TOPS – Split Output) to the directory master in your PROJECTFOLDER.
  • Make sure that all slave images (zip) are stored in the subfolder slaves in the PROJECTFOLDER.
  • Check if all libraries are available for your Python 2 installation (you might need to pip install pathlib). I strongly recommended to use a corresponding conda environment for Python 2.7: source activate snap2stamps.
  • Run the python scripts of snap2stamp directly in your shell:
  # slave sorting
  # (fast)
  python slaves_prep.py project.conf

  # slave splitting and orbit correction
  # (approx. 50 seconds per slave)
  python splitting_slaves.py project.conf

  # master-slave coregistration and interferometric generation
  # (approx. 180 seconds per slave)
  python coreg_ifg_topsar.py project.conf

  # ouput data generation in StaMPS compatible format
  # (approx. 30 seconds)
  python stamps_export.py project.conf
  • The data final output structure after performing the last step should contain these four folders: rslc, diff0, geo and dem within your INSAR_master_date folder.
  • Check for empty interferograms. If any exist, remove files containing the date of the empty file from the folders rslc and diff0. Otherwise, this will throw warnings related to 0 mean amplitude during the final preparation step use in stamps (i.e. mt_prep_snap) and eventually screw up the selection of PS candidates.
  • Prepare the data set for final use in StaMPS using mt_prep_snapwith <yyyymmdd> being the master date. The path after the date is the full filepath to the INSAR_master_date folder:
mt_prep_snap /home/username/…/INSAR_master_date/ DA
  • The amplitude dispersion index D_A is a value that describes the amplitude stability, which is used to preselect pixels and therefore reduces the number of pixels for the phase analysis. It is calculated as D_A = \frac{\sigma_A}{\mu_A}, where \sigma_A is the standard deviation and \mu_A is the mean of a series of amplitude values.
  • The recommended range for D_A is 0.4-0.42. The higher the threshold, more pixels will be selected for phase analysis. Note that surfaces like water and vegetation, where amplitude is instable, exhibit higher D_A values than bedrock outcroppings or man-made strucutres (i.e. most likeley PS pixels). See Ferretti et al. (2001) and Hooper et al. (2007) for further information. Additional arguments for mt_prep_snap are only needed for large areas (i.e. if multiple patches are processed).
  • Finally, launch matlab to continue with StaMPS PS analysis.

This is the basic processing chain for obtaining Sentinel-1 SLC data and preparing them for further use in StaMPS.

About This Author

Matthias studied Environmental Information Management at the University of Natural Resources and Life Sciences, Vienna. He is currently a PhD student in environmental statistics, working at ZAMG, the Austrian national weather and geophysical service. He currently focuses the (statistical) assessment of adverse weather events and natural hazards, and disaster risk reduction. His main interests are open source tools for data science, geoinformation and remote sensing

Post A Reply

*