Installation Guide๏ƒ

This guide provides detailed instructions for installing InSARLite and its dependencies.

Important

Supported Platform: InSARLite has been developed and tested exclusively on Ubuntu Linux (20.04 and 22.04).

Other operating systems have NOT been tested and are not officially supported. While InSARLite may work on other Debian-based distributions, we cannot guarantee compatibility or provide support for installation issues on untested platforms.

For the most reliable experience, we strongly recommend using Ubuntu 20.04 LTS or Ubuntu 22.04 LTS.

Platform Compatibility๏ƒ

โœ… Tested and Supported๏ƒ

  • Ubuntu 20.04 LTS (Primary testing platform)

  • Ubuntu 22.04 LTS (Primary testing platform)

โš ๏ธ Not Tested (Use at Your Own Risk)๏ƒ

  • Other Debian-based Linux distributions

  • RHEL/CentOS/Fedora

  • macOS

  • Windows Subsystem for Linux (WSL2)

โŒ Not Supported๏ƒ

  • Native Windows (GMTSAR cannot be compiled on Windows)

System Requirements๏ƒ

Minimum Requirements๏ƒ

  • Operating System: Ubuntu 20.04 LTS or Ubuntu 22.04 LTS

  • Python: 3.8 or higher

  • Memory: 8 GB RAM

  • Storage: 50 GB free space for SAR data processing

  • Display: GUI support (X11 for remote systems)

  • NASA Earthdata Account: Required for Sentinel-1 data downloads (Register here)

Dependencies๏ƒ

InSARLite has two types of dependencies: Python packages (installed automatically) and system dependencies (managed automatically when possible).

Python Dependencies (Automatic Installation)๏ƒ

These are installed automatically via pip:

Core Dependencies๏ƒ

  • numpy - Numerical computing

  • matplotlib - Plotting and visualization

  • tkinter - GUI framework (usually included with Python)

  • rioxarray - Geospatial raster data

  • xarray - Multi-dimensional arrays

InSAR-Specific Dependencies๏ƒ

  • asf_search - Alaska Satellite Facility data search

  • requests - HTTP library for data downloads

  • beautifulsoup4 - HTML/XML parsing

Geospatial Dependencies๏ƒ

  • shapely - Geometric operations

  • cartopy - Cartographic projections

  • basemap - Map plotting (Linux/macOS only)

Optional Dependencies๏ƒ

  • h5netcdf - NetCDF4 via h5py

  • dask - Parallel computing

  • scipy - Scientific computing

  • pandas - Data analysis

System Dependencies (Automatic Management)๏ƒ

InSARLite automatically manages its primary dependency:

GMTSAR (Automatic Installation)๏ƒ

GMTSAR is the core processing engine for InSAR analysis. InSARLite includes an automatic installation system that:

  • โœ… Detects existing installations on first startup

  • โœ… Prompts for automatic installation if not found

  • โœ… Handles system package dependencies (when sudo access available)

  • โœ… Downloads and compiles GMTSAR from source

  • โœ… Configures environment variables automatically

  • โš ๏ธ Provides manual instructions for restricted environments

Note

Automatic Installation: On first startup, InSARLite will check for GMTSAR and offer to install it automatically. This requires approximately 15-30 minutes and 2GB of disk space.

Warning

Sudo Access: Some system packages require administrator privileges. If you donโ€™t have sudo access, InSARLite will list the required packages for your system administrator to install.

Installation Methods๏ƒ

Method 2: Using conda๏ƒ

If you prefer conda, you can install the dependencies first:

# Create a new environment
conda create -n insarlite python=3.9

# Activate the environment
conda activate insarlite

# Install dependencies via conda
conda install -c conda-forge numpy matplotlib rioxarray xarray cartopy shapely

# Install InSARLite via pip
pip install insarlite

Method 3: Development Installation๏ƒ

For development or to get the latest features:

# Clone the repository
git clone https://github.com/mbadarmunir/InSARLite.git
cd InSARLite

# Install in development mode
pip install -e .

Platform-Specific Instructions๏ƒ

Linux (CentOS/RHEL/Fedora) - Experimental Support๏ƒ

# Install basic dependencies
sudo dnf install python3-pip python3-tkinter  # Fedora
# OR
sudo yum install python3-pip tkinter          # CentOS/RHEL

