Skip to content

conda environment setup on Linux / macOS for InSAR data processing

License

Notifications You must be signed in to change notification settings

yunjunz/conda-envs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

conda-envs

Setup InSAR data processing codes on Linux / macOS / Windows using conda environments.

1. Install conda

Install the Python environment with conda/mamba.

mkdir -p ~/tools; cd ~/tools
# for macOS, use Miniforge3-MacOSX-x86_64.sh, and optionally use `curl -L -O https://...` syntax to download
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash Miniforge3-Linux-x86_64.sh -b -p ~/tools/miniforge
~/tools/miniforge/bin/mamba init bash

Close and restart the shell for changes to take effect. Then install the following utilities:

mamba install wget git tree numpy --yes
pip install bypy

2. Install ISCE-2 and MintPy

Option 1: Install isce2 (conda version) and mintpy (conda version)

Both isce2 and mintpy are available on the conda-forge channel and can be install via mamba as:

mamba install isce2 mintpy

Add below in your source file, e.g. ~/.bash_profile for bash users or ~/.cshrc for csh/tcsh users:

export PATH=${PATH}:${ISCE_HOME}/bin:${ISCE_HOME}/applications  # ISCE_HOME/STACK are set by conda

Option 2: Install isce2 (conda version) and mintpy (development version)

a. Download source code
cd ~/tools
mkdir isce2; cd isce2
mkdir build install src; cd src
git clone https://github.com/isce-framework/isce2.git

cd ~/tools
git clone https://github.com/insarlab/MintPy.git
git clone https://github.com/insarlab/PyAPS.git
git clone https://github.com/insarlab/PySolid.git
git clone https://github.com/yunjunz/conda-envs.git

mkdir -p ~/tools/utils; cd ~/tools/utils
git clone https://gitlab.com/yunjunz/SSARA.git
git clone https://github.com/yunjunz/sardem.git
b. Install to insar environment
# create new environment
conda create --name insar --yes
conda activate insar

# install dependenciues and isce2
cd ~/tools
mamba install --file conda-envs/insar/requirements.txt --file MintPy/requirements.txt isce2">=2.6.3" --yes

# install MintPy in editable mode
python -m pip install -e MintPy
# [for developers] overwrite PyAPS and PySolid installation from conda to the editable mode
python -m pip install -e PyAPS
export SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
python -m pip install -e PySolid

# install dependencies not available from conda
ln -s ${CONDA_PREFIX}/bin/cython ${CONDA_PREFIX}/bin/cython3
python -m pip install ipynb     # import functions from *.ipynb files
python -m pip install jupyter_nbextensions_configurator
python -m pip install -e utils/sardem
c. Setup

Create an alias load_insar in ~/.bash_profile file for easy activation, e.g.:

alias load_insar='conda activate insar; source ~/tools/conda-envs/insar/config.rc'
d. Test the installation

Run the following to test the installation:

load_insar               # warm up conda environment
topsApp.py -h            # test ISCE-2
smallbaselineApp.py -h   # test MintPy

Useful resources

About

conda environment setup on Linux / macOS for InSAR data processing

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages