!pip install satpy rioxarray rasterio
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')
xarray.DataArray
¶from satpy.dataset import DataQuery
scn = Scene(filenames=files)
hh_id = DataQuery(name="measurement", polarization="hh")
scn.load([hh_id])
scn[hh_id]
<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: []
|
array([ 0, 1, 2, ..., 10714, 10715, 10716])
array([ 0, 1, 2, ..., 10471, 10472, 10473])
array(1)
array(0)
array(<Geographic 2D CRS: +proj=longlat +type=crs> Name: unknown Axis Info [ellipsoidal]: - lon[east]: Longitude (degree) - lat[north]: Latitude (degree) Area of Use: - undefined Datum: World Geodetic System 1984 - Ellipsoid: WGS 84 - Prime Meridian: Greenwich , dtype=object)
composite = 'sar-ice-log'
scn.load([composite])
# To save the composite as Geotiff (including the GCPs):
# scn.save_dataset(composite)
scn.show(composite)