Skip to main content

Xarray backend to Copernicus Sentinel-1 satellite data products

Project description

xarray-sentinel

WARNING: this product is a "technology preview" / pre-Alpha

Xarray backend to explore and load Copernicus Sentinel-1 satellite data products.

This Open Source project is sponsored by B-Open - https://www.bopen.eu

Install

The easiest way to install xarray-sentinel is via conda. Create a new environment, activate it, install the package and its dependencies, as follows:

    conda create -n xarray-sentinel
    conda activate xarray-sentinel
    conda install -c conda-forge rioxarray xmlschema
    pip install xarray-sentinel

Product support status:

  • Sentinel-1 SLC IW (Interferometric Wide Swath): work-in-progress
  • Sentinel-1 SLC EW (Extended Wide Swath): in roadmap
  • Sentinel-1 SLC SM (Stripmap): in roadmap
  • Sentinel-1 GRD SM/IW/EW: in roadmap
  • Sentinel-2 L1C/L2A: in roadmap

Sentinel-1 SLC IW

Data

Currently, xarray-sentinel provides access as Xarray datasets to the following data:

  • burst data
  • gcp
  • orbit
  • attitude

using azimuth_time and slant_range_time dimensions.

Examples:

Open root dataset

>>> from xarray_sentinel import sentinel1
>>> product_path = "tests/data/S1B_IW_SLC__1SDV_20210401T052622_20210401T052650_026269_032297_EFA4.SAFE"
>>> sentinel1.open_dataset(product_path)
<xarray.Dataset>
Dimensions:  ()
Data variables:
    *empty*