# Install InSARLite  
pip3 install insarlite

# Launch InSARLite (GMTSAR will be installed automatically)
python3 -c "import insarlite; insarlite.main()"

Warning

Experimental Support: The automatic GMTSAR installer is optimized for apt (Debian/Ubuntu). On RHEL-based systems, you may need to manually install some dependencies or work with your system administrator.

Note

Package Manager Differences: Some package names may differ on RHEL-based systems. If automatic installation fails, refer to the manual installation section.

macOS - Experimental Support๏ƒ

# Install Python via Homebrew (if not already installed)
brew install python

# Install basic geospatial dependencies
brew install gdal geos proj

# Install InSARLite
pip3 install insarlite

# Launch InSARLite (GMTSAR installation may require additional steps)
python3 -c "import insarlite; insarlite.main()"

Warning

Experimental Support: InSARLite has limited testing on macOS. Some features may not work as expected.

Warning

macOS GMTSAR Installation: Automatic GMTSAR installation on macOS may require additional configuration. You might need to install Xcode command line tools first: xcode-select --install

Windows Subsystem for Linux (WSL2) - For Windows Users Only๏ƒ

Warning

NOT OFFICIALLY SUPPORTED: WSL2 has not been tested with InSARLite. The following instructions are provided as-is for Windows users who wish to experiment, but we cannot guarantee functionality or provide support for WSL-specific issues.

Recommended approach: Use a native Ubuntu installation (dual-boot or virtual machine) for reliable operation.

Since GMTSAR cannot be installed on native Windows, Windows users may attempt to use WSL2:

  1. Install WSL2 with Ubuntu 20.04 or 22.04

  2. Follow the standard Ubuntu installation instructions above

  3. Configure X11 display forwarding for GUI support

  4. Be prepared for potential compatibility issues

For detailed WSL setup, consult Microsoftโ€™s WSL documentation.

Verification๏ƒ

After installation, verify that InSARLite is working correctly:

# Test the installation
python -c "import insarlite; print('InSARLite imported successfully')"

# Launch the GUI
InSARLiteApp

If the GUI opens without errors, the installation was successful!

GMTSAR Automatic Installation Workflow๏ƒ

InSARLite includes an intelligent automatic installation system for GMTSAR. This section demonstrates the installation process using a clean Ubuntu environment.

Note

Installation Screenshots: The following screenshots were captured on Ubuntu (in a clean environment without pre-installed dependencies). The same workflow applies to any Ubuntu 20.04+ or 22.04+ installation.

Step 1: First Launch - GMTSAR Not Found๏ƒ

When you launch InSARLite for the first time without GMTSAR installed:

insarlite

GMTSAR Not Found

Figure 1: First launch of InSARLite showing GMTSAR not detected. The main interface appears with a prompt asking if you would like to install GMTSAR. The terminal window shows the automatic detection process.

InSARLite automatically checks for GMTSAR and prompts you for installation. Click Yes to proceed.

Step 2: Select Installation Mode๏ƒ

Installation Modes

Figure 2: Installation mode selection dialog offering Full Installation (requires sudo access), Minimal Installation (no sudo required), or Cancel.

InSARLite offers two installation modes:

Minimal Installation๏ƒ

  • โœ… Attempts installation using existing system packages

  • โœ… No sudo access required

  • โœ… Provides detailed dependency list if packages are missing

  • โ„น๏ธ Best for systems where you donโ€™t have admin rights

  • โ„น๏ธ May require system administrator assistance

Select Full Installation for automatic setup.

Step 3: Orbit Files (Optional)๏ƒ

Orbit Files Prompt

Figure 3: Optional prompt to download and install Sentinel-1 precise orbit files. This step can speed up future processing but requires several GB of storage.

Precise orbit files improve SAR image georeferencing accuracy. Options:

  • Yes: Download complete orbit archive now (~4-5 GB, takes 20-40 minutes)

    • โœ… Enables offline processing

    • โœ… Faster processing (no download waits)

    • โš ๏ธ Requires significant storage

  • No: Download orbits as needed during processing (recommended)

    • โœ… Saves storage space

    • โœ… Only downloads required orbits

    • โ„น๏ธ Small delay during first use of each orbit

For this example, we selected No.

Step 4: Sudo Authentication๏ƒ

Sudo Password

