# How to Apply D-InSAR with python (not time-series such as SBAS)

I am trying to implement InSAR using Python.

While I’m studying the theory by referring to various resources, I’m planning to write actual code to understand each step of the process. I’d like to first try D-InSAR, the most fundamental type of InSAR, but I cannot find any resource dealing specifically with D-InSAR, hence I’m asking for help.

Is there a Python library that simply allows D-InSAR implementation, not PS-InSAR or SBAS?

Libraries like PyGMTSAR and Mintpy all mention SBAS, and they do not cover D-InSAR, which uses only two images, making them difficult to use as a reference. Rather than a complex time-series, I want to first try InSAR using just two images.

Of course, if you consider D-InSAR as simply the step of forming an interferogram, it could be part of the process of doing SBAS, but as a beginner, I’m not yet able to figure out how to separate the intermediate process, so I want to first try D-InSAR.

The D-InSAR process I’m attempting to try is identical to the Interferometry Tutorial provided by SNAP. Is there a Python package that allows me to follow this tutorial exactly?
(My goal is to analyze land subsidence with python)

You can use MintPY and only take images with 6/12/24/ X day of differences to make simple D-InSAR which will be less robust. That why SBAS is used to reduces the errors with unwrapping / interferogram formation

1 Like

Thank you for your response. @Clem.G

As far as I know, does MintPy not support the preprocessing stage for D-InSAR?
According to the link , although it’s for SBAS, it suggests applying MintPy after creating an InSAR stack using other tools.

Is this correct?

Dear gjustin,

D-InSAR is the “classical” method to compare two interferogram. If you want to doing time series like that :

1 +2, 2+3, 3+4 and divide by the mean of all the result you loose lot’s of information. That which SBAS technical was made.

If you want to steel doing like this you can take some images which have only 12 days to difference. The InSAR stack tools made with ISCE, Hyp3 you have some choice.

Cheers,
Clément

1 Like

you can read the code of snap(java) or isce(Fortran, C++，python wrapper). They use algorithms to do registration and generate interferogram from two dataset, which is what you want. But if you try to use python to write algorithms and generate interferogram, i do not recommed, it is slow. I recommand call python functions of isce2 and isce3, they alreadys use python to wrap their Fortran or C++ written functions

1 Like

Thank you for your response. @Clem.G

Actually, I would like to understand the principle of InSAR and learn how to implement it in Python. I believe that by grasping the basic principle of D-InSAR, which is more fundamental compared to advanced methods like PS or SBAS, it would be relatively easier to understand other methods.

I just found out that ISCE is a tool developed based on Python!
Looking at the codes, I think I can understand them to some extent.

Thank you for the information, @domino1989

@gjustin PyGMTSAR includes Sentinel-1 pre-processing scripts from GMTSAR project and interferogram processing, filtering, and so on realized on Python. SBAS analysis is based on a set of interferograms, of course. PS analysis utilizes SLC data files. See interactive Jupyter notebooks on Google Colab available in a single click on GitHub.

@domino1989 Python InSAR processing in PyGMTSAR is some times faster than C-coded GMTSAR InSAR. Obviously, Python can be much faster using the better algorithms. See the Docker image for 2 stitched Sentinel-1 scenes processing with 15m resolution in 16GB RAM Docker container. By the way, GMTSAR couldn’t process the case on 512 GB RAM workstation.

1 Like

Thank you @MBG

I tried Jupyter Notebook of pyGMTSAR and i got many information about InSAR and SBAS, Thanks

@domino1989
What is the difference bewteen ISCE2 and ISCE3?
Should i use ISCE3 which is the up to date source code?

Many differences… I will suggest using isce2. Isce3 is still in development, and it seems that now they focus on developing nisar processing. You can have a try, but few tutorial

1 Like

How about PyGMTSAR? Is it a good material for beginners to study?

Not familiar with PyGMTSAR. I used GMTSAR before, but I don`t know what they change in PyGMTSAR, maybe the shell codes in GMTSAR are changed to python.

1 Like

Yes, as @domino1989 wrote, the ISCE2 package is still current, and the ISCE3 package is being developed for the NISAR mission processing so it does not support many other satellite data types.

There is a set of tutorials for ISCE (and MintPy) available on GitHub:

We used these for a week-long short course in 2022. The course videos are available on the UNAVCO YouTube channel.

2 Likes

@domino1989
I glanced at the two codes briefly, and it seems like ISCE2 would be more suitable for studying!
Thank you.

@EJFielding
Thank you for sharing the latest information.
I was worried because the isce2 tutorial on GitHub was only available until 2020.
It will be very helpful for me!

PyGMTSAR was started as GMTSAR-compatible realization while the compatibility is not really valuable for users who prefer new possibilities instead. It is auto-scalable parallel software utilizing delayed computations and it works in Google Colab Jupyter notebooks (there are lots of examples) and Python scripts on GitHub hosted runners, in Docker containers, on cloud hosts and provides much more features (vertical and eastwest components calculation on complete incidence angle grid, seasonal and trend analysis, combined PS+SBAS analysis, etc.). There is PyGMTSAR Docker example on DockerHub which works on 16GB RAM host and performs analysis GMTSAR is not able to do on 512 GB RAM host. Book “ PyGMTSAR: Sentinel-1 Python InSAR: An Introduction” explains the basics and references some single-click InSAR examples.

1 Like

You would also try PS analysis in the recent PyGMTSAR version. Persistent scatterers probability (based on amplitude deviation index) is used for weighted interferogram filtering allowing more accurate SBAS results. It means PS+SBAS composite technique. Separate PS analysis is under development and it will help to validate and enhance SBAS results using PS pixels as reference points.

1 Like

Thank you for your response. @MBG

In fact, I attempted to study using the Jupyter Notebook provided by PyGMTSAR, and I was very satisfied with the results. However, one drawback is that there are parts of the code where external commands are used to call and execute GMTSAR.

As I am currently studying the principles of InSAR, my main objective is to understand how things work in practice by establishing a 1-to-1 correspondence between the equations of Time-Series InSAR and the code. Therefore, using PyGMTSAR for learning purposes, which relies on external commands, seems to have some limitations, as I am specifically focused on working with Python code.

Thank you for the information!

I’m going to replace all GMTSAR binaries using distributed delayed Python code. The main tools are already coded on Python while someones are not included yet into the library, see my sandbox on Github: https://github.com/mobigroup/gmtsar/tree/pygmtsar/todo for phasediff and orbit calculations. Pay attention, GMTSAR orbit processing is invalid as my comparison proves, see the ticket [Feature]: Hermite interpolation is invalid · Issue #738 · gmtsar/gmtsar · GitHub Also, I think about using SLC geotiff files directly (excluding conversion to binary files as GMTSAR does) so aligning will be applied to Sentinel-1 SLC products.

1 Like

Great! @MBG

If it is written in Python, it would be very helpful for beginners. Having someone like you makes it possible for us to study easily, quickly, and enjoyably. I am always grateful.

I will keep monitoring the PyGMTSAR GitHub regularly.

Thank you always.

1 Like