Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/insarlab/MintPy
13 September 2023, 20:02:44 UTC
  • Code
  • Branches (22)
  • Releases (7)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/aria_prep_corr
    • refs/heads/gui-qt
    • refs/heads/main
    • refs/heads/python2
    • refs/heads/sss_rerefGPS
    • refs/tags/v1.1.0
    • refs/tags/v1.1.1
    • refs/tags/v1.1.2
    • refs/tags/v1.2.0
    • refs/tags/v1.2.2
    • refs/tags/v1.2.3
    • refs/tags/v1.2alpha
    • refs/tags/v1.2beta
    • refs/tags/v1.3.0
    • refs/tags/v1.3.1
    • refs/tags/v1.3.2
    • refs/tags/v1.3.3
    • refs/tags/v1.4.0
    • refs/tags/v1.4.1
    • refs/tags/v1.5.0
    • refs/tags/v1.5.1
    • refs/tags/v1.5.2
    • v1.2.1
    • v1.0.0
    • v0.4.0
    • v0.3.0
    • v0.2.1
    • v0.2.0
    • v0.1.0
  • bf9c29f
  • /
  • docs
  • /
  • installation.md
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:031aa00312dbc67284ad91ca3e90a9756f829b3a
origin badgedirectory badge Iframe embedding
swh:1:dir:9265542cf4b0f1ad322c514b9a971b0260a69c54
origin badgerevision badge
swh:1:rev:db9dfa50924c6f7ff6a08f828791f968bbb5683a
origin badgesnapshot badge
swh:1:snp:7dbbee8e2e7831e633901c968a583c69b662c2df
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: db9dfa50924c6f7ff6a08f828791f968bbb5683a authored by Zhang Yunjun on 09 May 2019, 02:59:04 UTC
update comments (#60)
Tip revision: db9dfa5
installation.md
## Install PySAR ##

Tested on macOS and Linux, not sure about Windows.

### Notes for Mac users ###

Install Xcode with command line tools, if you have not already done so.

1. Install `Xcode` from App store

2. Install `command line tools` from within XCode and agree to the terms of license.

```
xcode-select --install -s /Applications/Xcode.app/Contents/Developer/ 
sudo xcodebuild -license 
```

3. Install [XQuartz](https://www.xquartz.org), then restart the terminal.

### 1. Setup Paths ###

To use the package, you need to setup the environment:

1. To make pysar importable in python, by adding the path to PySAR directory to your _$PYTHONPATH_    
2. To make utility scripts available in command line, by adding _${PYSAR_HOME}/pysar_ and _${PYSAR_HOME}/sh_ to your _$path_.   

Add to your **_~/.bash_profile_** file for _bash_ user:

```bash
############################  Python  ###############################
if [ -z ${PYTHONPATH+x} ]; then export PYTHONPATH=""; fi

##--------- PySAR ------------------##
export PYSAR_HOME=~/python/PySAR
export PYTHONPATH=${PYTHONPATH}:${PYSAR_HOME}
export PATH=${PATH}:${PYSAR_HOME}/pysar:${PYSAR_HOME}/sh

##--------- PyAPS ------------------## 
export PYAPS_HOME=~/python/PyAPS
export PYTHONPATH=${PYAPS_HOME}:${PYTHONPATH}
```

Source the file for the first time. It will be sourced automatically next time when you login. [Here](https://github.com/yunjunz/macOS_Setup/blob/master/cshrc.md) is an example _.cshrc_ file for _csh/tcsh_ user.

### 2. Install Python dependecies ###

PySAR is written in Python3 (3.5+) and relies on several Python modules, check the [requirements.txt](../requirements.txt) file for details. We recommend using [conda](https://conda.io/miniconda.html) or [macports](https://www.macports.org/install.php) to install the python environment and the prerequisite packages, because of the convenient managenment and default [performance setting with numpy/scipy](http://markus-beuckelmann.de/blog/boosting-numpy-blas.html) and [pyresample](https://pyresample.readthedocs.io/en/latest/installation.html#using-pykdtree).

#### Installing via conda ####

Add to your **_~/.bash_profile_** file:

```bash
export PYTHON3DIR=~/python/miniconda3
export PATH=${PATH}:${PYTHON3DIR}/bin
export PROJ_LIB=${PYTHON3DIR}/share/proj   #Temporary fix for basemap import error
```

Run the following in your terminal:

```
cd ~/python

# download PySAR
git clone https://github.com/insarlab/PySAR.git

# download PyAPS
mdkir -p PyAPS; cd PyAPS
git clone https://github.com/yunjunz/pyaps3.git

# install miniconda
wget https://repo.continuum.io/miniconda/Miniconda3-4.5.4-MacOSX-x86_64.sh
chmod +x Miniconda3-4.5.4-MacOSX-x86_64.sh
./Miniconda3-4.5.4-MacOSX-x86_64.sh -b -p $PYTHON3DIR

# install dependencies with conda
$PYTHON3DIR/bin/conda config --add channels conda-forge
$PYTHON3DIR/bin/conda install --yes --file $PYSAR_HOME/docs/conda.txt

# install pykml
$PYTHON3DIR/bin/pip install git+https://github.com/yunjunz/pykml.git
```

#### Installing via MacPorts ####

Install [macports](https://www.macports.org/install.php) if you have not done so. Add the following at the bottom of your **_~/.bash_profile_** file:

```bash
# MacPorts Installer addition on 2017-09-02_at_01:27:12: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:${PATH}
export MANPATH=/opt/local/share/man:${MANPATH}
# Finished adapting your PATH environment variable for use with MacPorts.

#For py36-pyhdf in macports
export INCLUDE_DIRS=/opt/local/include
export LIBRARY_DIRS=/opt/local/lib
```

Update the port tree with the following command. If your network prevent the use of rsync or svn via http of port tree, try [Portfile Sync via a Snapshot Tarball](https://trac.macports.org/wiki/howto/PortTreeTarball).

```
sudo port selfupdate
```

Run the following in your terminal in _bash_:

```bash
cd ~/python

# download PySAR
git clone https://github.com/insarlab/PySAR.git

# download PyAPS
mdkir -p PyAPS; cd PyAPS
git clone https://github.com/yunjunz/pyaps3.git

# install dependencies with macports
sudo port install $(cat $PYSAR_HOME/docs/ports.txt)

# install pykml
git clone https://github.com/yunjunz/pykml.git; cd pykml
python3 setup.py build
python3 setup.py install

# intall CDS API for PyAPS with ERA-5
wget https://github.com/ecmwf/cdsapi/archive/v0.1.4.tar.gz -O cdsapi-0.1.4.tar.gz
tar -xvf cdsapi-0.1.4.tar.gz; cd cdsapi-0.1.4
python3 setup.py build
python3 setup.py install

# install PyHDF for PyAPS with MERRA
git clone https://github.com/fhs/pyhdf.git; cd pyhdf
python3 setup.py build
python3 setup.py install
```

### Notes on [PyAPS](https://github.com/yunjunz/pyaps3) ###

+ We use PyAPS for tropospheric delay correction calculated from Global Atmospheric Models (GAMs) such as ERA-5, ERA-Interim, HRES-ECMWF, MERRA and NARR. 

+ Check [Caltech Earthdef](http://earthdef.caltech.edu) for accounts setup information for various GAM datasets.

+ If you defined an environment variable named `WEATHER_DIR` to contain the path to a 
directory, PySAR applications will download the GAM files into the indicated directory. Also PySAR
application will look for the GAM files in the directory before downloading a new one to prevent downloading
multiple copies if you work with different dataset that cover the same date/time.

### Notes on parallel processing ###

We use [Dask](www.dask.org) for parallel processing on High Performance Compute (HPC) cluster, it can be setup as below:

```
mkdir -p ~/.config/dask
cp $PYSAR_HOME/pysar/defaults/dask_pysar.yaml ~/.config/dask/dask_pysar.yaml
```

Edit `~/.config/dask/dask_pysar.yaml` file according to your HPC settings. Currently, only `LSFCluster` job scheduler is tested, `PBSCluster` should also work after minor adjustment in `ifgram_inversion.py`.

### Notes on pyKML ###

The pykml installed through conda/pip supports python2 only, the python2/3 compatible version is available [here](https://github.com/yunjunz/pykml.git) and installed throught the commands above by default.

### Notes on vim ###

[Here](https://github.com/yunjunz/macOS_Setup/blob/master/vim.md) is some useful setup of Vim editor for general use and Python.

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top