RTC time series analysis#

application example: temporal variability in backscatter over Himalayan proglacial lakes

import geopandas as gpd
import xarray as xr
from s1_tools import power_to_db, get_bbox_single

Read in RTC data#

  • this example will use ASF dataset

%store -r
asf_clip
<xarray.Dataset>
Dimensions:      (x: 290, y: 396, acq_date: 103)
Coordinates:
  * x            (x) float64 6.194e+05 6.195e+05 ... 6.281e+05 6.281e+05
  * y            (y) float64 3.09e+06 3.09e+06 3.09e+06 ... 3.102e+06 3.102e+06
  * acq_date     (acq_date) datetime64[ns] 2021-05-02 2021-05-05 ... 2022-05-21
    band         int64 1
    spatial_ref  int64 0
Data variables:
    vv           (acq_date, y, x) float32 dask.array<chunksize=(1, 396, 290), meta=np.ndarray>
    vh           (acq_date, y, x) float32 dask.array<chunksize=(1, 396, 290), meta=np.ndarray>
    ls           (acq_date, y, x) float32 dask.array<chunksize=(1, 396, 290), meta=np.ndarray>

Read in vector data#

manual outlines of proglacial lakes

lakes = gpd.read_file('/home/emmamarshall/Desktop/siparcs/s1_book/data/proglacial_lake_outlines/proglacial_lake1.shp')
lakes_prj = lakes.to_crs('EPSG:32645')
lakes_prj
id geometry
0 1 POLYGON ((623555.903 3099600.816, 623594.809 3...
1 2 POLYGON ((622405.254 3097521.050, 622268.598 3...

Glacier outlines from Randolph Glacier Inventory

#da_bbox = get_bbox_single(asf_clip, 100)
#rgi = gpd.read_file('/home/emmamarshall/Desktop/data/rgi/south_asia_east_15/15_rgi60_SouthAsiaEast.shp')
#rgi.head(3)
#rgi_prj = rgi.to_crs('epsg:32645')

#rgi_sub = gpd.sjoin(rgi_prj, da_bbox, how='inner')
fig, axs = plt.subplots(ncols=2, figsize=(16,6))

power_to_db(asf_clip.vv.mean(dim=['x','y']).plot(ax=axs[0], cmap=plt.cm.Greys_r)
power_to_db(asf_clip.vv.sel(time='2022-04-30').plot(ax=axs[1], cmap=plt.cm.Greys_r)


#rgi_sub.plot(edgecolor='r', facecolor='none', ax=axs[0])
#rgi_sub.plot(edgecolor='r', facecolor='none', ax=axs[1])

lakes_prj.plot(ax=axs[0], facecolor='none', edgecolor='blue')
lakes_prj.plot(ax=axs[1], facecolor='none', edgecolor='blue')

axs[0].set_title('ASF RTC image')
axs[1].set_title('Planetary Computer RTC image')
fig.suptitle('RTC backscatter images of Bhutan glaciers, 30 Apr 2022', fontsize=14)