Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sentinel1.grd subpackage #11

Merged
merged 9 commits into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added

- Nothing.
- Support for Microsoft Azure storage: similar format to SAFE, without `.SAFE` ending to the folders
and slightly different file names.

### Deprecated

Expand Down
39 changes: 33 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Name: sentinel1
- Package: `stactools.sentinel1`
- PyPI: https://pypi.org/project/stactools-sentinel1/
- Owner: @scottyhq
- Owner: @scottyhq (RTC), @maximlamare (GRD)
- Dataset homepage: https://registry.opendata.aws/sentinel-1-rtc-indigo/
- STAC extensions used:
- [projection](https://github.com/stac-extensions/projection/)
Expand All @@ -17,23 +17,50 @@

Sentinel-1 subpackage for [stactools](https://github.com/stac-utils/stactools)

**NOTE** Currently only configured for AWS Radiometric Terrain Corrected (RTC) Public Dataset: https://registry.opendata.aws/sentinel-1-rtc-indigo. Future versions may support other public datasets such as [GRD and SLC](https://registry.opendata.aws/sentinel-1/).
This project contains multiple subpackages that work with different Sentinel 1 data products.

## RTC

The `stactools.sentinel1.rtc` subpackage and `stac sentinel1 rtc` commands deal with the Sentinel 1 Radiometric Terrain Corrected (RTC) data hosted on AWS and produced by Indigo Ag. This data was processed from original Ground Range Detected (GRD) scenes into a Radiometrically Terrain Corrected, tiled product suitable for analysis.

See https://registry.opendata.aws/sentinel-1-rtc-indigo for more information about this dataset.

## GRD

The `stactools.sentinel1.grd` subpackage and `stac sentinel1 grd` commands deal with [Sentinel 1 Ground Range Detected (GRD) Level-1](https://sentinel.esa.int/web/sentinel/user-guides/sentinel-1-sar/resolutions/level-1-ground-range-detected) product. It is used to create STAC Items from the SAFE manifest format of the data hosted on Microsoft Azure.

## Examples

### STAC objects

- [Item (RTC)](examples/sentinel1-rtc-aws/2016/S1B_20161121_12SYJ_ASC/S1B_20161121_12SYJ_ASC.json)
- [Item (GRD)](examples/grd/item.json)

## How to use

#### Install package
### Install package
```
pip install stactools-sentinel1
```
### RTC

#### Create a STAC Item
#### Create a STAC Item (RTC)
```
stac sentinel1 create-item s3://sentinel-s1-rtc-indigo/tiles/RTC/1/IW/12/S/YJ/2016/S1B_20161121_12SYJ_ASC S1B_20161121_12SYJ_ASC
stac sentinel1 rtc create-item s3://sentinel-s1-rtc-indigo/tiles/RTC/1/IW/12/S/YJ/2016/S1B_20161121_12SYJ_ASC S1B_20161121_12SYJ_ASC
```

#### Create a STAC Static Catalog
#### Create a STAC Static Catalog (RTC)
https://github.com/scottyhq/sentinel1-rtc-stac

### GRD

Description of the command line functions

```bash
$ stac sentinel1 grd create-item source destination
```

Use `stac sentinel1_grd --help` to see all subcommands and options.

## Development instructions

Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ name: stactools-sentinel1
channels:
- conda-forge
dependencies:
- gdal
- rasterio~=1.2
220 changes: 220 additions & 0 deletions examples/grd/item.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
{
"type": "Feature",
"stac_version": "1.0.0",
"id": "S1A_IW_GRDH_1SDV_20210809T173953_20210809T174018_039156_049F13_6FF8",
"properties": {
"sar:frequency_band": "C",
"sar:center_frequency": 5.405,
"sar:looks_range": 5,
"sar:looks_azimuth": 1,
"sar:pixel_spacing_range": 10,
"sar:instrument_mode": "IW",
"sar:polarizations": [
"VV",
"VH"
],
"sar:product_type": "GRD",
"sat:platform_international_designator": "2014-016A",
"sat:orbit_state": "ascending",
"sat:absolute_orbit": 39156,
"sat:relative_orbit": 59,
"proj:epsg": 4326,
"proj:geometry": {
"type": "Polygon",
"coordinates": [
[
[
1.512143,
46.03389
],
[
4.85136,
46.436539
],
[
5.188996,
44.938713
],
[
1.937196,
44.536255
],
[
1.512143,
46.03389
]
]
]
},
"proj:bbox": [
1.512143,
44.536255,
5.188996,
46.436539
],
"proj:shape": [
26144,
16676
],
"providers": [
{
"name": "ESA",
"roles": [
"producer",
"processor",
"licensor"
],
"url": "https://earth.esa.int/web/guest/home"
}
],
"platform": "SENTINEL-1A",
"constellation": "Sentinel 1",
"start_datetime": "2021-08-09 17:39:53.153776+00:00",
"end_datetime": "2021-08-09 17:40:18.152800+00:00",
"s1:instrument_configuration_ID": "7",
"s1:datatake_id": "302867",
"datetime": "2021-08-09T17:40:05.653288Z"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
1.512143,
46.03389
],
[
4.85136,
46.436539
],
[
5.188996,
44.938713
],
[
1.937196,
44.536255
],
[
1.512143,
46.03389
]
]
]
},
"links": [
{
"rel": "license",
"href": "https://sentinel.esa.int/documents/247904/690755/Sentinel_Data_Legal_Notice"
},
{
"rel": "self",
"href": "/opt/stactools-sentinel1_grd/examples/S1A_IW_GRDH_1SDV_20210809T173953_20210809T174018_039156_049F13_6FF8.json",
"type": "application/json"
}
],
"assets": {
"safe-manifest": {
"href": "examples/S1A_IW_GRDH_1SDV_20210809T173953_20210809T174018_039156_049F13_6FF8.SAFE/manifest.safe",
"type": "application/xml",
"roles": [
"metadata"
]
},
"product_iw_vv": {
"href": "examples/S1A_IW_GRDH_1SDV_20210809T173953_20210809T174018_039156_049F13_6FF8.SAFE/annotation/s1a-iw-grd-vv-20210809t173953-20210809t174018-039156-049f13-001.xml",
"type": "application/xml",
"title": "Product Schema",
"roles": [
"metadata"
]
},
"product_iw_vh": {
"href": "examples/S1A_IW_GRDH_1SDV_20210809T173953_20210809T174018_039156_049F13_6FF8.SAFE/annotation/s1a-iw-grd-vh-20210809t173953-20210809t174018-039156-049f13-002.xml",
"type": "application/xml",
"title": "Product Schema",
"roles": [
"metadata"
]
},
"calibration_iw_vh": {
"href": "examples/S1A_IW_GRDH_1SDV_20210809T173953_20210809T174018_039156_049F13_6FF8.SAFE/annotation/calibration/calibration-s1a-iw-grd-vh-20210809t173953-20210809t174018-039156-049f13-002.xml",
"type": "application/xml",
"title": "Calibration Schema",
"roles": [
"metadata"
]
},
"calibration_iw_vv": {
"href": "examples/S1A_IW_GRDH_1SDV_20210809T173953_20210809T174018_039156_049F13_6FF8.SAFE/annotation/calibration/calibration-s1a-iw-grd-vv-20210809t173953-20210809t174018-039156-049f13-001.xml",
"type": "application/xml",
"title": "Calibration Schema",
"roles": [
"metadata"
]
},
"noise_iw_vh": {
"href": "examples/S1A_IW_GRDH_1SDV_20210809T173953_20210809T174018_039156_049F13_6FF8.SAFE/annotation/calibration/noise-s1a-iw-grd-vh-20210809t173953-20210809t174018-039156-049f13-002.xml",
"type": "application/xml",
"title": "Noise Schema",
"roles": [
"metadata"
]
},
"noise_iw_vv": {
"href": "examples/S1A_IW_GRDH_1SDV_20210809T173953_20210809T174018_039156_049F13_6FF8.SAFE/annotation/calibration/noise-s1a-iw-grd-vv-20210809t173953-20210809t174018-039156-049f13-001.xml",
"type": "application/xml",
"title": "Noise Schema",
"roles": [
"metadata"
]
},
"thumbnail": {
"href": "examples/S1A_IW_GRDH_1SDV_20210809T173953_20210809T174018_039156_049F13_6FF8.SAFE/preview/quick-look.png",
"type": "image/png",
"roles": [
"thumbnail"
]
},
"vh": {
"href": "examples/S1A_IW_GRDH_1SDV_20210809T173953_20210809T174018_039156_049F13_6FF8.SAFE/measurement/s1a-iw-grd-vh-20210809t173953-20210809t174018-039156-049f13-002.tiff",
"type": "image/tiff; application=geotiff",
"title": "VH - 10m",
"eo:bands": [
{
"name": "VH",
"description": "vertical transmit and horizontal receive"
}
],
"roles": [
"data"
]
},
"vv": {
"href": "examples/S1A_IW_GRDH_1SDV_20210809T173953_20210809T174018_039156_049F13_6FF8.SAFE/measurement/s1a-iw-grd-vv-20210809t173953-20210809t174018-039156-049f13-001.tiff",
"type": "image/tiff; application=geotiff",
"title": "VV - 10m",
"eo:bands": [
{
"name": "VV",
"description": "vertical transmit and vertical receive"
}
],
"roles": [
"data"
]
}
},
"bbox": [
1.512143,
44.536255,
5.188996,
46.436539
],
"stac_extensions": [
"https://stac-extensions.github.io/sar/v1.0.0/schema.json",
"https://stac-extensions.github.io/sat/v1.0.0/schema.json",
"https://stac-extensions.github.io/eo/v1.0.0/schema.json",
"https://stac-extensions.github.io/projection/v1.0.0/schema.json"
]
}
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
codespell
coverage
editorconfig-checker
editorconfig-checker==2.3.*
flake8
jupyter
mypy
Expand Down
2 changes: 1 addition & 1 deletion scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
usage
else
# Text formatting
editorconfig-checker --exclude "$EC_EXCLUDE"
ec --exclude "$EC_EXCLUDE"
# Code formatting
yapf -dpr ${DIRS_TO_CHECK[@]}
# Lint
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ keywords =
pystac
catalog
STAC
sentinel
GRD
radar
classifiers =
Development Status :: 4 - Beta
License :: OSI Approved :: Apache Software License
Expand Down
9 changes: 5 additions & 4 deletions src/stactools/sentinel1/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import stactools.core

from stactools.sentinel1.commands import create_sentinel1_command
from stactools.cli.registry import Registry

stactools.core.use_fsspec()


def register_plugin(registry):
def register_plugin(registry: Registry):
# Register subcommands

from stactools.sentinel1 import commands

registry.register_subcommand(commands.create_sentinel1_command)
registry.register_subcommand(create_sentinel1_command)


__version__ = '0.1.0'
Loading