Figure 4: Terminal requesting sudo password for Full Installation. The password is hidden for security (no characters displayed while typing).

For Full Installation, enter your administrator password when prompted. The password wonโ€™t be displayed as you type (this is normal Linux security behavior).

Step 5: Confirm Installation๏ƒ

Installation Confirmation

Figure 5: Final confirmation dialog summarizing selected options (Full Installation mode, without orbit files). Review and click Yes to proceed.

Review your selections:

  • Installation mode: Full

  • Orbit files: No (can be added later)

  • Sudo access: Confirmed

Click Yes to begin automatic installation.

Step 6: Installation Process๏ƒ

The installation process will:

  1. Install system dependencies (2-5 minutes)

    • csh, autoconf, gfortran, g++

    • libgmt-dev, libtiff-dev, libhdf5-dev, liblapack-dev

    • GMT (Generic Mapping Tools) and geographic datasets

  2. Clone GMTSAR repository (1-2 minutes)

    • Downloads GMTSAR 6.x source code from GitHub

  3. Configure and compile GMTSAR (10-20 minutes)

    • Runs autoconf to generate configuration

    • Compiles with parallel make (uses multiple CPU cores)

    • Builds all GMTSAR components

  4. Compile SBAS Parallel (1-2 minutes)

    • Compiles with OpenMP support for multi-threading

    • Links against GMTSAR, GMT, LAPACK, and BLAS libraries

    • Installs to user-accessible location

  5. Configure environment variables

    • Sets GMTSAR variable

    • Updates PATH in ~/.bashrc

    • Enables automatic detection on future launches

Note

Progress Monitoring: Watch the terminal window for detailed progress updates. The installation continues in the background while the dialog remains visible.

Step 7: Installation Complete๏ƒ

Installation Complete Dialog

Figure 6: Installation completion dialog informing the user to restart InSARLite for environment variables to take effect.

Once installation completes successfully, youโ€™ll see a completion message. Click OK.

Application Closing

Figure 7: Confirmation that InSARLite will close to allow environment variable updates to take effect.

InSARLite will automatically close to ensure environment variables are properly loaded. Click OK.

Terminal Success Status

Figure 8: Terminal showing successful installation with confirmation messages and environment configuration status.

The terminal confirms successful installation with:

  • โœ… All system dependencies installed

  • โœ… GMTSAR compiled and installed

  • โœ… SBAS parallel compiled

  • โœ… Environment variables configured

Step 8: Relaunch InSARLite๏ƒ

Close your terminal and open a new one to load the updated environment:

# Close current terminal
exit

# Open new terminal and launch InSARLite
insarlite

InSARLite will now launch with GMTSAR fully configured and ready for SAR processing.

Verification๏ƒ

Verify successful installation:

# Check GMTSAR installation
which gmtsar.csh
# Should output: /path/to/gmtsar/bin/gmtsar.csh

# Check SBAS parallel
which sbas_parallel
# Should output: /path/to/bin/sbas_parallel

# Check environment variable
echo $GMTSAR
# Should output: /path/to/gmtsar

# Launch InSARLite
insarlite
# Should open main interface without GMTSAR warnings

Manual GMTSAR Installation (Advanced Users)๏ƒ

If automatic installation fails or you prefer manual control, follow these steps:

# Install system dependencies
sudo apt update && sudo apt install -y \
    csh autoconf gfortran g++ \
    libtiff5-dev libhdf5-dev liblapack-dev \
    libgmt-dev gmt gmt-dcw gmt-gshhg

# Clone and build GMTSAR
cd /usr/local
sudo git clone --branch 6.6 https://github.com/gmtsar/gmtsar GMTSAR
cd GMTSAR
sudo autoconf
sudo ./configure --with-orbits-dir=/usr/local/orbits
sudo make -j$(nproc)
sudo make install

# Set environment variables
echo 'export GMTSAR=/usr/local/GMTSAR' >> ~/.bashrc
echo 'export PATH=$GMTSAR/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

Restricted Environment Setup๏ƒ

For systems without sudo access, ask your administrator to install:

# Required system packages
sudo apt install csh autoconf gfortran g++ libtiff5-dev \
                 libhdf5-dev liblapack-dev libgmt-dev gmt

Then GMTSAR can be installed to your home directory:

