Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12 documentation page #33

Merged
merged 50 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
078094f
rebase to renaming depsi to pydepsi
rogerkuou Dec 20, 2024
e61dd36
Add docs for nad block function
rogerkuou Sep 27, 2024
cf44ab1
add grapgh viz for dev dependency
rogerkuou Sep 27, 2024
8c3b38d
add option to persist computed variable
rogerkuou Sep 27, 2024
d595b2e
1. add nmad
rogerkuou Sep 30, 2024
cc1eb6d
drop multi index
rogerkuou Sep 30, 2024
fa68b35
add unit tests
rogerkuou Sep 30, 2024
7f030ad
update documentation
rogerkuou Sep 30, 2024
a35351b
add example script
rogerkuou Sep 30, 2024
3c4eb01
update example script
rogerkuou Oct 2, 2024
71d334d
Apply suggestions from code review
rogerkuou Oct 21, 2024
8c7441a
change input parameters
rogerkuou Oct 21, 2024
9aef1f8
update example script with new from_ds command in sarxarray
rogerkuou Oct 21, 2024
1c30153
Update examples/scripts/script_ps_selection.py
rogerkuou Oct 21, 2024
cb0af3b
Conformed to ruff checks.
Oct 16, 2024
cadd27c
Removed min_length argument from network.py
Oct 24, 2024
5f5f96c
Renamed groups to partitions in network.py
Oct 24, 2024
96d9c3a
Renamed max_links argument to min_links in network.py
Oct 24, 2024
be92083
Replaced prints on invalid network argumants by logger messages.
Oct 24, 2024
f591ad4
Removed comment about possible shorter implementation.
Oct 24, 2024
0b381a9
Added coordinates return to generate_arcs docstring.
Oct 24, 2024
67b4c9e
Added comment in get_distance to justify its existence.
Oct 24, 2024
ac3ea8b
Renamed network.get_distance to _get_distance
Oct 24, 2024
4ab76d3
based on Thijs's work, add unitest, merge chunks in the data file for…
rogerkuou Nov 15, 2024
8c4dc1a
Replaced network generation logging warnings by logging errors.
Nov 18, 2024
f3893f5
Updated GitHub action build
Nov 18, 2024
75cfe73
initial implementation of sparse subset
rogerkuou Oct 17, 2024
5435db7
add tests classification
rogerkuou Oct 21, 2024
87f3860
remove screen print
rogerkuou Oct 21, 2024
9b31516
more unit test
rogerkuou Oct 21, 2024
62b80e6
add depsi_processing script
rogerkuou Oct 21, 2024
8660b73
include network point selection in example script
rogerkuou Oct 21, 2024
e8fd86a
update processing script
rogerkuou Oct 21, 2024
25dd790
update processing script
rogerkuou Oct 21, 2024
5a9f283
formatting
rogerkuou Oct 22, 2024
c97e83c
update example script according to code review comments
rogerkuou Nov 12, 2024
58bb34a
fix typo
rogerkuou Nov 12, 2024
ddce7e6
add space coords in test
rogerkuou Nov 15, 2024
75ca933
use index for selection
rogerkuou Nov 15, 2024
20f114a
fix conflict
rogerkuou Dec 20, 2024
d2fc253
add api docs
rogerkuou Dec 20, 2024
a902977
Merge branch 'main' into 12_documentation_page
rogerkuou Dec 20, 2024
13e1cc8
Merge branch 'main' into 12_documentation_page
rogerkuou Dec 20, 2024
dcb25ae
add references to readme
rogerkuou Dec 23, 2024
74d738f
add slc usage example
rogerkuou Dec 23, 2024
10584ba
add doc deploy gh actions
rogerkuou Dec 23, 2024
ed17573
fix relative links
rogerkuou Dec 23, 2024
8bd7b8c
add parallelization to dev guide
rogerkuou Dec 23, 2024
3d78a19
Apply suggestions from code review
rogerkuou Jan 7, 2025
074409f
Apply suggestions from code review
rogerkuou Jan 7, 2025
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
28 changes: 28 additions & 0 deletions .github/workflows/doc_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Deploy documentation when new release created

name: Deploy docs

on:
release:
types:
- published


jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install .[docs]
- name: Deploy docs
run: mkdocs gh-deploy --force
42 changes: 8 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,11 @@
# DePSI
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.

## Installation for development
# DePSI

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.
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.

Clone this repository and `cd` into it:
## Developer Guide

```bash
git clone [email protected]:TUDelftGeodesy/DePSI.git
cd DePSI
```

Create a new conda environment (here we give an example name `depsi-dev`) with `mamba`.:

```bash
mamba create -c conda-forge -n depsi-dev python=3.12
```

Here we use Python 3.12 since we aim to support python 3.10 and above.

Activate the environment:

```bash
mamba activate depsi-dev
```

Install this package in development mode:

```bash
pip install -e ".[dev,docs]"
```

