ISCE2 (Interferometric Synthetic Aperture Radar Scientific Computing Environment)
repository·main·Indexed 20 days ago
https://github.com/isce-framework/isce2A 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.
What's inside isce2
- 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.
Available ISCE2 Stack Processors
mainISCE2 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/stackfolder.Structure ISCE XML input files
mainISCE 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>Configure the 'python3' executable convention
mainISCE2 follows the convention of usingpython3for Python 3.x. If your package manager (like Macports) does not automatically create apython3executable, 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.How to use catalog files in insarApp.xml
mainIn ISCE2, the
insarApp.pyapplication uses aninsarApp.xmlinput 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 likereferenceorsecondary.When a
<catalog>tag is used within a component ininsarApp.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
- Define your main
insarApp.xmlwith<catalog>tags pointing to your external files. - Create sensor-specific catalog files (e.g.,
reference_SENSOR.xml) containing the<component>definitions. - Alternatively, you can use an "All-in-One" style where all properties are defined directly inside
insarApp.xmlwithout 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>- Define your main
Understand the PyCuAmpcor correlation workflow
mainPyCuAmpcor follows a multi-step procedure to estimate offsets:
- Coarse Window Loading: Loads a reference window and a larger secondary chip (sized by the search range) to allow for shifts.
- 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.
- Secondary Window Extraction: Extracts a smaller window from the secondary image centered around the initial peak position to prepare for oversampling.
- 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. - Fine Cross-Correlation: Performs correlation on the oversampled windows to produce a high-resolution correlation surface.
- 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.
How component configurability works in ISCE2
mainISCE2 applications (like
stripmapApp.py) are composed of multipleComponentobjects. 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:
- Family Name: A broad identifier shared by all instances of a specific class (e.g., the family name for
stripmapApp.pyisinsar). - Instance Name: A unique identifier for a specific instance of a component within an application (e.g.,
stripmapAppis an instance of theinsarfamily).
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:
- Environment Variable (
ISCEDB): XML files placed in the directory defined by theISCEDBenvironment variable. Use this for global settings. - Local Directory: XML files located in the directory where the application is executed.
- 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).
- Arguments passed as XML filenames (e.g.,
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- Family Name: A broad identifier shared by all instances of a specific class (e.g., the family name for
Optimize Doppler and azimuth FM rate polynomial orders
mainWhen 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.Difference between catalog files and component configuration files
mainISCE2 distinguishes between two types of XML configuration files:
Catalog Files:
- Referred to explicitly in the
insarApp.xmlusing 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.
- Referred to explicitly in the
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.
Run ISCE applications from the command line
mainYou can execute ISCE applications (like
stripmapApp.py) by passing an XML configuration file as an argument. If the$ISCE_HOME/applicationsdirectory is in yourPATH, 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
--helpflag.# 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 --helpBuild ISCE2 using Docker
mainYou 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/Dockerfileto build thehysds/isce2:latestimage.CUDA Build
Use
docker/Dockerfile.cudato build thehysds/isce2:latest-cudaimage 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 .Prepare DEM for StripMap processing
main- Create a dedicated directory for the DEM.
- Use
dem.pywith the-a stitchoption and specify the bounding box (lat/lon) of your study area to create an integer DEM. - Retain only the following files:
.dem.wgs84,.dem.wgs84.vrt, and.dem.wgs84.xml. - Use
fixImageXml.pyto 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 ..