kanglcn/moraine
关于
Modern Radar Interferometry Environment; A simple, stupid InSAR postprocessing tool in big data era
人工智能与机器学习可以做什么
- 📡 PS and DS: amplitude dispersion, statistically homogeneous pixels by a Kolmogorov-Smirnov test, coherence matrices, and EMI phase linking with an adaptive regularization of the matrices that are not positive definite.
- 🧠 Deep learning filters: Noise2Fringe (n2f) for raster interferograms and the Noise2Fringe Transformer (n2ft) for point clouds, trained models run with PyTorch.
- 🌀 Phase unwrapping: minimum cost flow on a Delaunay network of the points, EMCF on any network of image pairs, unwrapping errors corrected by phase closure; moraine's own code, no GAMMA needed.
- ⚡ CPU and GPU: numba kernels on the CPU cores, numba.cuda kernels on one or several GPUs; most API functions take numpy or cupy arrays and return the same kind.
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文moraine
Modern Radar Interferometry Environment
InSAR post-processing for the big data era: persistent and distributed scatterers, phase linking, deep learning
filters and phase unwrapping, on GPUs, on arrays you can read, with a command line that AI agents speak.
Manual · 中文手册 · Install · Workflows · Tutorials · Python API · Changelog
![]() |
![]() |
| Interferogram 2019-01-02 / 2021-12-29 of the refined PS and DS: about ten fringes of the caldera uplift, centred on Pozzuoli |
Line of sight displacement (mm), 2019-01-02 to 2021-12-29: the uplift of Pozzuoli, towards the satellite |
Campi Flegrei (Italy), Sentinel-1 descending track 22, 92 dates from 2019 to 2021: quicklooks of the verified example pipelines.
moraine takes co-registered SAR images (GAMMA results) to deformation time series: it selects persistent and distributed scatterers, links their phases, filters them with deep learning, unwraps them and computes line of sight displacements. It is a collection of functions rather than a fixed workflow, made for data larger than memory and for GPUs, with a command line that people, scripts and AI agents can drive. It is under active development (alpha): the API can change between versions, as the changelog records.
✨ Highlights
- 📡 PS and DS: amplitude dispersion, statistically homogeneous pixels by a Kolmogorov-Smirnov test, coherence matrices, and EMI phase linking with an adaptive regularization of the matrices that are not positive definite.
- 🧠 Deep learning filters: Noise2Fringe (
n2f) for raster interferograms and the Noise2Fringe Transformer (n2ft) for point clouds, trained models run with PyTorch. - 🌀 Phase unwrapping: minimum cost flow on a Delaunay network of the points, EMCF on any network of image pairs, unwrapping errors corrected by phase closure; moraine's own code, no GAMMA needed.
- ⚡ CPU and GPU: numba kernels on the CPU cores, numba.cuda kernels on one or several GPUs; most API functions take numpy or cupy arrays and return the same kind.
- 📦 Larger than memory: zarr on disk, processed chunk by chunk by moraine's own workers; designed for tens of millions of points and stacks of hundreds of images.
- 🔁 Pipelines that resume: a processing chain is a TOML file; a rerun skips the steps whose arguments and inputs did not change and reruns everything downstream of a change.
- 📖 Self-documenting commands: every
moraine.clifunction is amorainecommand whose help (shapes, dtypes, units, defaults) is generated from its docstring;--jsonprints one JSON object for scripts and agents. - 🔍 Checks without plotting code: statistics and anomaly warnings of a result (
moraine info), PNG quicklooks (moraine quicklook) and notebooks of interactive maps (moraine view) with time series, polygons and 3D views over the terrain. - 🤖 Agent ready: AGENTS.md tells coding agents how to run and check the processing; you describe the data, the agent runs the verified pipelines and reports.
🧭 Design principles
Adapted from the principles of Arch Linux.
- Simplicity: no complex data structures, no over-encapsulation. Data are numpy or cupy arrays in memory and zarr arrays on disk; every result is an array that any tool can open. Instead of a standard workflow like StaMPS or MintPy, moraine is a collection of functions, each implementing one InSAR technique, and the data infrastructure around them.
- Modernity: state-of-the-art techniques (PS / DS selection, phase linking, deep learning filters) and the performance the big data era needs: numba on the CPU cores, numba.cuda on GPUs, data larger than memory.
- Pragmatism: no workflow always gives a satisfactory result; decorrelation, atmosphere and strong deformation gradients defeat every fixed chain somewhere. moraine provides the building blocks and the user designs the workflow case by case.
- User centrality: moraine serves the needs of those who contribute to it rather than trying to appeal to as many users as possible. It is made for the proficient InSAR user, or anyone with a do-it-yourself attitude, who is willing to read the documentation and solve their own problems.
🛠️ The processing chain
Six example pipelines take GAMMA results to displacements. Each is run end to end on the sample data set and has a guide with the parameters to tune, the expected results and the checks.
| pipeline | what it does | main commands | |
|---|---|---|---|
| 01 | Load | GAMMA results to zarr: rslc stack, coordinates, look vectors, baselines, metadata | load-gamma-*, transform |
| 02 | PS | amplitude dispersion and Noise2Fringe temporal coherence | amp-disp, n2f, temp-coh |
| 03 | DS | statistically homogeneous pixels, coherence matrices, EMI phase linking, DS selection | shp-test, emperical-co-emi-temp-coh-pc |
| 04 | Refine | PS and DS merged, Noise2Fringe Transformer, temporal coherence | pc-union, n2ft, temp-coh |
| 05 | Unwrap | EMCF on a network of image pairs, phase closure correction | emcf-pc, unwrap-correct-closure-pc |
| 06 | Products | line of sight displacement in millimetres, troposphere from ERA5, reference area, DEM error, velocity, GeoPackage of the points for GIS software | pc-disp, download-era5, pc-tropo-era5, pc-reference, pc-sc-dem-error, pc-velocity, pc-export |
🚀 Quick start
pip install moraine # or: conda install -c conda-forge moraine
pip install 'moraine[dl]' # PyTorch, for the deep learning filters
python -c "import moraine; moraine.download_dl_model()" # the trained models, once
Everything runs on the CPU; for GPUs add cupy and numba-cuda for your CUDA version with conda, as the install guide explains. The example pipelines are in the repository:
git clone https://github.com/kanglcn/moraine.git && cd moraine
moraine run examples/01_load.toml --workdir WORK \
--var gamma=/path/to/gamma --var reference=YYYYMMDD --var geo=YYYYMMDD
moraine run examples/02_ps.toml --workdir WORK --var shape=NLINES,WIDTH # then 03 to 06, in order
moraine status examples/02_ps.toml --workdir WORK # the state; run a file again to resume it
moraine info WORK/ps/ras_adi_pyramid # statistics of a result, without loading it
moraine quicklook WORK/ps/ras_adi_pyramid -o adi.png # a picture of the whole scene
moraine view WORK/ps/ras_adi_pyramid -o view.ipynb # interactive maps in Jupyter or VS Code
Examples 02 to 04 run on a GPU (cuda = true): to run them on the CPU or to change a parameter, copy the file and edit
the copy. The workflow guides give the variables of every file, and the
tutorials run the same chain from Python.
🐍 The same from Python
import moraine as mr # arrays in memory: numpy on the CPU, cupy on the GPU
import moraine.cli as mc # zarr in, zarr out, chunk by chunk
ph = mr.emi(coh) # phase linking of a block of points
mc.emi('ds/ds_can_coh.zarr', 'ds/ds_can_ph.zarr', cuda=True) # the same for a whole data set, on the GPUs
mc.view('pc/pc_ph_pyramid', show='intf_seq') # an interactive map in a notebook
help(mr.emi), help(mc.emi) and moraine emi --help describe the same function.
🤖 Or ask a coding agent
process the GAMMA data in
/data/site_a(reference 20220620) up to unwrapping in/work/site_a
A coding agent working in the repository (Claude Code, Codex, Cursor, ...) reads AGENTS.md and the workflow guides, runs the verified pipelines, compares the results with the expected ranges, looks at the quicklooks and reports. The manual has a recorded session on the Campi Flegrei data set.
📚 Documentation
The manual is in English and 中文. Its main pages:
| page | what is there |
|---|---|
| Install | pip or conda, the GPU packages, the deep learning models, GAMMA |
| Concepts | the three layers, rasters and point clouds, chunks, pipelines, GPU or CPU |
| Checking results | pyramids, moraine info, moraine quicklook, moraine view |
| Workflows | the six example pipelines with their parameters, expected results and checks |
| Tutorials | the same chain as notebooks of moraine.cli calls with interactive maps |
| Command line, Python API | every command and function, generated from the docstrings: arguments, shapes, dtypes, defaults, examples |
| Theory | the principle of EMCF unwrapping and of the phase closure correction |
| Talk to an agent | a recorded session of an AI agent processing a data set |
| Changelog, Roadmap | what changed, what is planned |
In the terminal, moraine list lists the commands and moraine COMMAND --help prints the reference of one.
🤝 Contributing
Bug reports and feature requests are welcome as issues, questions and ideas in the discussions, fixes, documentation and new methods as pull requests. Developing moraine explains how a change is discussed, made, validated and submitted, ARCHITECTURE.md maps the code and the design decisions say why it is built this way.
📜 License
moraine is free software under the GNU General Public License, version 3 or (at your option) any later version
(GPL-3.0-or-later). The trained deep learning models,
downloaded by moraine.download_dl_model(), are under
CC BY-NC-SA 4.0.
⭐ Star history
探索相关项目
加载中…

