I would like to use scipy.interpolate.griddata
to interpolate my Sentinel-1 products (see two sample images below) taken from different orbits resulting in having the uniform datapoint coordinates.
I would like to use a similar approach as describesdescribe in link below:
Smoothing/interpolating raster in Python using GDAL?
However, I am not able to figure it how to get points at which to interpolate data from a geotiff
. So far, I have this for values and for basic geographic description:
from osgeo import gdal
# Loading terrain corrected image
master = gdal.Open("S1A_TC.tif")
# Data values of master image
master_array = master.ReadAsArray()
# Getting geographic data (e.g. pixelSizeX)
gt = master.GetGeoTransform()
For getting array of data point coordinates or points at which to interpolate data, I found this topic: https://stackoverflow.com/questions/43370069/converting-xy-co-ords-of-geotiff-to-numpy-array-positions-in-python
The GDAL link is dead and I am not able to found something useful.
How can I read the data point coordinates as np.array
?
Many thanks!