pygmtsar icon indicating copy to clipboard operation
pygmtsar copied to clipboard

[Help]: Velocity Map from sbas_parralell

Open kinreich opened this issue 11 months ago • 1 comments

Hi, I'm running a long time-series using the previous version of pygmtsar, because all my data progress is saved in the last version.

Last I ran sbas_paralell because sbas.sbas has an issue, and now I have disp grid for each date.

I'm trying to find the code to calculate the velocity displacement from these files, and cannot find any. Could you please help explain how to produce the velocity grd from disp grd in pygmtsar?

OS and software version

  • OS: Ubuntu 20.04.5 LTS
  • PyGMTSAR version: pygmtsar-v2023.3.11

kinreich avatar Mar 20 '24 09:03 kinreich

Depending on your PyGMTSAR version, you can try the functions sbas.trend() and sbas.stl(). If these are not available, the linear regression trend can easily be computed as in the trend() function:

    def trend(self, data, deg=1):
        import xarray as xr

        trend = xr.polyval(data.date, data.polyfit('date', deg).polyfit_coefficients)
        return trend

Divide the LOS, vertical, or east-west displacement trend difference (last minus first value per pixel) by your time interval in years to get the velocity in mm/year.

AlexeyPechnikov avatar Mar 20 '24 14:03 AlexeyPechnikov