Install hyp3-lib from the Github repo using the setup.py file
Clip raster data to the same extent:
import glob
from osgeo import gdal
import os
from hyp3lib.cutGeotiffs import cutFiles
# Path that contains the directories with the unzipped Hyp3 data
images_folder = r'E:\London\Hyp3'
glob_items = []
target_files = ['*corr.tif', '*unw_phase.tif', '*inc_map.tif', '*dem.tif']
for item in target_files:
for file in glob.glob(os.path.join(images_folder, '*', item)):
glob_items.append(file)
print('Clipping images')
cutFiles(glob_items)
is there any rule for pairing the images or any experience we can use. Maybe we just remove the pairs with low quality inferogram, but I try to save some time…
hey there,
I’m also preparing datafiles for sbas using snap.
If I understand correctly, all data should be co-registrated to a chosen master data firstly and then generate inteferogram pairs. This is not possible in snap for now because multi-master is not supported.
Your method is to clip all interferograms into same area and dimensions. This mainly rely on the geocoding accuracy. I guess it may have some problems. Apply co-regsitration at early phase maybe more reasonable
You have to process them all individually one by one. This is a very labor intensive process if you do it manually in SNAP. I really recommend you create a script for it.
I just do standard InSAR processing that you can find on RUS Training. I automated that process to fit the SBAS requirement where each date needs 3 slaves.
Hi dear panjibrotoisworo
I want to calculate the closure_phase_bias.py using the MintPy software that I per-processed on ISCE,
but I cant calculate with (MintPy/closure_phase_bias.py at main · insarlab/MintPy · GitHub)
I would be grateful if you could guide me
Hello, thanks for your sharing. but I wonder how to Subset all four MintPy products by region, to make all the input data have the same row and column.
When conducting analysis with Mintpy, is it necessary to convert the unwrapped data using Snaphu to displacement in meters through Phase to Displacement?
I think this is the code, I’ve found it in some old code of mine.
def cut_tiffs_to_common_overlap(data_dir: str, overwrite=True) -> None:
"""
Get the common overlap of a list of GeoTIFF files
Parameters
----------
data_dir: str
Path to directory containing Tiffs to cut
overwrite: bool
If True, then it will overwrite existing files if it already exists. Else it will not.
Returns
-------
[ulx, uly, lrx, lry], the upper-left x, upper-left y, lower-right x, and lower-right y
corner coordinates of the common overlap
"""
files_for_mintpy = ['_water_mask.tif', '_corr.tif', '_unw_phase.tif', '_dem.tif', '_lv_theta.tif', '_lv_phi.tif']
# Get common area using DEM files
dem_files = glob(os.path.join(data_dir, '*_dem.tif'))
corners = [gdal.Info(str(dem), format='json')['cornerCoordinates'] for dem in dem_files]
ulx = max(corner['upperLeft'][0] for corner in corners)
uly = min(corner['upperLeft'][1] for corner in corners)
lrx = min(corner['lowerRight'][0] for corner in corners)
lry = max(corner['lowerRight'][1] for corner in corners)
overlap = [ulx, uly, lrx, lry]
# Loop through files and clip them to common area
for extension in files_for_mintpy:
for file in glob(os.path.join(data_dir, f'*{extension}')):
dst_file = os.path.join(
os.path.dirname(file),
os.path.basename(file).replace('.tif', '_clipped.tif')
)
if not overwrite and os.path.exists(dst_file):
continue
else:
gdal.Translate(destName=str(dst_file), srcDS=str(file), projWin=overlap)