Skip to main content

No project description provided

Project description

sentineltoolbox

This repository contains the sentineltoolbox project.

This project provides tools to manipulate sentinel products.

Sentinel products are described in Copernicus Programme documentation: https://sentiwiki.copernicus.eu/web/

Installation

stb_convert_products

This tool converts original sentinel products (*.SAFE, *.SEN3) to DPR zarr products (*.zarr)

Only these products are supported:

Supported products

S3 Products (OLCI, SLSTR, SYNERGY)

  • S3 OLCI

    • S3*_OL_1_EFR/ERR_*.SEN3
    • S3*_OL_1_ERR_*.SEN3
    • S3*_OL_2_LFR_*.SEN3
  • S3 SLSTR

    • S3*_SL_1_RBT_*.SEN3
    • S3*_SL_2_FRP_*.SEN3
    • S3*_SL_2_LST_*.SEN3
  • S3 SYNERGY

    • S3*_SY_2_AOD_*.SEN3
    • S3*_SY_2_SYN_*.SEN3
    • S3*_SY_2_VG1_*.SEN3
    • S3*_SY_2_VGP_*.SEN3
    • S3*_SY_2_VGK_*.SEN3
    • S3*_SY_2_V10_*.SEN3

S2 Products (MSI)

  • S2 MSI (L1A, L1B, L1C, L2A)
    • S2*_MSIL1A_*.SAFE
    • S2*_MSIL1C_*.SAFE
    • S2*_MSIL1B_*.SAFE
    • S2*_MSIL2A_*.SAFE

How to use converter

Show help

stb_convert_product --help

dry-run

Product conversion can be very time and space consuming.

Before running conversion it is preferable to launch a dry-run: a simulation that only show expected conversion but do not really do it.

To do dry run, add --dry-run to your command.

stb_convert_product --dry-run PRODUCT_PATH
# example:
# stb_convert_products.exe --dry-run Products/OLCI/S3B_OL_1_ERR____20230506T015316_20230506T015616_20230711T065804_0179_079_117______LR1_D_NR_003.SEN3
INFO      Conversion PLANNED
INFO      [dry-run] convert
INFO      [dry-run]   - S3B_OL_1_ERR____20230506T015316_20230506T015616_20230711T065804_0179_079_117______LR1_D_NR_003.SEN3
INFO      [dry-run]   ---> .../S03OLCERR_20230506T015316_0179_B117_T409.zarr

Convert one product

To convert directly one product, pass "product path" to command

stb_convert_product PRODUCT_PATH
# example:
# stb_convert_products.exe Products/OLCI/S3B_OL_1_ERR____20230506T015316_20230506T015616_20230711T065804_0179_079_117______LR1_D_NR_003.SEN3

To specify output dir, simply use --output-dir

stb_convert_product PRODUCT_PATH --output-dir OUTPUT_DIR
# example:
# stb_convert_products.exe --output-dir ZARR/OLCI/ Products/OLCI/S3B_OL_1_ERR____20230506T015316_20230506T015616_20230711T065804_0179_079_117______LR1_D_NR_003.SEN3

Convert multiple products

To convert all products stored in one directory, use options --input-dir and --recursive.

stb_convert_product --input-dir PRODUCT_DIR --output-dir OUTPUT_DIR --recursive

Example:

stb_convert_products.exe --output-dir ZARR --input-dir Products --recursive --dry-run
INFO      Conversion PLANNED
INFO      [dry-run] convert
INFO      [dry-run]   - OLCI/S3A_OL_0_CR0____20220511T202328_20220511T202413_20220511T213302_0045_085_142______PS1_O_NR_002.SEN3
INFO      [dry-run]   ---> .../ZARR/OLCI/S03OLCCR0_20220511T202328_0045_A142_T8D0.zarr
INFO      [dry-run] convert
INFO      [dry-run]   - OLCI/S3A_OL_0_EFR____20230512T011844_20230512T012042_20230512T031619_0118_098_345______PS1_O_NR_002.SEN3
INFO      [dry-run]   ---> .../ZARR/OLCI/S03OLCL0__20230512T011844_0118_A345_TC85.zarr
INFO      [dry-run] convert
INFO      [dry-run]   - OLCI/S3A_OL_2_LFR____20191227T124111_20191227T124411_20221209T133032_0179_053_109______PS1_D_NR_002.SEN3
INFO      [dry-run]   ---> .../ZARR/OLCI/S03OLCLFR_20191227T124111_0179_A109_T27B.zarr
...

How to use converter - Python way

First import convert_sentinel_products function from sentineltoolbox.stb_converter.universal_convert And call it with arguments corresponding to command line:

  • explicit_user_inputs : list of str or Path A list of explicit user-provided Sentinel product file paths or names to be converted.

  • input_dir : str or None, optional Directory containing Sentinel products to be converted. If not specified, explicit_user_inputs will be used instead. Default is None.

  • output_dir : str or None, optional Directory to save the converted products. Defaults to None (current directory).

  • dry_run : bool, optional If True, only logs the conversion actions without performing any changes. Defaults to False.

  • recursive : bool, optional If True, the input_dir will be searched recursively for Sentinel products. Defaults to False.

Here previous command line examples:

from sentineltoolbox.stb_converter.universal_convert import convert_sentinel_products

# stb_convert_products.exe --dry-run Products/OLCI/S3B_OL_1_ERR____20230506T015316_20230506T015616_20230711T065804_0179_079_117______LR1_D_NR_003.SEN3
S3B_OL_1_ERR = "Products/OLCI/S3B_OL_1_ERR____20230506T015316_20230506T015616_20230711T065804_0179_079_117______LR1_D_NR_003.SEN3"
input_lst = [S3B_OL_1_ERR]
convert_sentinel_products(input_lst, dry_run=True)

# stb_convert_products.exe --dry-run Products/OLCI/S3B_OL_1_ERR____20230506T015316_20230506T015616_20230711T065804_0179_079_117______LR1_D_NR_003.SEN3
convert_sentinel_products(input_lst)

# stb_convert_products.exe --output-dir ZARR/OLCI/ Products/OLCI/S3B_OL_1_ERR____20230506T015316_20230506T015616_20230711T065804_0179_079_117______LR1_D_NR_003.SEN3
convert_sentinel_products(input_lst, output_dir="ZARR/OLCI/")

# stb_convert_product --input-dir PRODUCT_DIR --output-dir OUTPUT_DIR --recursive
convert_sentinel_products(input_dir="PRODUCT_DIR", output_dir="OUTPUT_DIR", recursive=True)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sentineltoolbox-0.2.4-py3-none-any.whl (503.1 kB view details)

Uploaded Python 3

File details

Details for the file sentineltoolbox-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for sentineltoolbox-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c1c5e84aefc79acc48d57e37220f840eeccdbddd52e8e1efc49031dbc20f02f9
MD5 30fc1901351fd2d0016a0a1fa41b0f0e
BLAKE2b-256 fb49c7ce9e54d042c2ad8ebd9a74714aa234d7663bd255ef25d1c5732cba38e3

See more details on using hashes here.

Supported by

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