LiChiehLin / GMTSAR_gadgets

Supplementary codes for GMTSAR
GNU General Public License v3.0
5 stars 2 forks source link

help, make_a_offset.csh parameter is faulty #1

Open CUMT530849827 opened 1 month ago

CUMT530849827 commented 1 month ago

Hello, author, I would like to ask how the two nx and ny in make_a_offset.csh are calculated or how they are obtained. I can't understand the answer of the question in github issue, I hope you can help me, thank you image

LiChiehLin commented 1 month ago

Hi, For nx and ny, you can open your .PRM file and look for the value for num_rng and num_az. PRM files are text files and should be easily opened using any text editor.

CUMT530849827 commented 1 month ago

Thank you, I tried to run it with the following parameters, but it kept working image image

LiChiehLin commented 1 month ago

Your nx is determined by num_rng_bins/4. ny is num_valid_az/6. So in your case should be something like this: nx = 25496/4 = 6000 ny = 12188/6 = 2000

CUMT530849827 commented 1 month ago

Can you tell me why? nx is determined by num_rng_bins/4. ny is num_valid_az/6. Why four and six, thank you very much

LiChiehLin commented 1 month ago

As far as I know, the 4 and 6 are just arbitrary numbers. They mean that the code will take 4 pixels in range and 6 pixels in azimuth direction to form a new pixel for calculating the cross correlation. Check out the semi-grid search using make_a_offset.csh (From Lin et al., 2024) . The pixel resolution progressively becomes finer when the input nx ny are larger. Note that some buggy results show when the numbers get bigger. I am not sure if GMTSAR team has solved that yet. Screenshot from 2024-06-02 17-38-40

CUMT530849827 commented 1 month ago

I got this knowledge and thank you very much for solving some problems that I couldn't figure out.

CUMT530849827 commented 1 month ago

Could you please send me the link or title of your article? I'd like to refer to it。 (From Lin et al., 2024)

LiChiehLin commented 1 month ago

Here you go: Lin, L. C. J., Chuang, R. Y., Lu, C. H., Ching, K. E., & Chen, C. L. (2024). Derivation of 3D Coseismic Displacement Field from Integrated Azimuth and LOS Displacements for the 2018 Hualien Earthquake. Remote Sensing, 16(7), 1159.

CUMT530849827 commented 1 month ago

Hello, I'm sorry to bother you. I obtained a graph according to the nx and ny values you gave me, but I did not get the information of POT from the graph. What should I do

image

LiChiehLin commented 1 month ago

There are two reasons associated with this.

  1. The colorbar is saturated. Try re-make the figure with color ranges from -1 to 1.
  2. I assume you are processing coseismic displacement for an earthquake. Note that the detection ability is about 1/10 of the pixel resolution. Typically, Sentinel-1 has pixel resolution of 5m in range and 15~20m in azimuth direction. That means the displacement should be somewhat larger than ~50 cm in range and ~1.5m in azimuth to be detected.

So due to the pixel resolution, POT with Sentinel-1 images works better on large earthquakes (e.g. 2021 Maduo earthquake and 2021 Haiti earthquake etc.).

CUMT530849827 commented 1 month ago

@LiChiehLin Teacher, I bother you again. I used POT method to process a strip data of Maddow earthquake and obtained the following figure, but I feel that the data is particularly noisy. I would like to ask how to get a picture as clean as that in your paper mdpot

LiChiehLin commented 1 month ago

So pretty similar reasons:

  1. The colorbar is saturated. Try plot it within -1 ~ 1.
  2. I assume this is azimuth offset. The dominant deformation of this event was strike-slip and is more well imaged with range offset. If you look at the range offset map, it will be clearer and less noisy. As for azimuth offset, the POT detection is around 1.5 m (based on the azimuth pixel resolution of Sentinel-1) in this case, so your result will be more obscured and is expected.

For taking out the range offset information, you may use this code I adopted from make_a_offset.csh from GMTSAR. It's called take_r_offset.csh. Put this code in the azi_offset/ folder and execute it with:

csh take_r_offset.csh Reference_image.PRM nx ny

The nx and ny are the ones you used to run make_a_offset.csh https://github.com/LiChiehLin/GMTSAR_gadgets/blob/af120a2d1e5fe3cb0876dd945fa6a66375daa3f3/PixelOffsetTracking/take_r_offset.csh


If you want to remove the noises (the speckle-like pixels), you may use my Matlab code Deno.m. The Readme file associated with that code should explain the code pretty well. And if you do use that code to denoise your image, I would kindly ask you to cite the corresponding paper. Thank you!

Lin, L. C. J., Chuang, R. Y., Lu, C. H., Ching, K. E., & Chen, C. L. (2024). Derivation of 3D Coseismic Displacement Field from Integrated Azimuth and LOS Displacements for the 2018 Hualien Earthquake. Remote Sensing, 16(7), 1159. https://github.com/LiChiehLin/3D_decomposition/tree/2e6a00d7417692e17065d9e575cc9cc8aed63a96/Denoise

CUMT530849827 commented 3 weeks ago

Hello, LiChiehLin. Under your guidance, I have obtained POT data of three strips. I would like to ask you if I have obtained azi_offset.grd corresponding to three sawth, what should I do to make them join together? I tried to use grdsample to make the grd data of F2 F3 strip the same as that of F1 1.gmt grdsample azi_offset2. -Gtemp2. grd -Iazi_offset1.grd 2.gmt grdsample azi_offset3.grd -Gtemp3.grd -Iazi_offset1.grd Then grdpaste grid1. 3.gmt grdpaste temp2. grd temp3.grd azi_offset1.grd -Gmerged.grd was used to concatenate, but I failed. I would like to ask you how to concatenate it image

LiChiehLin commented 3 weeks ago

I don't think there is a direct way of doing so. grdpaste requires the input grds have a common edge. I don't think your these grds have common boundaries and grdsample will not do the work. From my experience, it is more straightforward to read it with python or matlab and merge them on your own. If you code in Matlab, you are welcomed to use my code (Expand_extent.m) to expand the spatial extent of the grds. This will make all three grds cover the same geographical area, with NaN values filled in the empty grids. From there you can merge them by coding a simple if-else condition. There's a corresponding Readme file and a simple example in that repo. I hope it will be clear enough. Expand_extent.m

Another way of getting merged azimuth offsets is to merge all three subswaths together first and run make_a_offset.csh to get the merged POT result. But this will require a larger computation time and memory and I am not particularly sure how GMTSAR works on that.