In the end, install the pre-commit hooks:
```bash
pre-commit install
```
Please refer to the [Developer Guide](docs/dev_guide.md) for installation instructions, testing, and other development-related information.

## Useful reading material

Expand All @@ -48,3 +18,7 @@ pre-commit install
Copyright (c) 2023 - 2025, Netherlands eScience Center & Delft University of Technology

Apache Software License 2.0

## References

[1] Van Leijen, Frederik Johannes. "Persistent scatterer interferometry based on geodetic estimation theory." (2014).
24 changes: 24 additions & 0 deletions docs/api_reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## **Classification methods**:

::: depsi.classification
options:
show_root_heading: false
show_source: true
heading_level: 3


## **IO methods**:

::: depsi.io
options:
show_root_heading: false
show_source: true
heading_level: 3

## **slc methods**:

::: depsi.slc
options:
show_root_heading: false
show_source: true
heading_level: 3
78 changes: 78 additions & 0 deletions docs/dev_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Developer Guide

## Installation guide

The Python implementation of DePSI is under development. At present you can only install it from the GitHub repository.

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.

Clone this repository and `cd` into it:

```bash
git clone [email protected]:TUDelftGeodesy/DePSI.git
cd DePSI
```

Create a new conda environment (here we give an example name `depsi-dev`) with `mamba`.:

```bash
mamba create -c conda-forge -n depsi-dev python=3.12
```

Here we use Python 3.12 since we aim to support python 3.10 and above.

Activate the environment:

```bash
mamba activate depsi-dev
```

Install this package in development mode, with extra dependencies for development and documentation:

```bash
pip install -e ".[dev,docs]"
```

In the end, install the pre-commit hooks, which will run the checks before each commit:
```bash
pre-commit install
```

## Linting and formatting

We use `ruff` for linting and formatting. If the pre-commit hooks are installed, the checks will be run automatically before each commit.

To manually run the checks, use the following command in the root directory of the repository:

```bash
ruff check .
```

## Testing

We use `pytest` for testing. All tests are located in the `tests` directory.

To run the tests, use the following command in the root directory of the repository:

```bash
pytest tests
```

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
on the `main` branch.

## Documentation

We use `mkdocs` for documentation.

To check the documentation at local, use the following command in the root directory of the repository:

```bash
mkdocs serve
```

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.

## Parallelization

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.
16 changes: 16 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# DePSI: Delft PS-InSAR processing package

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.

For the stable version of DePSI implemented in MATLAB, please refer to the [stable branch](https://github.com/TUDelftGeodesy/DePSI/tree/stable).

rogerkuou marked this conversation as resolved.
Show resolved Hide resolved
## Installation

The Python implementation of DePSI is under development. At present you can only
install it from the GitHub repository:

`pip install git+https://github.com/TUDelftGeodesy/DePSI.git@main`

## References

[1] Van Leijen, Frederik Johannes. "Persistent scatterer interferometry based on geodetic estimation theory." (2014).
23 changes: 23 additions & 0 deletions docs/usages/slc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# SLC related methods

## Converting coregistered interferogram stack to SLC stack

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.

```python
import sarxarray
from depsi.slc import ifg_to_slc
from pathlib import Path

f_mother_slc = 'path/to/mother_slc.raw' # Path to the mother SLC binary file
f_ifgs = list(sorted(Path('dir_ifgs').rglob("2*/ifnteferogram.raw"))) # List of paths of coregistered interferograms
shape = (10768, 40588) # Shape of the stack, (nrows, ncols)
reading_chunks = (2000, 2000) # Reading chunks for lazy loading, (nrows, ncols)

# Lazy loading mother SLC and ifg stack
mother = sarxarray.from_binary([f_mother_slc], shape, dtype=np.complex64, chunks=reading_chunks)
ifgs = sarxarray.from_binary(f_ifgs, shape, dtype=np.complex64, chunks=reading_chunks)

# Generate reconstructed SLCs
slc_recon = ifg_to_slc(mother, ifgs)
```
58 changes: 58 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
site_name: "DePSI: Delft PS-InSAR processing package"
repo_url: https://github.com/TUDelftGeodesy/DePSI
repo_name: DePSI

nav:
- Getting started:
- About DePSI: index.md
- Usage:
- SLC methods: usages/slc.md
- API Reference: api_reference.md
- Developer Guide: dev_guide.md


theme:
name: material
palette:
# Palette toggle for light mode
- scheme: default
toggle:
icon: material/weather-sunny
name: Switch to dark mode
primary: blue
accent: white

# Palette toggle for dark mode
- scheme: slate
toggle:
icon: material/weather-night
name: Switch to light mode
primary: black
accent: pink
features:
- navigation.instant
- navigation.tabs
- navigation.tabs.sticky
- content.code.copy

plugins:
- mkdocs-jupyter:
include_source: True
- search
- mkdocstrings:
handlers:
python:
options:
docstring_style: numpy
docstring_options:
ignore_init_summary: no
merge_init_into_class: yes
show_submodules: no

markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.superfences

extra:
generator: false
Loading