Installation

SARvey is a cross-platform python-based software and can be installed on

Linux

On Linux, SARvey can be installed Using Mamba (recommended) or Using Anaconda or Miniconda.

Using Anaconda or Miniconda

Using conda (latest version recommended), SARvey is installed as follows:

  1. Then clone the SARvey source code and install SARvey and all dependencies from the environment_sarvey.yml file:

    git clone https://github.com/luhipi/sarvey.git
    cd sarvey
    
  1. Create virtual environment for SARvey (optional but recommended):

    pip install conda-merge
    wget https://raw.githubusercontent.com/insarlab/MiaplPy/main/conda-env.yml
    conda-merge conda-env.yml tests/CI_docker/context/environment_sarvey.yml > env.yml
    conda env create -n sarvey -f env.yml
    rm env.yml conda-env.yml
    conda activate sarvey
    pip install git+https://github.com/insarlab/MiaplPy.git
    pip install .
    

MacOS ARM (Apple Silicon M2)

This guide provides instructions for installing SARvey on MacOS ARM M2 using conda. If you do not have Conda, install Conda for Mac. Using conda (latest version recommended), SARvey is installed as follows:

  1. Create a directory for the SARvey package and navigate to it in the terminal. You can choose any other directory if you prefer.

    mkdir -p ~/software/sarvey
    
  2. Install MiaplPy before installing SARvey in the same environment where you want to install SARvey.

    cd ~/software/sarvey
    git clone https://github.com/insarlab/MiaplPy.git
    cd MiaplPy
    

    1.1 Open conda-env.yml in an editor of your choice and comment out the line isce2. Alternatively, you can run the following command:.

    sed -i '' '/isce2/s/^/# /' conda-env.yml
    

    1.2 Install the package using Conda.

    conda env update --name sarvey --file conda-env.yml
    conda activate sarvey
    python -m pip install .
    
  3. Install SARvey

    2.1 Download the source code of the SARvey package.

    cd ~/software/sarvey
    git clone https://github.com/luhipi/sarvey.git
    cd sarvey
    

    2.2 Open tests/CI_docker/context/environment_sarvey.yml in an editor of your choice and comment out the lines isce2 and gcc_linux-64. Alternatively, you can run the following commands.

    sed -i '' '/isce2/s/^/# /' tests/CI_docker/context/environment_sarvey.yml
    sed -i '' '/gcc_linux-64/s/^/# /' tests/CI_docker/context/environment_sarvey.yml
    

    Note: As of the time of creation of this document, isce2 for MacOS ARM64 is not available in Conda repositories. Therefore, it is skipped, but it should not cause any problems for running SARvey. Also, gcc_linux-64 is not required on ARM64.

    2.3 Install SARvey using the same environment that you used to install MiaplPy.

    conda env update --name sarvey -f tests/CI_docker/context/environment_sarvey.yml
    conda activate sarvey
    pip install .
    
  4. Set up the PATH for MiaplPy and SARvey.

    3.1 Run the following commands to set up the path in ~/source_sarvey.sh.

    echo 'export miaplpy_path=~/software/sarvey/MiaplPy/src/' > ~/source_sarvey.sh
    echo 'export PYTHONPATH=${PYTHONPATH:+$PYTHONPATH:}$miaplpy_path' >> ~/source_sarvey.sh
    echo 'export sarvey_path=~/software/sarvey/sarvey' >> ~/source_sarvey.sh
    echo 'export PATH=${PATH}:sarvey_path:$sarvey_path/sarvey' >> ~/source_sarvey.sh
    echo 'export PYTHONPATH=${PYTHONPATH:+$PYTHONPATH:}:$sarvey_path' >> ~/source_sarvey.sh
    
  5. Test the installation

    4.1. Open a new terminal and activate the software.

    conda activate sarvey
    source ~/source_sarvey.sh
    

    4.2. Run the following commands. If the help messages of SARvey and MiaplPy are shown, the installation is correctly done.

    sarvey -h
    

Windows using WSL

On Windows, SARvey is tested on Windows Subsystem for Linux (WSL) version 2. Please follow the Linux installation.

Note

SARvey has been tested with Python 3.6+., i.e., should be fully compatible to all Python versions from 3.6 onwards.