Skip to content

i.sentinel3.import

Import and pre-process Sentinel-3 data from the Copernicus program

i.sentinel3.import [-cdenjkopr] input=string [,string,...] product_type=string bands=string [,string,...] [ancillary_bands=string [,string,...]] [flag_bands=string [,string,...]] [basename=string] [register_output=name] [metadata=name] [maximum_solar_angle=float] [nprocs=integer] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

i.sentinel3.import input=string product_type=S3SL2LST bands=all

grass.tools.Tools.i_sentinel3_import(input, product_type="S3SL2LST", bands="all", ancillary_bands=None, flag_bands=None, basename=None, register_output=None, metadata=None, maximum_solar_angle=None, nprocs=0, flags=None, overwrite=None, verbose=None, quiet=None, superquiet=None)

Example:

tools = Tools()
tools.i_sentinel3_import(input="string", product_type="S3SL2LST", bands="all")

This grass.tools API is experimental in version 8.5 and expected to be stable in version 8.6.

grass.script.run_command("i.sentinel3.import", input, product_type="S3SL2LST", bands="all", ancillary_bands=None, flag_bands=None, basename=None, register_output=None, metadata=None, maximum_solar_angle=None, nprocs=0, flags=None, overwrite=None, verbose=None, quiet=None, superquiet=None)

Example:

gs.run_command("i.sentinel3.import", input="string", product_type="S3SL2LST", bands="all")

Parameters

input=string [,string,...] [required]
    Sentinel-3 input data
    Either a (commaseparated list of) path(s) to Sentinel-3 zip files or a textfile with such paths (one per row)
product_type=string [required]
    Sentinel-3 product type to import (currently, only S3SL1RBT and S3SL2LST are supported)
    Allowed values: S3SL1RBT, S3SL2LST
    Default: S3SL2LST
bands=string [,string,...] [required]
    Data bands to import (e.g. LST, default is all available)
    Default: all
ancillary_bands=string [,string,...]
    Ancillary data bands to import (e.g. biome, default is None, use "all" to import all available)
flag_bands=string [,string,...]
    Quality flag bands to import (e.g. bayes_in, default is None, use "all" to import all available)
basename=string
    Basename used as prefix for map names (default is derived from the input file(s))
register_output=name
    Name for output file to use with t.register
metadata=name
    Name of directory into which Sentinel metadata json dumps are saved
maximum_solar_angle=float
    Import only pixels where solar angle is lower than the given maximum
nprocs=integer
    Number of threads for parallel computing
    0: use OpenMP default; >0: use nprocs; <0: use MAX-nprocs
    Default: 0
-c
    Import LST in degree celsius (default is kelvin)
-d
    Import data with decimals as double precision
-e
    Import also elevation from the geolocation of the product
-n
    Import data at native resolution of the bands (default is use current region)
-j
    Write metadata json for each band to LOCATION/MAPSET/cell_misc/BAND/description.json
-k
    Keep original cell values during interpolation (see: r.fill.stats)
-o
    Process oblique view (default is nadir)
-p
    Print names of the maps that would be imported and exit
-r
    Rescale radiance bands to reflectance
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

input : str | list[str], required
    Sentinel-3 input data
    Either a (commaseparated list of) path(s) to Sentinel-3 zip files or a textfile with such paths (one per row)
product_type : str, required
    Sentinel-3 product type to import (currently, only S3SL1RBT and S3SL2LST are supported)
    Allowed values: S3SL1RBT, S3SL2LST
    Default: S3SL2LST
bands : str | list[str], required
    Data bands to import (e.g. LST, default is all available)
    Default: all
ancillary_bands : str | list[str], optional
    Ancillary data bands to import (e.g. biome, default is None, use "all" to import all available)
flag_bands : str | list[str], optional
    Quality flag bands to import (e.g. bayes_in, default is None, use "all" to import all available)
basename : str, optional
    Basename used as prefix for map names (default is derived from the input file(s))
register_output : str, optional
    Name for output file to use with t.register
    Used as: output, file, name
metadata : str, optional
    Name of directory into which Sentinel metadata json dumps are saved
    Used as: input, dir, name
maximum_solar_angle : float, optional
    Import only pixels where solar angle is lower than the given maximum
nprocs : int, optional
    Number of threads for parallel computing
    0: use OpenMP default; >0: use nprocs; <0: use MAX-nprocs
    Default: 0
