insarlab / MintPy

Miami InSAR time-series software in Python
https://mintpy.readthedocs.io
Other
560 stars 245 forks source link

How to get full resolution result of geo_velocity.h5? #1105

Closed gjustin40 closed 9 months ago

gjustin40 commented 9 months ago

The starting point for this question is here. Miaplpy Example

I am trying to Visualize the result of land displacement with tif data, How can i get the resolution that I prefer?

From above link, I found it that the key of resolution of result is mintpy.geocode.laloStep I tried several cases with command smallbaselineApp.py factory.txt --dir ./miaplpy2/network_single_reference/ --start geocode by:

mintpy.geocode.laloStep     = 0.000092593,0.000092593 (which is 10m)
mintpy.geocode.laloStep     = 0.000555556,0.000555556 (which is 50m)
mintpy.geocode.laloStep     = 0.00092593,0.00092593 (which is 100m)

and visualized geo_velocity.h5 with save_kmz.py and upload to google earth. the results are: image (100m, 50m, 10m)

But when I use save_gdal.py function to result of each options, the resolution of tif data are same on QGIS Furthermore, the resolution is different from what I expected. image

I want to generate the tif data for visualize the resolut of land displacement with the resolution the i expected, How to do that?

Thanks

yunjunz commented 9 months ago

Good question. By default, mintpy/geocode.py uses this approach to determine the output pixel size, which uses the following criteria:

  1. the output pixel should have the same area as the input pixel
  2. the output pixel lat/lon ratio matches the height/width of the bounding box of the radar pixel on the ground, as shown here (https://math.stackexchange.com/questions/4001034/calculate-the-dimensions-of-a-rotated-rectangle-inside-a-bounding-box).

Therefore, for a full-resolution product in geo-coordiantes, I think the default output grid (without manually setting the mintpy.geocode.laloStep option) is your best choice. And note that, the output grid in geo-coordinates will not be 5 x 20 m, but should be close to that. Another point is that mintpy uses the nearest resampling only during the geocoding, thus, setting a mintpy.geocode.laloStep value smaller than the actual pixel size, as in the case of 10 m, will only duplicate some values in nearby pixels.

Alternatively, if you only need to show the data in KML, using the radar-coded velocity file, as in save_kmz.py velocity.h5 would avoid the resampling procedure, thus, no issue of choosing an output pixel size.