Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -39,7 +39,7 @@ jobs:
echo "MINTPY_VERSION=$(git describe --tags)" >> $GITHUB_ENV

- name: Build, tag, and push image to Github Container Registry
uses: docker/build-push-action@v6
uses: docker/build-push-action@v7
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-n-publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
--outdir dist/
.

- uses: actions/upload-artifact@v6
- uses: actions/upload-artifact@v7
with:
path: |
dist/*.tar.gz
Expand All @@ -54,7 +54,7 @@ jobs:
if: github.repository_owner == 'insarlab' && github.event_name == 'push'
steps:

- uses: actions/download-artifact@v7
- uses: actions/download-artifact@v8
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
exclude: tests/data/

- repo: https://github.com/PyCQA/isort
rev: "7.0.0"
rev: "8.0.1"
hooks:
- id: isort
name: sort imports
Expand Down
32 changes: 16 additions & 16 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
[![License](https://img.shields.io/badge/license-GPLv3+-blue.svg?style=flat-square)](https://github.com/insarlab/MintPy/blob/main/LICENSE)
[![Citation](https://img.shields.io/badge/doi-10.1016%2Fj.cageo.2019.104331-blue?style=flat-square)](https://doi.org/10.1016/j.cageo.2019.104331)

## MintPy ##
## MintPy

The Miami INsar Time-series software in PYthon (MintPy as /mɪnt paɪ/) is an open-source package for Interferometric Synthetic Aperture Radar (InSAR) time series analysis. It reads the stack of interferograms (coregistered and unwrapped) in [ISCE](https://github.com/isce-framework/isce2), [ARIA](https://github.com/aria-tools/ARIA-tools), [FRInGE](https://github.com/isce-framework/fringe), [HyP3](https://hyp3-docs.asf.alaska.edu/), [GMTSAR](https://github.com/gmtsar/gmtsar), [SNAP](http://step.esa.int/), [GAMMA](https://www.gamma-rs.ch/gamma-software) or ROI_PAC format, and produces three dimensional (2D in space and 1D in time) ground surface displacement in line-of-sight direction. It includes a routine time series analysis (`smallbaselineApp.py`) and some independent toolbox.

This package was called PySAR before version 1.1.1. For version 1.1.2 and onward, we use MintPy instead.

This is research code provided to you "as is" with NO WARRANTIES OF CORRECTNESS. Use at your own risk.

### 1. [Installation](./installation.md) ###
### 1. [Installation](./installation.md)

### 2. Running MintPy ###
### 2. Running MintPy

#### 2.1 Routine workflow `smallbaselineApp.py` ####
#### 2.1 Routine workflow `smallbaselineApp.py`

MintPy reads a stack of interferograms (unwrapped interferograms, coherence and connected components from SNAPHU if available) and the geometry files (DEM, lookup table, incidence angle, etc.). You need to give the [path to where the files are](dir_structure.md) and MintPy takes care of the rest!

Expand All @@ -39,9 +39,9 @@ smallbaselineApp.py GalapagosSenDT128.txt --end load_data # end run after ste

Inside smallbaselineApp.py, it reads the unwrapped interferograms, references all of them to the same coherent pixel (reference point), calculates the phase closure and estimates the unwrapping errors (if it has been asked for), inverts the network of interferograms into time-series, calculates the temporal coherence to evaluate the quality of inversion, corrects local oscillator drift (for Envisat only), corrects stratified tropospheric delay (using global atmospheric models or phase-elevation-ratio approach), removes phase ramps (if it has been asked for), corrects DEM error,... and finally estimates the velocity.

Configuration parameters for each step are initiated with default values in a customizable text file [**smallbaselineApp.cfg**](../src/mintpy/defaults/smallbaselineApp.cfg).
Configuration parameters for each step are initiated with default values in a customizable text file [**smallbaselineApp.cfg**](https://github.com/insarlab/MintPy/blob/main/src/mintpy/defaults/smallbaselineApp.cfg).

#### [Example](./demo_dataset.md) on Fernandina volcano, Galápagos with Sentinel-1 data ####
#### [Example](./demo_dataset.md) on Fernandina volcano, Galápagos with Sentinel-1 data

```bash
wget https://zenodo.org/record/3952953/files/FernandinaSenDT128.tar.xz
Expand All @@ -67,20 +67,20 @@ save_kmz.py # generate Google Earth KMZ file in points or raster
save_kmz_timeseries.py # generate Google Earth KMZ file in points for time-series (interactive)
```

#### 2.2 Customized processing recipe ####
#### 2.2 Customized processing recipe

MintPy is a toolbox with individual utility scripts. Simply run the script with `-h / --help` to see its usage, you could build your own customized processing recipe! [Here](../scripts/compare_velocity_with_diff_tropo.sh) is an example to compare the velocities estimated from displacement time-series with different tropospheric delay corrections.
MintPy is a toolbox with individual utility scripts. Simply run the script with `-h / --help` to see its usage, and you can build your own customized processing recipe! [Here](https://github.com/insarlab/MintPy/blob/main/scripts/compare_velocity_with_diff_tropo.sh) is an example to compare the velocities estimated from displacement time-series with different tropospheric delay corrections.

#### 2.3 Build on top of `mintpy` module ####
#### 2.3 Build on top of `mintpy` module

MintPy is modulized in Python with utilities classes and functions and well commented in the code level. Users who are familiar with Python could build their own functions and modules on top of [`mintpy.objects`](../src/mintpy/objects) and [`mintpy.utils`](../src/mintpy/utils). However, we don't have a complete API document website yet (maybe you can contribute this!). Below is an example of reading the 3D matrix of displacement time-series from an HDF5 file.
MintPy is modularized in Python with utility classes and functions, and is well-commented at the code level. Users who are familiar with Python could build their own functions and modules on top of [`mintpy.objects`](https://github.com/insarlab/MintPy/tree/main/src/mintpy/objects) and [`mintpy.utils`](https://github.com/insarlab/MintPy/tree/main/src/mintpy/utils). However, we don't have a complete API document website yet (maybe you can contribute this!). Below is an example of reading the 3D matrix of displacement time-series from an HDF5 file.

```python
from mintpy.utils import readfile
ts_data, meta = readfile.read('timeseries_ERA5_ramp_demErr.h5')
```

### 3. [Documentation](https://mintpy.readthedocs.io/) ###
### 3. [Documentation](https://mintpy.readthedocs.io/)

Algorithms implemented in the software are described in details at [Yunjun et al. (2019)](https://doi.org/10.1016/j.cageo.2019.104331).

Expand All @@ -89,12 +89,12 @@ Algorithms implemented in the software are described in details at [Yunjun et al
+ [Example template files](./templates/README.md)
+ [Tutorials in Jupyter Notebook](https://github.com/insarlab/MintPy-tutorial)

### 4. Contact us ###
### 4. Contact us

+ Most development discussion happens on GitHub. Feel free to [open an issue](https://github.com/insarlab/MintPy/issues) or comment on any open issue or pull request.
+ Join our [user forum on google groups](https://groups.google.com/g/mintpy) or use [github discussions](https://github.com/insarlab/MintPy/discussions) to ask questions or leave comments.
+ Join our [user forum on Google Groups](https://groups.google.com/g/mintpy) or use [GitHub Discussions](https://github.com/insarlab/MintPy/discussions) to ask questions or leave comments.

### 5. Contributing ###
### 5. Contributing

**Imposter syndrome disclaimer:** We want your help. No, really.

Expand All @@ -108,8 +108,8 @@ For more information, please read our [contributing guide](./CONTRIBUTING.md).

_This disclaimer was adapted from the [MetPy project](https://github.com/Unidata/MetPy)._

### 6. Citing this work ###
### 6. Citing this work

Yunjun, Z., Fattahi, H., and Amelung, F. (2019), Small baseline InSAR time series analysis: Unwrapping error correction and noise reduction, _Computers & Geosciences_, _133_, 104331. [ [doi](https://doi.org/10.1016/j.cageo.2019.104331) \| [arxiv](https://doi.org/10.31223/osf.io/9sz6m) \| [data](https://doi.org/10.5281/zenodo.3464190) \| [notebook](https://github.com/geodesymiami/Yunjun_et_al-2019-MintPy) ]

In addition to the above, we recommend that you cite the original publications that describe the algorithms used in your specific analysis. They are noted briefly in the [default template file](../src/mintpy/defaults/smallbaselineApp.cfg) and listed in the [reference file](./references.md).
In addition to the above, we recommend that you cite the original publications that describe the algorithms used in your specific analysis. They are noted briefly in the [default template file](https://github.com/insarlab/MintPy/blob/main/src/mintpy/defaults/smallbaselineApp.cfg) and listed in the [reference file](./references.md).
6 changes: 3 additions & 3 deletions docs/dir_structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### ISCE / [topsStack](https://github.com/isce-framework/isce2/blob/main/contrib/stack/topsStack/README.md) ###

```
$DATA_DIR/GalapagosSenDT128
$DATA_DIR/Galapagos/S1_D128
├── baselines
│   ├── 20141213_20141225
│   │   └── 20141213_20141225.txt
Expand Down Expand Up @@ -111,7 +111,7 @@ mintpy.load.shadowMaskFile = $DATA_DIR/GalapagosSenDT128/merged/geom_reference
### ISCE / [stripmapStack](https://github.com/isce-framework/isce2/blob/main/contrib/stack/stripmapStack/README.md) ###

```
$DATA_DIR/KirishimaAlosAT424F620_630
$DATA_DIR/Kirishima/Alos_A424_F620_630
├── baselines
│   ├── 20060624_20060924.txt
│   ├── 20060624_20061225.txt
Expand Down Expand Up @@ -222,7 +222,7 @@ mintpy.load.shadowMaskFile = $DATA_DIR/KirishimaAlosAT424/geom_reference/shado
### ISCE / [alosStack](https://github.com/isce-framework/isce2/blob/main/contrib/stack/alosStack/alosStack_tutorial.txt) ###

```
$DATA_DIR/NCalAlos2DT169
$DATA_DIR/California/Alos2_D169
├── alosStack.xml
├── baseline
│   ├── baseline_center.txt
Expand Down
2 changes: 1 addition & 1 deletion src/mintpy/cli/prep_aria.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
prep_aria.py -t SanFranSenDT42.txt
prep_aria.py -s ../stack/ -d ../DEM/SRTM_3arcsec.dem -i '../incidenceAngle/*.vrt'
prep_aria.py -s ../stack/ -d ../DEM/SRTM_3arcsec.dem -i '../incidenceAngle/*.vrt' -a '../azimuthAngle/*.vrt' -w ../mask/watermask.msk
prep_aria.py -s ../stack/ -d ../DEM/SRTM_3arcsec.dem -i '../incidenceAngle/*.vrt' --set '../stack/setStack.vrt' --tropo '../stack/troposphereTotal/HRRR_stack.vrt' --iono '../stack/ionStack.vrt'
prep_aria.py -s ../stack/ -d ../DEM/SRTM_3arcsec.dem -i '../incidenceAngle/*.vrt' --set '../stack/setStack.vrt' --tropo '../stack/troposphereTotal/HRRRStack.vrt' --iono '../stack/ionStack.vrt'

# download / extract / prepare inteferograms stack from ARIA using ARIA-tools:
ariaDownload.py --track 71 --bbox "34.21 34.31 -118.60 -118.43" --start 20240101 --end 20240301
Expand Down
2 changes: 1 addition & 1 deletion src/mintpy/cli/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def create_parser(subparsers=None):
parser.add_argument('-l', '--lat', '--sub-lat', '--subset-lat', dest='subset_lat',
type=float, nargs=2, help='subset range in latitude')
parser.add_argument('-L', '--lon', '--sub-lon', '--subset-lon', dest='subset_lon',
type=float, nargs=2, help='subset range in column\n\n')
type=float, nargs=2, help='subset range in longitude\n\n')

parser.add_argument('-t', '--template', dest='template_file',
help='template file with subset setting. i.e. \n'
Expand Down
2 changes: 1 addition & 1 deletion src/mintpy/dem_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def correct_dem_error_patch(G_defo, ts_file, geom_file=None, box=None,
)

# assemble
delta_z[idx] = delta_z_i
delta_z[idx] = np.asarray(delta_z_i).reshape(-1).item()
ts_cor[:, idx] = ts_cor_i.flatten()
ts_res[:, idx] = ts_res_i.flatten()

Expand Down
2 changes: 1 addition & 1 deletion src/mintpy/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def diff_timeseries_and_velocity(file1, file2, out_file, max_num_pixel=2e8):
velo = readfile.read(file2, datasetName='velocity', box=box)[0]

if ref_val is not None:
print(f'* referencing velocity to y/x: {ref_y}/{ref_x} with value of {ref_val*100:.2f} cm/year')
print(f'* referencing velocity to y/x: {ref_y}/{ref_x} with value of {np.squeeze(ref_val)*100:.2f} cm/year')
velo -= ref_val

# calculate design matrix from the time-func file
Expand Down
6 changes: 5 additions & 1 deletion src/mintpy/prep_aria.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def extract_metadata(stack):
meta["FILE_LENGTH"] = ds.RasterYSize
meta["LENGTH"] = ds.RasterYSize
meta["ORBIT_DIRECTION"] = meta["orbitDirection"].upper()
meta["PLATFORM"] = "Sen"
meta["PLATFORM"] = meta.get("PLATFORM", "Sen") # provided by ARIA-tools since version 1.4.3 on Mar 2026
meta["WAVELENGTH"] = float(meta["Wavelength (m)"])
meta["WIDTH"] = ds.RasterXSize
meta["NUMBER_OF_PAIRS"] = ds.RasterCount
Expand Down Expand Up @@ -297,6 +297,10 @@ def write_geometry(outfile, demFile, incAngleFile, azAngleFile=None, waterMaskFi
# write
f['waterMask'][:,:] = water_mask

# apply mask to azimuthAngle after conversion factor
if azAngleFile is not None:
f['azimuthAngle'][:,:] *= water_mask

print(f'finished writing to HD5 file: {outfile}\n')
return outfile

Expand Down
Loading