InSAR deformation data (timeseries) extraction

1,327 views
Skip to first unread message

Sven Borgstrom

unread,
Jan 12, 2022, 5:21:42 AM1/12/22
to MintPy
Hi Yunjun,

I would like to compare InSAR with GPS data, as my Institute has a GPS network in my AOI.
InSAR timeseries - correct me if I'm wrong - is inside a *.h5 file (geo_timeseries...h5), so I should get these data with a tool, let me say, like HDFView.

I never used this tool before, moreover the *.h5 is usually quite large, so it's difficult to manage.

Could you please suggest the easiest way to get the InSAR deformation values (timeseries) on one pixel?

Maybe with the shape file from "save_qgis"? Should I try to get the *.csv file? And how?

Sorry but I'm quite confuse on this.
Cheers,
Sven.

Zhang Yunjun

unread,
Jan 16, 2022, 10:59:50 PM1/16/22
to MintPy
Hi Sven,

There are many ways to extract the time series of a pixel. The easiest one is using tsview.py --lalo --save option, which will plot and save the displacement time series into a text file, such as the one below:

# time-series file = timeseries_SET_ERA5_ramp_demErr.h5
# Y/X = 229, 294, lat/lon = -0.3781, -91.5281
# reference pixel: y=76, x=156
# reference date: 20151114
# estimated time function parameters:
# velocity: 2.31 +/- 0.31 cm/year
# unit: cm
20141213 -1.8196862
20141225 -1.7105241
20150307 -2.830321
20150319 -1.5390346
20150331 -1.2768779
20150412 -0.17370489

QGIS should also work, although I don't know the details. The HDF5 file structure is described here: https://mintpy.readthedocs.io/en/latest/api/data_structure/, one should be able to read it using Python, Matlab, or whatever language they are familiar with.

A note on the GNSS and InSAR comparison: GNSS measures one point, while InSAR measures an area, they are not exactly the same, strictly speaking. Thus, people usually either 1) interpolate InSAR to the exact GNSS location or 2) average multiple InSAR pixels around the GNSS location, for this purpose. I used 1) in Yunjun et al.. (2019) paper, with a not-so-clean Jupyter Notebook here (https://nbviewer.org/github/geodesymiami/Yunjun_et_al-2019-MintPy/blob/master/Fig_08_S06_InSAR_vs_GPS.ipynb) in case you might want to take a look for the code details.

Yunjun

Sven Borgstrom

unread,
Jan 17, 2022, 7:56:57 AM1/17/22
to MintPy
Hi Yunjun,
many thanks for the answer and valuable suggestions that I'll keep in mind.
Cheers,
Sven.

JOSUÉ CASADO RABASCO

unread,
Apr 5, 2022, 5:09:08 AM4/5/22
to MintPy
Hi Yunjun,
if we have the time series from a GNSS at one point, should we use that point as the reference pixel? Even if there is deformation at that point? 
Thanks,
Josué

siavash rain

unread,
Apr 8, 2022, 11:50:23 AM4/8/22
to MintPy
Hi  Yunjun and all,

I am using "tsview.py geo_timeseries_ECMWF_ramp_demErr.h5 --lalo -0.3771 -91.5327 --save" to extract timeseries displacement but I get the following error:

Traceback (most recent call last):
  File "/home/meh/.conda/envs/python37/bin/tsview.py", line 10, in <module>
    sys.exit(main())
  File "/home/meh/.conda/envs/python37/lib/python3.7/site-packages/mintpy/tsview.py", line 1029, in main
    obj.configure()
  File "/home/meh/.conda/envs/python37/lib/python3.7/site-packages/mintpy/tsview.py", line 740, in configure
    inps = cmd_line_parse(self.iargs)
  File "/home/meh/.conda/envs/python37/lib/python3.7/site-packages/mintpy/tsview.py", line 103, in cmd_line_parse
    if '--gps-comp' in iargs:
TypeError: argument of type 'NoneType' is not iterable

I would appreciate if you can give me a hint.
/Meh 

Manudeo Singh

unread,
Apr 8, 2022, 4:52:12 PM4/8/22
to min...@googlegroups.com
Hi,

I also got the same error when tried to run tsview.py to extract the TS at a point. I think it is a bug.

I solved it like this (jupyter notebook):

%matplotlib notebook
import os
import matplotlib.pyplot as plt
from mintpy.tsview import timeseriesViewer

# visualization and save functions
def tsview(fname, lalo=None, figsize_img=[5, 4], figsize_pts=[5, 4]):
    """Plot input file using tsview.py and save the output images and timeseries as text file"""
    cmd = 'tsview.py {} --ms 4 --noverbose --save'.format(fname)
    if lalo is not None:
        cmd += ' --lalo {} {}'.format(lalo[0], lalo[1])
    obj = timeseriesViewer(cmd)
    obj.configure()
    obj.figsize_img = figsize_img
    obj.figsize_pts = figsize_pts
    obj.plot()
    return obj

ts_file = 'geo/geo_timeseries_ERA5_ramp.h5'
tsview(ts_file, lalo=(36.3,29.43), figsize_img=[5, 5]) #put your lat-lon here

Now I am figuring out a way to export TS at more than one point by giving some CSV input with lat/long. If anyone has figured out a way, please share. Thanks.

 Best,
Manu

--
You received this message because you are subscribed to the Google Groups "MintPy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mintpy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mintpy/08f03bdb-ab27-4a73-bbdb-3b47fa49e07fn%40googlegroups.com.

siavash rain

unread,
Apr 12, 2022, 2:42:52 PM4/12/22
to MintPy
Hi Manu,

If your error is the same as mine, I could overcome the problem with the following workaround:

I commented out the lines of 103,104 and 105 in file tsview.py

Mehdi

Zhang Yunjun

unread,
Apr 14, 2022, 3:38:13 PM4/14/22
to MintPy
Hi Mehdi,

The original error you posted should have been fixed in the latest development version. Please update your code and try again. If the error is still there, please open a GitHub issue, following its Bug Report template, so that we could reproduce and fix it.

Regards,
Yunjun

nilloofar alizade

unread,
Aug 18, 2022, 5:01:26 AM8/18/22
to MintPy
Dear member, Did you find a way to export CSV or txt for all PSs?

Manudeo Singh

unread,
Aug 18, 2022, 8:39:59 AM8/18/22
to min...@googlegroups.com
Hi, you can use save_qgis.py to save the time series as shapefile. Either work with that shapefile (or export it as a CSV) or use the associated ‘.dbf’ file of that shapefile. The .dbf can be opened directly in software such as excel, and can be saved as CSV from there. 

Best,
Manu

--
_________________________________
Dr. Manudeo Singh
Alexander von Humboldt Postdoctoral Fellow
Universität Potsdam
University of Potsdam
Institut für Geowissenschaften
Institute of Geosciences
Potsdam, Germany

nilloofar alizade

unread,
Aug 19, 2022, 4:14:41 AM8/19/22
to MintPy
Dear Manu, Thanks a lot, I think saving .shp is better.
best regards,
Niloofar

Reply all
Reply to author
Forward
0 new messages