Skip to content

Commit 5236e83

Browse files
committed
Merge branch 'dev_private' of github.com:TUDelftGeodesy/DePSI into dev_private
2 parents cf69f37 + e808423 commit 5236e83

File tree

7 files changed

+235
-33
lines changed

7 files changed

+235
-33
lines changed

.github/workflows/doc_deploy.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Deploy documentation when new release created
2+
3+
name: Deploy docs
4+
5+
on:
6+
release:
7+
types:
8+
- published
9+
10+
11+
jobs:
12+
build:
13+
name: Deploy docs
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout main
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
- name: Set up Python 3.12
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: "3.12"
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install .[docs]
27+
- name: Deploy docs
28+
run: mkdocs gh-deploy --force

README.md

+8-33
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,13 @@
1-
# DePSI
2-
This is the WIP repository for the Python version of DePSI *(), a Python package for inteferometric SAR processing. The software is inspired by the MATLAB version DePSI. In this repository, we implement classic DePSI algorithms and new InSAR developments in Python.
31

4-
## Installation for development
2+
# DePSI
53

6-
It is assumed that you have `mamba` installed. If not, you can find the installation instructions [here](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html). Other package managers like `conda` or `venv` can be used as well.
4+
DePSI (van Leijen, 2014) is an open source software for processing Persistent Scatterer Interferometry (PS-InSAR) data, originally implemented in MATLAB. From 2024, TUDelft and Netherlands eScience Center are collaborating to develop a Python version of DePSI, with recent advances in PS-InSAR.
75

8-
Clone this repository
96

10-
Then`cd` into it:
7+
## Developer Guide
118

12-
```bash
13-
cd DePSI
14-
```
9+
Please refer to the [Developer Guide](docs/dev_guide.md) for installation instructions, testing, and other development-related information.
1510

16-
Create a new conda environment (here we give an example name `depsi-dev`) with `mamba`.:
17-
18-
```bash
19-
mamba create -c conda-forge -n depsi-dev python=3.12
20-
```
21-
22-
Here we use Python 3.12 since we aim to support python 3.10 and above.
23-
24-
Activate the environment:
25-
26-
```bash
27-
mamba activate depsi-dev
28-
```
29-
30-
Install this package in development mode:
31-
32-
```bash
33-
pip install -e ".[dev,docs]"
34-
```
35-
36-
In the end, install the pre-commit hooks:
37-
```bash
38-
pre-commit install
39-
```
4011

4112
## Useful reading material
4213

@@ -49,3 +20,7 @@ pre-commit install
4920
Copyright (c) 2023 - 2025, Netherlands eScience Center & Delft University of Technology
5021

5122
Apache Software License 2.0
23+
24+
## References
25+
26+
[1] Van Leijen, Frederik Johannes. "Persistent scatterer interferometry based on geodetic estimation theory." (2014).

docs/api_reference.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## **Classification methods**:
2+
3+
::: depsi.classification
4+
options:
5+
show_root_heading: false
6+
show_source: true
7+
heading_level: 3
8+
9+
10+
## **IO methods**:
11+
12+
::: depsi.io
13+
options:
14+
show_root_heading: false
15+
show_source: true
16+
heading_level: 3
17+
18+
## **slc methods**:
19+
20+
::: depsi.slc
21+
options:
22+
show_root_heading: false
23+
show_source: true
24+
heading_level: 3

