AlexeyPechnikov / pygmtsar

PyGMTSAR (Python InSAR): Powerful and Accessible Satellite Interferometry
http://insar.dev/
BSD 3-Clause "New" or "Revised" License
437 stars 97 forks source link

[Help]: How to crop result of LOS displacement by lon/lat coordinate? #58

Closed gjustin40 closed 1 year ago

gjustin40 commented 1 year ago

Hello!

I've attempted SBAS with my dataset and would like to know how to create a subset based on lon/lat coordinates. I referred to the example S1A_Stack_CPGF_T173.ipynb, and fortunately, it worked well with my data. In the example code, they used range and azimuth coordinates for cropping. However, the information I have is in lon/lat format. Is there a way to crop using lon/lat coordinates?

unwraps_detrend_subset = unwraps_detrend.sel(x=slice(9000,12000), y=slice(1800,2700))

  1. I'd like to know how to create a subset using lon/lat values instead of range/azimuth values for LOS displacement results.
  2. I'm interested in learning how to apply Multi-looking in the azimuth and range directions when using SBAS. (In the example, it seems like a hybrid approach using both PS and SBAS, so Multi-looking might not be applied. However, I need to use multi-looking unavoidably, hence the question.)

Thanks

AlexeyPechnikov commented 1 year ago
  1. Replace the subset

    sbas.intf_ra2ll(disps_cum.sel(x=slice(9000,12000), y=slice(1800,2700)))

    by

    sbas.intf_ra2ll(disps_cum).sel(lon=slice(...,...), lat=slice(...,...))
  2. Multi-looking is already applied:

    
    # SRTM3 DEM resolution 3 sec, 90 m but use 60 m instead to follow NetCDF chunks size 512x512
    decimator = sbas.pixel_decimator(resolution_meters=60, debug=True)

default parameters: wavelength=200, psize=32, func=None (no postprocessing)

sbas.intf_parallel(pairs, wavelength=400, func=decimator)

DEBUG: average per subswaths ground pixel size in meters: y=14.0, x=16.7

DEBUG: decimator = lambda da: da.coarsen({'y': 4, 'x': 4}, boundary='trim').mean()


Here resolution_meters=60 is the multi-looking window and it's performed as `da.coarsen({'y': 4, 'x': 4}, boundary='trim').mean()` (the window is 4x4 pixels because  x pixels are already aggregated).