pygmtsar icon indicating copy to clipboard operation
pygmtsar copied to clipboard

[Help]: PSI and SBAS geocoding

Open oguzhannysr opened this issue 1 year ago • 14 comments

Hello @AlexeyPechnikov, I produced displacement maps in a region for PSI and SBAS in a notebook called GoldenValley. However, my output results do not have a coordinate system, they appear as row and column indexes, as in the image. How can I do that. I need georeferencing for my disp_ps.grd and disp_sbas.grd result files. Another question I have is that when I open the output results, the spatial resolution is 1 meter. image

image

Also, the PSI result image appears differently, I cannot understand whether there is an error. image image

oguzhannysr avatar Feb 16 '24 12:02 oguzhannysr

You open internal processing files which have a special format. Geocode and export the files as explained in the examples.

AlexeyPechnikov avatar Feb 16 '24 12:02 AlexeyPechnikov

So, is my spatial resolution output correct?

oguzhannysr avatar Feb 16 '24 13:02 oguzhannysr

This is the rasters pixel spacing, not meters.

AlexeyPechnikov avatar Feb 16 '24 13:02 AlexeyPechnikov

Well @AlexeyPechnikov I managed to get the GoldenValley notebook working. However, I have a question. I want to separate my sbas and psi results, that is, my LOS changes, as vertical and east-west. Which function will I do this with?

oguzhannysr avatar Feb 20 '24 05:02 oguzhannysr

Please refer to 'CENTRAL Türkiye Mw 7.8 & 7.5 Earthquakes Co-Seismic Interferogram, 2023.' example.

image image

AlexeyPechnikov avatar Feb 20 '24 05:02 AlexeyPechnikov

image However, I could not see a line of code related to detrend in the GoldenValley notebook. What should I specify instead of Detrend?

oguzhannysr avatar Feb 20 '24 06:02 oguzhannysr

@AlexeyPechnikov Also, after a while, I get this error in the middle of the code and I cannot proceed to the result. What is the reason for this? I use Colab Pro, but I encounter this error when processing big data. Problems with the session usually start after this code: sbas.plot_displacements(disp_sbas[::3], caption='SBAS Cumulative LOS Displacement, [mm]', quantile=[0.01, 0.99])

ERROR:asyncio:Task exception was never retrieved future: <Task finished name='Task-2069812' coro=<Client._gather..wait() done, defined at /usr/local/lib/python3.10/dist-packages/distributed/client.py:2208> exception=AllExit()> Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/distributed/client.py", line 2217, in wait raise AllExit() distributed.client.AllExit

oguzhannysr avatar Feb 20 '24 09:02 oguzhannysr

'detrend' is your unwrapped and detrended phase. You can miss the detrending step if you don't need it for your case.

'asyncio' is just a web sockets communication library and you can ignore the message.

AlexeyPechnikov avatar Feb 20 '24 09:02 AlexeyPechnikov

@AlexeyPechnikov ,I have one last question, in this notebook I produced the LOS displacement map using my images in the ascending direction. How do I decide if this data is an up-down or east-west change? I tried parsing ud - ew using methods in other notebooks, but the results were too big and ridiculous.

image Also, I still haven't found what to write in parentheses instead of this detrend in the goldenvalley notebook.

oguzhannysr avatar Feb 28 '24 08:02 oguzhannysr

To obtain the actual values, you need to sum the west-east or vertical displacements from two orbits, or employ an alternative method to determine the projections.

The 'detrend' variable contains the detrended, unwrapped phase. You can utilize the unwrapped phase directly or subtract the linear regression trend from the phase, among other techniques.

AlexeyPechnikov avatar Feb 29 '24 15:02 AlexeyPechnikov

`--------------------------------------------------------------------------- ValueError Traceback (most recent call last) in <cell line: 1>() ----> 1 unwrap_sbas = sbas.unwrap_snaphu(intf_sbas, corr_sbas).where(corr_sbas_stack>=CORRLIMIT) 2 unwrap_sbas

5 frames /usr/local/lib/python3.10/dist-packages/xarray/core/variable.py in calculate_dimensions(variables) 2938 for dim, size in zip(var.dims, var.shape): 2939 if dim in scalar_vars: -> 2940 raise ValueError( 2941 f"dimension {dim!r} already exists as a scalar variable" 2942 )

ValueError: dimension 'pair' already exists as a scalar variable`

@AlexeyPechnikov ,What is the reason for this error?

oguzhannysr avatar Mar 08 '24 07:03 oguzhannysr

To obtain the actual values, you need to sum the west-east or vertical displacements from two orbits, or employ an alternative method to determine the projections.

The 'detrend' variable contains the detrended, unwrapped phase. You can utilize the unwrapped phase directly or subtract the linear regression trend from the phase, among other techniques.

I have developed a vertical and east-west decomposition based on an algorithm from published literature. It uses a search radius to combine points onto a lower resolution grid and decomposes the projections based on local incidence angle derived from a DEM which takes into account the slope. It does however depend on SNAP to create the local incidence angle, and using other tools such as GDAL did not give me the expected results. It would be interesting to see how you would approach this.

SteffanDavies avatar Mar 08 '24 08:03 SteffanDavies

@SteffanDavies

I have developed a vertical and east-west decomposition based on an algorithm from published literature. It uses a search radius to combine points onto a lower resolution grid...

The task should be resolved by using proper geocoding on the same grid instead of later interpolations. PyGMTSAR produces geocoded results aligned with DEM pixels, meaning that when using the same DEM, we have identical output grids for two orbits. Simply sum the grids to produce the actual up-down and east-west components.

AlexeyPechnikov avatar Mar 08 '24 10:03 AlexeyPechnikov

@oguzhannysr

What is the reason for this error?

The 'stack' dimension is incorrect. It appears that you are applying 3D processing code to a single interferogram, or vice versa.

AlexeyPechnikov avatar Mar 08 '24 10:03 AlexeyPechnikov