docs/dev_guide.md

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Developer Guide
2+
3+
## Installation guide
4+
5+
The Python implementation of DePSI is under development. At present you can only install it from the GitHub repository.
6+
7+
It is assumed that you have `mamba` installed. If not, you can find the installation instructions [here](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html). Other package managers like `conda` or `venv` can be used as well.
8+
9+
Clone this repository and `cd` into it:
10+
11+
```bash
12+
git clone git@github.com:TUDelftGeodesy/DePSI.git
13+
cd DePSI
14+
```
15+
16+
Create a new conda environment (here we give an example name `depsi-dev`) with `mamba`.:
17+
18+
```bash
19+
mamba create -c conda-forge -n depsi-dev python=3.12
20+
```
21+
22+
Here we use Python 3.12 since we aim to support python 3.10 and above.
23+
24+
Activate the environment:
25+
26+
```bash
27+
mamba activate depsi-dev
28+
```
29+
30+
Install this package in development mode, with extra dependencies for development and documentation:
31+
32+
```bash
33+
pip install -e ".[dev,docs]"
34+
```
35+
36+
In the end, install the pre-commit hooks, which will run the checks before each commit:
37+
```bash
38+
pre-commit install
39+
```
40+
41+
## Linting and formatting
42+
43+
We use `ruff` for linting and formatting. If the pre-commit hooks are installed, the checks will be run automatically before each commit.
44+
45+
To manually run the checks, use the following command in the root directory of the repository:
46+
47+
```bash
48+
ruff check .
49+
```
50+
51+
## Testing
52+
53+
We use `pytest` for testing. All tests are located in the `tests` directory.
54+
55+
To run the tests, use the following command in the root directory of the repository:
56+
57+
```bash
58+
pytest tests
59+
```
60+
61+
The [GitHub Actions](https://github.com/TUDelftGeodesy/DePSI/blob/main/.github/workflows/build.yml) will run the tests automatically for each push and pull-request
62+
on the `main` branch.
63+
64+
## Documentation
65+
66+
We use `mkdocs` for documentation.
67+
68+
To check the documentation at local, use the following command in the root directory of the repository:
69+
70+
```bash
71+
mkdocs serve
72+
```
73+
74+
This will build and render the documentation at a local server. Follow the link provided in the terminal to view the documentation in the browser.
75+
76+
## Parallelization
77+
78+
We use `dask` in many functions for delayed computation and parallelization. Since DePSI operates with Xarray, in most cases, we us Xarray's interface with Dask Arrays, such as `xarray.apply_gufunc` or `xarray.map_blocks` to perform parallel computation. Please refer to the [Xarray Tutorial of Parallelizing Custom Functions](https://tutorial.xarray.dev/advanced/parallel-intro.html) as the best practices for implementing parallelization in DePSI.

docs/index.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# DePSI: Delft PS-InSAR processing package
2+
3+
DePSI (van Leijen, 2014) is an open source software for processing Persistent Scatterer Interferometry (PS-InSAR) data, originally implemented in MATLAB. From 2024, TUDelft and Netherlands eScience Center are collaborating to develop a Python version of DePSI, with recent advances in PS-InSAR.
4+
5+
For the stable version of DePSI implemented in MATLAB, please refer to the [stable branch](https://github.com/TUDelftGeodesy/DePSI/tree/stable).
6+
7+
## Installation
8+
9+
The Python implementation of DePSI is under development. At present you can only
10+
install it from the GitHub repository:
11+
12+
`pip install git+https://github.com/TUDelftGeodesy/DePSI.git@main`
13+
14+
## References
15+
16+
[1] Van Leijen, Frederik Johannes. "Persistent scatterer interferometry based on geodetic estimation theory." (2014).

docs/usages/slc.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SLC related methods
2+
3+
## Converting coregistered interferogram stack to SLC stack
4+
5+
After reading the coregistered interferogram stack and the mother SLC with `sarxarray`, the SLC stack can be reconstructed using the [`ifg_to_slc`](https://tudelftgeodesy.github.io/DePSI/api_reference/#depsi.slc.ifg_to_slc) method. The method takes the mother SLC and the coregistered interferogram stack as input and returns the reconstructed SLC stack.
6+
7+
```python
8+
import sarxarray
9+
from depsi.slc import ifg_to_slc
10+
from pathlib import Path
11+
12+
f_mother_slc = 'path/to/mother_slc.raw' # Path to the mother SLC binary file
13+
f_ifgs = list(sorted(Path('dir_ifgs').rglob("2*/ifnteferogram.raw"))) # List of paths of coregistered interferograms
14+
shape = (10768, 40588) # Shape of the stack, (nrows, ncols)
15+
reading_chunks = (2000, 2000) # Reading chunks for lazy loading, (nrows, ncols)
16+
17+
# Lazy loading mother SLC and ifg stack
18+
mother = sarxarray.from_binary([f_mother_slc], shape, dtype=np.complex64, chunks=reading_chunks)
19+
ifgs = sarxarray.from_binary(f_ifgs, shape, dtype=np.complex64, chunks=reading_chunks)
20+
21+
# Generate reconstructed SLCs
22+
slc_recon = ifg_to_slc(mother, ifgs)
23+
```

mkdocs.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
site_name: "DePSI: Delft PS-InSAR processing package"
2+
repo_url: https://github.com/TUDelftGeodesy/DePSI
3+
repo_name: DePSI
4+
5+
nav:
6+
- Getting started:
7+
- About DePSI: index.md
8+
- Usage:
9+
- SLC methods: usages/slc.md
10+
- API Reference: api_reference.md
11+
- Developer Guide: dev_guide.md
12+
13+
14+
theme:
15+
name: material
16+
palette:
17+
# Palette toggle for light mode
18+
- scheme: default
19+
toggle:
20+
icon: material/weather-sunny
21+
name: Switch to dark mode
22+
primary: blue
23+
accent: white
24+
25+
# Palette toggle for dark mode
26+
- scheme: slate
27+
toggle:
28+
icon: material/weather-night
29+
name: Switch to light mode
30+
primary: black
31+
accent: pink
32+
features:
33+
- navigation.instant
34+
- navigation.tabs
35+
- navigation.tabs.sticky
36+
- content.code.copy
37+
38+
plugins:
39+
- mkdocs-jupyter:
40+
include_source: True
41+
- search
42+
- mkdocstrings:
43+
handlers:
44+
python:
45+
options:
46+
docstring_style: numpy
47+
docstring_options:
48+
ignore_init_summary: no
49+
merge_init_into_class: yes
50+
show_submodules: no
51+
52+
markdown_extensions:
53+
- pymdownx.highlight:
54+
anchor_linenums: true
55+
- pymdownx.superfences
56+
57+
extra:
58+
generator: false

0 commit comments

Comments
 (0)