Attributes: (12/15)
    constellation:              sentinel-1
    platform:                   sentinel-1b
    instrument:                 ['c-sar']
    sat:orbit_state:            descending
    sat:absolute_orbit:         26269
    sat:relative_orbit:         168
    ...                         ...
    sar:polarizations:          ['VV', 'VH']
    sar:product_type:           SLC
    xs:instrument_mode_swaths:  ['IW1', 'IW2', 'IW3']
    groups:                     ['IW1', 'IW1/gcp', 'IW1/attitude', 'IW1/orbit...
    Conventions:                CF-1.7
    history:                    created by xarray_sentinel-...

the attribute groups shows the available groups to be loaded. The key group shall be used to select the dataset to be loaded.

Open gcp dataset

To load the gcp relative to the first swath use the key group="IW1/gcp":

>>> sentinel1.open_dataset(product_path, group="IW1/gcp")
<xarray.Dataset>
Dimensions:           (azimuth_time: 10, slant_range_time: 21)
Coordinates:
  * azimuth_time      (azimuth_time) datetime64[ns] 2021-04-01T05:26:24.20973...
  * slant_range_time  (slant_range_time) float64 0.005343 0.00536 ... 0.005679
Data variables:
    latitude          (azimuth_time, slant_range_time) float64 ...
    longitude         (azimuth_time, slant_range_time) float64 ...
    height            (azimuth_time, slant_range_time) float64 ...
    incidenceAngle    (azimuth_time, slant_range_time) float64 ...
    elevationAngle    (azimuth_time, slant_range_time) float64 ...
Attributes:
    Conventions:  CF-1.7
    title:        Geolocation grid
    comment:      The dataset contains geolocation grid point entries for eac...
    history:      created by xarray_sentinel-...

Open attitude dataset

>>> sentinel1.open_dataset(product_path, group="IW1/attitude")
<xarray.Dataset>
Dimensions:       (azimuth_time: 25)
Coordinates:
  * azimuth_time  (azimuth_time) datetime64[ns] 2021-04-01T05:26:24.750001 .....
Data variables:
    q0            (azimuth_time) float64 ...
    q1            (azimuth_time) float64 ...
    q2            (azimuth_time) float64 ...
    q3            (azimuth_time) float64 ...
    wx            (azimuth_time) float64 ...
    wy            (azimuth_time) float64 ...
    wz            (azimuth_time) float64 ...
    pitch         (azimuth_time) float64 ...
    roll          (azimuth_time) float64 ...
    yaw           (azimuth_time) float64 ...
Attributes:
    Conventions:  CF-1.7
    title:        Attitude information used by the IPF during processing
    comment:      The dataset contains a sets of attitude data records that a...
    history:      created by xarray_sentinel-...

Open orbit dataset

>>> sentinel1.open_dataset(product_path, group="IW1/orbit")
<xarray.Dataset>
Dimensions:       (azimuth_time: 17)
Coordinates:
  * azimuth_time  (azimuth_time) datetime64[ns] 2021-04-01T05:25:19 ... 2021-...
Data variables:
    x             (azimuth_time) float64 ...
    y             (azimuth_time) float64 ...
    z             (azimuth_time) float64 ...
    vx            (azimuth_time) float64 ...
    vy            (azimuth_time) float64 ...
    vz            (azimuth_time) float64 ...
Attributes:
    reference_system:  Earth Fixed
    Conventions:       CF-1.7
    title:             Orbit information used by the IPF during processing
    comment:           The dataset contains a sets of orbit state vectors tha...
    history:           created by xarray_sentinel-...

Open a single burst

>>> sentinel1.open_dataset(product_path, group="IW1/R168-N459-E0115")
<xarray.Dataset>
Dimensions:           (azimuth_time: 1501, slant_range_time: 21632)
Coordinates:
  * azimuth_time      (azimuth_time) datetime64[ns] 2021-04-01T05:26:43.51577...
  * slant_range_time  (slant_range_time) float64 0.005343 0.005343 ... 0.005679
Data variables:
    VH                (azimuth_time, slant_range_time) complex128 ...
    VV                (azimuth_time, slant_range_time) complex128 ...
Attributes: (12/14)
    constellation:              sentinel-1
    platform:                   sentinel-1b
    instrument:                 ['c-sar']
    sat:orbit_state:            descending
    sat:absolute_orbit:         26269
    sat:relative_orbit:         168
    ...                         ...
    sar:instrument_mode:        IW
    sar:polarizations:          ['VV', 'VH']
    sar:product_type:           SLC
    xs:instrument_mode_swaths:  ['IW1', 'IW2', 'IW3']
    Conventions:                CF-1.7
    history:                    created by xarray_sentinel-...

With the upcoming release of Xarray v0.18.0, xarray-sentinel will be automatically available as an Xarray bakend:

>>> import xarray as xr
>>> ds = xr.open_dataset(product_path, engine="sentinel-1")

Contributing

The main repository is hosted on GitHub, testing, bug reports and contributions are highly welcomed and appreciated:

https://github.com/bopen/xarray-sentinel

Lead developer:

Main contributors:

See also the list of contributors who participated in this project.

License

Copyright 2021, B-Open Solutions srl and the xarray-sentinel authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xarray-sentinel-0.1.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

xarray_sentinel-0.1-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file xarray-sentinel-0.1.tar.gz.

File metadata

  • Download URL: xarray-sentinel-0.1.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for xarray-sentinel-0.1.tar.gz
Algorithm Hash digest
SHA256 ab272d2a3de662ee7834df7f8f16be49fa4aecc21b9eab5b882d1361452d37cd
MD5 df79875427f58f2a8fc9126189c689d0
BLAKE2b-256 8456b0390c2507cf76c007672b33ea76029fe70f33f1fbf500279c38ff396eb4

See more details on using hashes here.

Provenance

File details

Details for the file xarray_sentinel-0.1-py3-none-any.whl.

File metadata

  • Download URL: xarray_sentinel-0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for xarray_sentinel-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5a98ef7ca324eae6d2cb373d8653f66ab394aff29ab99a83e472e52326ed4389
MD5 6fbd648aa5ee1479bd2065e1b0aee28d
BLAKE2b-256 843f1a92dc96bb300cf63f040bef8b6a327f4fd390d14bfc4d254a51dc0709f5

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page