Sentinel 1 SAR GRD Data with satpy

In [ ]:
!pip install satpy rioxarray rasterio

Reading single bands

Getting the filenames

In [4]:
from satpy import Scene, find_files_and_readers
from datetime import datetime

files = find_files_and_readers(
    base_dir="/home/a001673/data/satellite/Sentinel-1/",
    # Bay of bothnia
    start_time=datetime(2020, 3, 14, 15, 49, 13),
    end_time=datetime(2020, 3, 16, 15, 49, 40),
    reader='sar-c_safe')

Read the HH-polarized measurement as a xarray.DataArray

In [5]:
from satpy.dataset import DataQuery
scn = Scene(filenames=files)
hh_id = DataQuery(name="measurement", polarization="hh")
scn.load([hh_id])
scn[hh_id]
Out[5]:
<xarray.DataArray (y: 10717, x: 10474)>
dask.array<clip, shape=(10717, 10474), dtype=float64, chunksize=(4096, 4096), chunktype=numpy.ndarray>
Coordinates:
  * y            (y) int64 0 1 2 3 4 5 6 ... 10711 10712 10713 10714 10715 10716
  * x            (x) int64 0 1 2 3 4 5 6 ... 10468 10469 10470 10471 10472 10473
    band         int64 1
    spatial_ref  int64 0
    crs          object +proj=longlat +type=crs
Attributes: (12/18)
    name:                 measurement
    sensor:               sar-c
    wavelength:           [5.4, 5.405, 5.41]
    resolution:           80
    polarization:         hh
    calibration:          gamma
    ...                   ...
    platform_name:        s1b
    start_time:           2020-03-15 05:04:28
    end_time:             2020-03-15 05:05:32
    area:                 Shape: (10717, 10474)\nLons: <xarray.DataArray 'int...
    _satpy_id:            DataID(name='measurement', polarization='hh', resol...
    ancillary_variables:  []

Generate and display a SAR-Ice image

Generate the composite

In [6]:
composite = 'sar-ice-log'
scn.load([composite])
# To save the composite as Geotiff (including the GCPs):
# scn.save_dataset(composite)

Display the image

In [ ]:
scn.show(composite)

Image of the Bay of Botnia