ISCE2 (Interferometric Synthetic Aperture Radar Scientific Computing Environment)

repository·main·Indexed 20 days ago

https://github.com/isce-framework/isce2

A framework for processing InSAR data from space-borne and air-borne satellite sensors. It includes PyCuAmpcor, a GPU-accelerated tool for amplitude cross-correlation used to estimate offsets between reference and secondary images. PyCuAmpcor supports both a command-line interface via cuDenseOffsets.py and a Python API for customized scripts, featuring coarse and fine-grained searches for sub-pixel precision.

Tokens
24.5K
Snippets
58
Records
82
Agent score
70%

What's inside isce2

  1. PyCuAmpcor: Amplitude Cross-Correlation with GPU

    main
    PyCuAmpcor is a GPU-accelerated tool for performing amplitude cross-correlation, typically used in InSAR processing to estimate offsets between reference and secondary images. It provides two main stages of correlation: an initial coarse search with a large range and a subsequent fine-grained oversampled search (zoom-in) to achieve sub-pixel precision.
  2. Available ISCE2 Stack Processors

    main

    ISCE2 provides three distinct stack processing workflows depending on your data source:

    • topsStack: Designed for Sentinel-1 TOPS (Terrain Observation with STatSAR) data.
    • stripmapStack: Designed for StripMap data.
    • alosStack: Designed for ALOS-2 data.

    Detailed documentation and tutorials for each are located within their respective subdirectories in the contrib/stack folder.

  3. Structure ISCE XML input files

    main

    ISCE uses XML documents for configuration. The structure relies on <component> and <property> tags.

    Key Concepts:

    • <component>: Represents a configurable part of the ISCE code. Names are case-insensitive. Components can contain nested components.
    • <property>: Defines a single variable value within a component. Names are case-insensitive.
    • <catalog>: Used to reference the contents of another XML file, allowing you to split large configurations into modular files.
    • <constant>: Defines a constant value that can be used as a variable (e.g., $dir$) within the XML.

    Example: Modular Configuration using <catalog>

    Main file (stripmapApp.xml):

    <stripmapApp>
        <component name="insar">
            <property name="Sensor name">ALOS</property>
            <component name="reference">
                <catalog>20070215.xml</catalog>
            </component>
            <component name="secondary">
                <catalog>20061231.xml</catalog>
            </component>
        </component>
    </stripmapApp>

    Referenced file (20070215.xml):

    <component name="Reference">
        <property name="IMAGEFILE">/path/to/image</property>
        <property name="LEADERFILE">/path/to/leader</property>
        <property name="OUTPUT">20070215</property>
    </component>
    <!-- Example of a full stripmapApp configuration -->
    <stripmapApp>
    <component name="stripmapApp">
        <property name="sensor name">ALOS</property>
        <component name="Reference">
            <property name="IMAGEFILE">/a/b/c/20070215/IMG-HH-ALPSRP056480670-H1.0__A</property>
            <property name="LEADERFILE">/a/b/c/20070215/LED-ALPSRP056480670-H1.0__A</property>
            <property name="OUTPUT">20070215</property>
        </component>
        <component name="Secondary">
            <property name="IMAGEFILE">/a/b/c/20061231/IMG-HH-ALPSRP049770670-H1.0__A</property>
            <property name="LEADERFILE">/a/b/c/20061231/LED-ALPSRP049770670-H1.0__A</property>
            <property name="OUTPUT">20061231</property>
        </component>
    </component>
    </stripmapApp>
  4. Configure the 'python3' executable convention

    main
    ISCE2 follows the convention of using python3 for Python 3.x. If your package manager (like Macports) does not automatically create a python3 executable, you should create a symbolic link on your PATH. This allows you to execute ISCE applications directly (e.g., ./stripmapApp.py) instead of specifying the full path to the Python interpreter.
  5. How to use catalog files in insarApp.xml

    main

    In ISCE2, the insarApp.py application uses an insarApp.xml input file to define processing parameters. To keep the main configuration file clean, you can use "catalogs"—external XML files that contain specific data for components like reference or secondary.

    When a <catalog> tag is used within a component in insarApp.xml, the contents of that catalog file (excluding its top-level root tag) are parsed and directly inserted into the main configuration. This allows you to reuse sensor-specific data structures (e.g., reference_alos.xml) across different projects.

    Usage Pattern

    1. Define your main insarApp.xml with <catalog> tags pointing to your external files.
    2. Create sensor-specific catalog files (e.g., reference_SENSOR.xml) containing the <component> definitions.
    3. Alternatively, you can use an "All-in-One" style where all properties are defined directly inside insarApp.xml without external references.
    <!-- insarApp.xml -->
    <insarApp>
        <component name="insar">
            <property name="Sensor name">ALOS</property>
            <component name="reference">
                <catalog>reference_alos.xml</catalog>
            </component>
            <component name="secondary">
                <catalog>secondary_alos.xml</catalog>
            </component>
        </component>
    </insarApp>
    
    <!-- reference_alos.xml -->
    <component name="Reference">
        <property name="IMAGEFILE">/<path-to-your-file>/IMG-HH-ALPSRP056480670-H1.0__A</property>
        <property name="LEADERFILE">/<path-to-your-file>/LED-ALPSRP056480670-H1.0__A</property>
        <property name="OUTPUT">20070215.raw</property>
    </component>
  6. Understand the PyCuAmpcor correlation workflow

    main

    PyCuAmpcor follows a multi-step procedure to estimate offsets:

    1. Coarse Window Loading: Loads a reference window and a larger secondary chip (sized by the search range) to allow for shifts.
    2. Initial Cross-Correlation: Computes a normalized correlation surface using either frequency or time domain algorithms. It finds the peak position and extracts statistics (SNR, variance) around it.
    3. Secondary Window Extraction: Extracts a smaller window from the secondary image centered around the initial peak position to prepare for oversampling.
    4. Window Oversampling: Both windows are oversampled (typically by a factor of 2) using FFT to prevent aliasing. For TOPSAR, the magnitude is used (derampMethod=0) to avoid issues with quadratic phase ramps.
    5. Fine Cross-Correlation: Performs correlation on the oversampled windows to produce a high-resolution correlation surface.
    6. Final Peak Detection: The correlation surface is further oversampled (using FFT or sinc), and the final offset is calculated using the formula: offset = (OffsetInit - halfSearchRange) + OffsetZoomIn / (oversamplingFactor * rawDataOversamplingFactor) Note: Users must manually add any pre-defined gross offsets to this result.
  7. How component configurability works in ISCE2

    main

    ISCE2 applications (like stripmapApp.py) are composed of multiple Component objects. Each component is configurable via XML files or command-line arguments.

    Component Naming Model

    Every configurable component has two identifiers used to locate configuration files:

    1. Family Name: A broad identifier shared by all instances of a specific class (e.g., the family name for stripmapApp.py is insar).
    2. Instance Name: A unique identifier for a specific instance of a component within an application (e.g., stripmapApp is an instance of the insar family).

    Configuration Priority (Layered Approach)

    ISCE2 uses a layered configuration system where higher-priority sources overwrite values from lower-priority sources. The priority sequence (from lowest to highest) is:

    1. Environment Variable (ISCEDB): XML files placed in the directory defined by the ISCEDB environment variable. Use this for global settings.
    2. Local Directory: XML files located in the directory where the application is executed.
    3. Command Line:
      • Arguments passed as XML filenames (e.g., stripmapApp.py myInput.xml).
      • Direct parameter overrides using the syntax family.instance.parameter=value (e.g., insar.reference.output=reference_c.raw).

    Within each location, files named after the family name are loaded first, and files named after the instance name are loaded second, overwriting the family-level settings.

    # Example of command line override (Highest Priority)
    stripmapApp.py insar.reference.output=reference_c.raw
  8. Optimize Doppler and azimuth FM rate polynomial orders

    main
    When processing ALOS-2 bursts, the Doppler and azimuth FM rate polynomials support up to 3rd order. However, it is recommended to use a smaller order if possible. Using a 3rd order polynomial can result in very large values when calculating (range sample number)^3, which may lead to significant floating-point errors during processing.
  9. Difference between catalog files and component configuration files

    main

    ISCE2 distinguishes between two types of XML configuration files:

    1. Catalog Files:

      • Referred to explicitly in the insarApp.xml using a <catalog> tag.
      • Can have any filename.
      • Their content is inserted into the component they are called from.
      • Priority: If a conflict exists between a catalog and a component configuration file, the catalog wins because it specifies both the application and the component.
    2. Component Configuration Files:

      • Found automatically by the ISCE framework if they follow specific naming conventions (defined in the top-level README.txt).
      • Do not need to be explicitly referenced in insarApp.xml.
      • They typically wrap their content in a single top-level tag (e.g., <insarApp>) to match the structure of the main application file.
  10. Run ISCE applications from the command line

    main

    You can execute ISCE applications (like stripmapApp.py) by passing an XML configuration file as an argument. If the $ISCE_HOME/applications directory is in your PATH, you can call the script directly. ISCE also attempts to find appropriately named input files in the local directory automatically.

    To see available options for a specific application, use the --help flag.

    # Using the full path
    $ISCE_HOME/applications/stripmapApp.py isceInputFile.xml
    
    # If applications is in your PATH
    stripmapApp.py isceInputFile.xml
    
    # Requesting help
    stripmapApp.py --help
  11. Build ISCE2 using Docker

    main

    You can build a Docker image for ISCE2 by cloning the repository and using the provided Dockerfiles. There are two versions available: a standard version and a CUDA-enabled version for GPU support.

    Standard Build

    Use the standard docker/Dockerfile to build the hysds/isce2:latest image.

    CUDA Build

    Use docker/Dockerfile.cuda to build the hysds/isce2:latest-cuda image if you require CUDA support.

    # Clone the repository
    git clone https://github.com/isce-framework/isce2.git
    cd isce2
    
    # Build the standard image
    docker build --rm --force-rm -t hysds/isce2:latest -f docker/Dockerfile .
    
    # Build the CUDA-enabled image
    docker build --rm --force-rm -t hysds/isce2:latest-cuda -f docker/Dockerfile.cuda .
  12. Prepare DEM for StripMap processing

    main
    1. Create a dedicated directory for the DEM.
    2. Use dem.py with the -a stitch option and specify the bounding box (lat/lon) of your study area to create an integer DEM.
    3. Retain only the following files: .dem.wgs84, .dem.wgs84.vrt, and .dem.wgs84.xml.
    4. Use fixImageXml.py to correct the file paths within the DEM's XML file.
    mkdir DEM; cd DEM
    dem.py -a stitch -b -37 -31 -72 -69 -r -s 1 -c
    rm demLat*.dem demLat*.dem.xml demLat*.dem.vrt
    cd ..