TUDelftGeodesy/stmtools

Space-Time matrix query from polygon fields

rogerkuou opened this issue · 2 comments

Define a member function of class SpaceTimeMatrix, which queries the a field from a Polygon file with the coordinates of each point, then returns the query results as a new data variable.

Expected result:

import geopandas as gpd
import xarray as xr
import stmat

# Read polygon
polygon = gdp.read_file('example_polygon.shp')

# Initiate a dataset, ds contains both data and coordinates
ds = xr.Dataset(...)

# This will add a new data variable "field_name_str" to ds
ds = ds.stm.query_polygon(polygon, "field_name_str")

Useful links:

  • Example Notebook for loading the binary SLC data.

  • SLC data on Spider:

    • SLCs: /project/caroline/Share/stitch/nl_veenweiden/nl_veenweiden_s1_asc_t088/nl_veenweiden_cropped_stack. In the example notebook three scenes are used: 20210407, 20210413, 20210419. In each date folder, there are three binary files available. slc_srd_nl_veenweiden.raw is the SLC file containing the complex data.

    • Coordinates data are stored in the master scene: /project/caroline/Share/stitch/nl_veenweiden/nl_veenweiden_s1_asc_t088/nl_veenweiden_cropped_stack/20200325, where

      • lattitude: lam_nl_veenweiden.raw
      • longitude: phi_nl_veenweiden.raw
      • height: dem_radar_nl_veenweiden.raw
    • Example shp file: /project/caroline/Share/projects/nobv/contextual_data/locations/assendelft

The notebook Meiert made already gave a good example of querying using pygeo

The next step should be integrating the geom_enrich function in the notebook to STM