# Install to user directory
cd ~/
git clone --branch 6.6 https://github.com/gmtsar/gmtsar GMTSAR
cd GMTSAR
autoconf
./configure --prefix=$HOME/gmtsar --with-orbits-dir=$HOME/orbits
make -j$(nproc)
make install

# Add to environment
echo 'export GMTSAR=$HOME/GMTSAR' >> ~/.bashrc
echo 'export PATH=$GMTSAR/bin:$PATH' >> ~/.bashrc

Troubleshooting๏ƒ

Windows and WSL Issues๏ƒ

โ€œPlatform Not Supportedโ€ Error on Windows๏ƒ

Cause: InSARLite attempted to install GMTSAR on native Windows

Solution:

  1. Install WSL2 with Ubuntu: wsl --install -d Ubuntu-20.04

  2. Launch Ubuntu from Start Menu

  3. Install InSARLite inside WSL, not on Windows

GUI Not Appearing in WSL๏ƒ

Cause: Display server not configured

Solutions:

  • Windows 11: Update to latest version (WSLg should work automatically)

  • Windows 10: Install VcXsrv and configure DISPLAY variable:

    export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
    
  • Test display: Run xeyes or xcalc to verify X11 forwarding

WSL Performance Issues๏ƒ

Cause: Files stored on Windows filesystem

Solution:

  • Store data in WSL filesystem: /home/username/data/

  • Avoid Windows drives: /mnt/c/ (much slower)

โ€œCannot connect to X serverโ€ Error๏ƒ

Cause: X11 server not running or DISPLAY not set

Solutions:

  1. Install X11 tools in WSL:

    sudo apt install x11-utils x11-apps
    
  2. Check automatic DISPLAY configuration:

    # InSARLite automatically sets DISPLAY=:0 for WSL
    echo $DISPLAY
    source ~/.bashrc
    
  3. Manual DISPLAY configuration (if automatic setup fails):

    echo 'export DISPLAY=:0' >> ~/.bashrc
    source ~/.bashrc
    
  4. Install X11 server on Windows (VcXsrv or Xming)

InSARLite Issues๏ƒ

ImportError: No module named โ€˜tkinterโ€™๏ƒ

Solution: Install tkinter

# Ubuntu/Debian
sudo apt install python3-tk

# CentOS/RHEL/Fedora
sudo dnf install python3-tkinter

ModuleNotFoundError: No module named โ€˜cartopyโ€™๏ƒ

Solution: Install cartopy dependencies

# Linux
sudo apt install libproj-dev proj-data proj-bin libgeos-dev

# macOS
brew install proj geos

# Then reinstall
pip install cartopy

GMTSAR Installation Issues๏ƒ

Permission denied during installation๏ƒ

Cause: Insufficient permissions for system directories

Solution:

  • Use sudo for system installation, OR

  • Install to user directory (see Restricted Environment Setup above)

Compilation errors๏ƒ

Cause: Missing development tools or libraries

Solution: Install build essentials

sudo apt install build-essential cmake pkg-config

โ€œCommand not foundโ€ after installation๏ƒ

Cause: Environment variables not set

Solution: Update environment

source ~/.bashrc
# OR restart terminal

Missing orbit files๏ƒ

Cause: Orbit download failed during installation

Solution: Download manually

cd $GMTSAR
wget http://topex.ucsd.edu/gmtsar/tar/ORBITS.tar
tar -xf ORBITS.tar

General Issues๏ƒ

Memory errors during processing๏ƒ

Solution:

  • Increase system memory

  • Process smaller data subsets

  • Use data decimation options

Display issues on remote systems๏ƒ

Solution: Enable X11 forwarding

ssh -X username@hostname
# OR
ssh -Y username@hostname

Getting Help๏ƒ

If you encounter issues:

  1. Check the error message carefully

  2. Update your installation: pip install --upgrade insarlite

  3. Check dependencies: Ensure all required packages are installed

  4. Search existing issues: GitHub Issues

  5. Create a new issue: Include your OS, Python version, and full error message

Next Steps๏ƒ

After successful installation:

  1. Read the Quick Start Guide

  2. Follow the User Guide

  3. Try the Tutorials

Updating InSARLite๏ƒ

To update to the latest version:

pip install --upgrade insarlite

To check your current version:

import insarlite
print(insarlite.__version__)