flags : str, optional
    Allowed values: c, d, e, n, j, k, o, p, r
    c
        Import LST in degree celsius (default is kelvin)
    d
        Import data with decimals as double precision
    e
        Import also elevation from the geolocation of the product
    n
        Import data at native resolution of the bands (default is use current region)
    j
        Write metadata json for each band to LOCATION/MAPSET/cell_misc/BAND/description.json
    k
        Keep original cell values during interpolation (see: r.fill.stats)
    o
        Process oblique view (default is nadir)
    p
        Print names of the maps that would be imported and exit
    r
        Rescale radiance bands to reflectance
overwrite : bool, optional
    Allow output files to overwrite existing files
    Default: None
verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None

Returns:

result : grass.tools.support.ToolResult | None
If the tool produces text as standard output, a ToolResult object will be returned. Otherwise, None will be returned.

Raises:

grass.tools.ToolError: When the tool ended with an error.

input : str | list[str], required
    Sentinel-3 input data
    Either a (commaseparated list of) path(s) to Sentinel-3 zip files or a textfile with such paths (one per row)
product_type : str, required
    Sentinel-3 product type to import (currently, only S3SL1RBT and S3SL2LST are supported)
    Allowed values: S3SL1RBT, S3SL2LST
    Default: S3SL2LST
bands : str | list[str], required
    Data bands to import (e.g. LST, default is all available)
    Default: all
ancillary_bands : str | list[str], optional
    Ancillary data bands to import (e.g. biome, default is None, use "all" to import all available)
flag_bands : str | list[str], optional
    Quality flag bands to import (e.g. bayes_in, default is None, use "all" to import all available)
basename : str, optional
    Basename used as prefix for map names (default is derived from the input file(s))
register_output : str, optional
    Name for output file to use with t.register
    Used as: output, file, name
metadata : str, optional
    Name of directory into which Sentinel metadata json dumps are saved
    Used as: input, dir, name
maximum_solar_angle : float, optional
    Import only pixels where solar angle is lower than the given maximum
nprocs : int, optional
    Number of threads for parallel computing
    0: use OpenMP default; >0: use nprocs; <0: use MAX-nprocs
    Default: 0
flags : str, optional
    Allowed values: c, d, e, n, j, k, o, p, r
    c
        Import LST in degree celsius (default is kelvin)
    d
        Import data with decimals as double precision
    e
        Import also elevation from the geolocation of the product
    n
        Import data at native resolution of the bands (default is use current region)
    j
        Write metadata json for each band to LOCATION/MAPSET/cell_misc/BAND/description.json
    k
        Keep original cell values during interpolation (see: r.fill.stats)
    o
        Process oblique view (default is nadir)
    p
        Print names of the maps that would be imported and exit
    r
        Rescale radiance bands to reflectance
overwrite : bool, optional
    Allow output files to overwrite existing files
    Default: None
verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None

DESCRIPTION

The i.sentinel3.import module allows importing Copernicus Sentinel-3 products.

The Sentinel-3 product types are provided in different formats. Not all of them are currently directly supported by GDAL. Some, like the SLSTR products, consist of several netCDF4 files, where geometry and image information are stored in different files. Therefore, a GRASS specific import routine has been implemented for those formats. This routine imports the data pixel-wise after transforming the coordinates from WGS84 into the projection of the current project. r.in.xyz is then used to read the values into a raster map. Thus, the user has to set the computational region extent to import the data of interest. The resolution is set from the resolution of the input bands and cells are aligned to the cells of the current region.

Currently, only import of the following product_types is implemented:

  • S3SL1RBT: SL_1_RBT__ products from Sentinel-3 SLSTR
  • S3SL2LST: SL_2_LST__ products from Sentinel-3 SLSTR

All Sentinel-3 scene files provided in the input option are mosaicked into one resulting granule with one map for each imported band. The input option accepts either one or many path(s) to Sentinel-3 archives (.zip) separated by comma or a text file with one Sentinel-3 archive per row. The module is designed to produce temporally non-overlapping mosaics along the tracks of the satellite. Input should therefore not mix data from different tracks, sensing periods, or missions (Sentinel-3A / Sentinel-3B). Scenes from different relative orbits cannot be merged and result in an error. The module gives a warning if scenes differ in other track properties (e.g. cycle or mission).

Users can provide a custom basename, to which band names are appended. Otherwise, the basename is constructed from the input scenes following the Sentinel-3 file naming convention. Here, the frame id is stripped from the resulting basename, the start of sensing time is set to the start of sensing time of the first input scene and the end of sensing time is set to the end of the last input scene.

Ancillary data and quality flag data can be imported as well using the ancillary_bands and flag_bands options. Here, the user has to specify the product specific band names or all to import all available bands of the given product type and processing baseline. Quality flags are imported as categorical maps with the flag meanings as category labels. The same applies to categorical ancillary bands like biome, whose class codes differ between processing baselines. The elevation of the pixels from the geolocation of the product (available for both product types) can be imported with the -e flag.

