umr-lops / xsar

Synthetic Aperture Radar (SAR) Level-1 GRD python mapper for efficient xarray/dask based processing
https://cyclobs.ifremer.fr/static/sarwing_datarmor/xsar/
MIT License
24 stars 8 forks source link

land mask for TOPS SLC are shifted -> need to be applied burst by burst #106

Closed agrouaze closed 1 year ago

agrouaze commented 2 years ago

image S1B_IW_SLC__1SDV_20181013T062320_20181013T062348_013130_018428_F58B.SAFE subswath = 'IW1' first burst. bounding box: [22, 1485, 1177, 21583]

agrouaze commented 1 year ago

In this land mask issue for SLC product, there is 2 main feature to adapt compare to GRD behavior: a) the capability to rasterize a land mask defined on lon/lat grids in the image coordinates b) the capability to re-project the SLC product in a lon/lat grid*. This operation is equivalent to SLC -> GRD conversion and is far beyond the scope of land mask. So I propose to discard this feature for SLC products.

There are several difficulties to tackle a):

  1. the land-masks are not all equivalent in particular openStreetMap Polygones (green lines) are aligned with wikipedia tiles but the cartopy coastline is clearly shifted (magenta line): image
  2. the land mask have to be divided by individual burst intersection. And the rasterization has to be done separately (i.e. burst by burst) because of the spatial overlapping from one to the other.
  3. the range axis in SLC products is not constant spacing for ground positions and it requires to assess the error introduced by affine transformation (coordinates->lon/lat)
  4. The .buffer(N) initially used for GRD products to simplify the polygon shapes can be dangerous for SLC if one goes beyond burst limits.

*the dataset['sigma0'].rio.reproject(...) that us using GCPs would be tuned so that ll2coords() and coords2ll() methods are not using Affine transformations to get the right values and probably that the.rio.reproject accessor has to be called burst by burst* while .rio accessor needs prior Sentinel1Dataset.recompute_attributes() call -> _set_rio() call -> _local_gcps()