Skip to content

SNAP input data

Zhang Yunjun edited this page Jul 29, 2019 · 10 revisions

Overview

SNAP is a popular application to process SAR data. It allows for the creation of all the required input data for Mintpy. Therefore if Mintpy can read this data it becomes possible to apply Multi-temporal InSAR and atmospheric correction to SNAP outputs. SNAP processing can be done manually, in command line, or using the SNAP python API allowing for automated scripts. However, Mintpy before only accepted files in formats not native to SNAP (gamma, isce h5 etc.) and an effort has now been made to start to integrate the outputs of SNAP directly into Mintpy for ease of processing.

This follows a different approach than the SNAP native PSI export with StaMPS. While direct StaMPS file output is supported from within SNAP, the MintPy approach is to instead try and read the SNAP .dim files directly without any additional tools required within SNAP. This makes it possible to generate input files in the native SNAP .dim file format and ingest it directly into MintPy and should work as long as the correct workflow has been followed.

This aims to make the world of open source Multi-temporal InSAR just a little bit more user friendly.

Workflow for creating input files

Notes

  • All required sensor / baseline data are written to the .dim during SNAP processing
  • Baseline attributes specifically is written during co-registration (SNAP back-geocoding) step.
  • All input files should contain all required metadata since each .dim file is parsed individually - this is why the DEM file is exported after co-registration
  • .dim files should only have one band
  • prep_snap.py was built and tested on data generated through the following workflow - more testing is required.

Workflow

This workflow makes it possible to work with an area of interest covered by any combination of Sentinel-1 bursts / swaths / slices. Should be done for entire redundant interferogram network of master and slave scenes.

  1. Read master and slave data
  2. Master and slave slice assembly (if required for sentinel-1)
  3. Master and slave Apply orbit file
  4. Master and slave Split product (extract relevant polarisation and subswaths)
  5. Following is done per subswath [IW1, IW2, IW3]
  • Back-geocoding co-registration
  • Enhanced spectral diversity (if more than one burst is present for Sentinel-1)
  • Interferogram generation
  • TOPSAR Deburst
  • Topo-phase removal
  • Goldstein phase filtering
  1. Merge subswath flattened, filtered interferogram products (if more than one swath was done)
  2. Subset by band and extract interferogram (This is the first MintPy input product - optional)
  3. Add elevation band to co-registered product (must be done here to capture baseline attribute data)
  4. Subset by band and extract only elevation band (This is the second MintPy input product)
  5. Generate Coherence
  6. Subset by band and extract coherence (This is the third MintPy input product)
  7. Snaphu export interferogram
  8. SNAPHU phase unwrapping (external program)
  9. Snaphu import and save unwrapped product (This is the fourth MintPy input product)
  10. Terrain correct all four Mintpy products
  11. Subset all four MintPy products by region - must be done after terrain correction to ensure identical extents.

Directory stucture

/interferograms
    /20190427_20190602
        /20190427_20190602_coh_tc.data
            /coh.img                                  #mintpy.load.corFile
            /coh.hdr
        20190427_20190602_coh_tc.dim
        /20190427_20190602_filt_int_sub_tc .data
            /filt_int.img                             #mintpy.load.intFile
            /filt_int.hdr
        20190427_20190602_filt_int_sub_tc.dim
        /20190427_20190602_unw_tc .data
            /filt_unw.img                             #mintpy.load.unwFile
            /filt_unw.hdr
        20190427_20190602_unw_tc.dim
    ...
/dem_tc.data 
    /dem.img                                          #mintpy.load.demFile
    /dem.hdr
dem_tc.dim
/mintpy

Example smallbaselineApp.cfg file

Note that the filepaths point toward the all the .img files that are found within the .data folders associated with the .dim files

mintpy.load.processor = snap
mintpy.load.unwFile = /home/interferograms/*_*/*_tc*.data/Unw_*.img
mintpy.load.corFile = /home/interferograms/*_*/*_tc*.data/coh_*.img
mintpy.load.demFile = /home/dem_tc.data/dem*.img

How to run

  • install Mintpy
  • Go to /home/ root directory
  • prepare smallbaselineApp.cfg file
  • run with python smallbaselineApp.py smallbaselineApp.cfg

Notes:

  • Only limited testing has been done on prep_snap.py. It is possible that different SNAP workflows would not create a .dim file properly readable by prep_snap.py. This is because prep_snap.py tries to extract attribute files from the .dim xml file using simple parsing which might be sensitive to different workflows. Script was developed on data prepared by the workflow detailed earlier using Python / SNAP / snappy.
  • So far it only accepts geocoded (SNAP terrain correction step) data - not in radar geometry. Although, this should be possible.
  • Only tested on Sentinel-1
  • No comparison / assessment has been done yet

Welcome

Software Design

Clone this wiki locally