The available bands depend on the processing baseline of a product. For example, baseline 005 provides counter_water instead of probability_cloud_dual, probability_cloud_single and (RBT only) bayes, and adds the LST_uncertainty_* components as LST ancillary bands. In baseline 003, the RBT band F1 is provided on the 1 km grid (F1_BT_in instead of F1_BT_fn). Bands that are not available in a product are skipped, with a warning if the band was requested by name and only reported in verbose mode if it was requested with all. The -p flag lists the bands that may be available. Scenes that provide different bands (e.g. because of different processing baselines) cannot be merged and result in an error. The module has been tested with processing baselines 003, 004 and 005 and gives a warning for other (or undetectable) baselines.

For each imported band both scene and band specific metadata are written into the map history (r.support). Also, sensing time is written into the timestamp of the map. After import, the metadata can be retrieved with r.info -e.

i.sentinel3.import imports the selected bands with the resolution and extent of the current region (except for the solar bands), unless the -n flag is used to import bands with their native resolution (usually 500m or 1000m).

Pixels flagged as invalid in the product are not imported. Missing pixels are interpolated with r.fill.stats, which smooths the data unless the -k flag is used to keep the original values.

With the -r flag, radiance bands are rescaled to reflectance (this requires the solar angle bands, which are imported as well). The maximum_solar_angle option limits the import to pixels with a solar zenith angle lower than the given value. Both are only available for product type S3SL1RBT.

With the -c flag, the land surface temperature (LST) is imported in degree celsius instead of kelvin. The LST_uncertainty is a temperature difference, which has the same values in kelvin and degree celsius, so only its unit is set accordingly.

By default the nadir view is processed. With the -o flag the oblique view is processed instead (only available for product type S3SL1RBT).

NOTES

i.sentinel3.import does ONLY support projected coordinate systems and assumes map units to be meter.

By means of the register_output option i.sentinel3.import allows creating a file which can be used to register imported imagery data into a space-time raster dataset (STRDS) with t.register. See examples below.

With the -p flag the names of the maps that would be imported are printed and the module exits without importing anything. This can be used to check the result of a given combination of options, before importing large amounts of data.

Metadata storage

By using the -j flag the band metadata are additionally stored in JSON format (in the current mapset under cell_misc).

EXAMPLES

Import Sentinel-3 data

Import all Sentinel-3B RBT data of a given start date and track found in the data directory, store metadata as JSON files within the GRASS database directory, keep pixel values during interpolation (no smoothing), import bands at native resolution and rescale radiance bands to reflectance:

i.sentinel3.import -k -n -r -j \
    input="$(find data/ -iname "S3B*RBT*____20240129*_089_094_*.zip" | tr '\n' ',' | sed 's/,$/\n/')" \
    product_type=S3SL1RBT register_output=data/reg.txt nprocs=8 --v --o

# register imported data into existing STRDS
t.register input=Sentinel_3 file=data/reg.txt

Register imported Sentinel-3 data into STRDS

i.sentinel3.import -k -n -c -j \
    input="$(find data/ -iname "S3B*LST*____20240129*_089_094_*.zip" | tr '\n' ',' | sed 's/,$/\n/')" \
    product_type=S3SL2LST register_output=data/reg.txt nprocs=8 --v --o

# register imported data into existing STRDS
t.register input=Sentinel_3_LST file=data/reg.txt

A register file contains the following columns, separated by |: imported raster map name, start and end timestamp as well as the semantic label, see the example below:

S3B_SL_2_LST_20240129205026_20240129205326_089_094_ESA_O_NT_004_LST@PERMANENT|2024-01-29 20:50:26|2024-01-29 20:53:26|S3_LST
S3B_SL_2_LST_20240129205026_20240129205326_089_094_ESA_O_NT_004_LST_uncertainty@PERMANENT|2024-01-29 20:50:26|2024-01-29 20:53:26|S3_LST_uncertainty

REQUIREMENTS

The following Python libraries are required:

  • GDAL (install through system software management)
  • numpy
  • netcdf4
  • cf-units (for unit conversion)

SEE ALSO

Overview of i.sentinel toolset

i.sentinel.download, r.fill.stats, r.in.xyz, t.register

AUTHORS

Stefan Blumentrath, Norway

SOURCE CODE

Available at: i.sentinel3.import source code (history)
Latest change: Tuesday Nov 24 11:08:26 2026 in commit d996fef