By default i.sentinel.import imports all Sentinel scene files found in the input directory. The number of scene files can be optionally reduced by the pattern_file option. In this option, a regular expression for filtering the file names should be given, e.g. "MSIL2A.*T32VNR_2019" for importing only level 2A products for tile T32VNR from 2019.
By default i.sentinel.import imports the full scene. Optionally, the import can be reduced to the computational region extent with extent=region.
Note that in the case that spatial reference system of input data differs from GRASS GIS location, the input data need to be reprojected with r.import. To speed up this process, a higher than default value can be specified for the memory option.
In order to ignore insignificant mismatch of the spatial reference systems, the projection check can be suppressed with the -o flag.
Optionally input data can be linked by r.external when -l is given. Note that linking data requires that Sentinel input data and GRASS location have the same spatial reference system (e.g., the same UTM zone).
The number of imported Sentinel bands can be optionally reduced by the pattern option. Below an overview of the Sentinel-2 MSI band spatial resolutions:
Spatial resolution [m] | S2 Bands |
---|---|
10 | B02, B03, B04, B08 |
20 | B05, B06, B07, B8A, B11, B12 |
60 | B01, B09, B10 |
Level 2A (L2A) products for Sentinel-2 come with a scene classification (SCL layer) at 20m and 60m resolution, that e.g. can be used for masking clouds and snow and is also imported by default.
For each imported band both scene and band specific metadata on geometric conditions as well as quality indicators are written into the map history (r.support). In addition, the scene name is stored as source1 and the imported or linked file name as source2. Also, sensing time is written into the timestamp of the map. After import, the metadata can be retrieved with r.info -e as shown below.
SATELLITE=S2B CLOUDY_PIXEL_PERCENTAGE=1.250696 DEGRADED_MSI_DATA_PERCENTAGE=0 NODATA_PIXEL_PERCENTAGE=58.089572 SATURATED_DEFECTIVE_PIXEL_PERCENTAGE=0.000000 DARK_FEATURES_PERCENTAGE=4.668012 CLOUD_SHADOW_PERCENTAGE=0.572569 VEGETATION_PERCENTAGE=45.350337 NOT_VEGETATED_PERCENTAGE=1.179313 WATER_PERCENTAGE=44.793952 UNCLASSIFIED_PERCENTAGE=2.184867 MEDIUM_PROBA_CLOUDS_PERCENTAGE=0.620685 HIGH_PROBA_CLOUDS_PERCENTAGE=0.570162 THIN_CIRRUS_PERCENTAGE=0.059849 SNOW_ICE_PERCENTAGE=0.000253 RADIATIVE_TRANSFER_ACCURACY=0.0 WATER_VAPOUR_RETRIEVAL_ACCURACY=0.0 AOT_RETRIEVAL_ACCURACY=0.0 MEAN_SUN_ZENITH_GRID_ANGLE=63.9790718336484 MEAN_SUN_AZIMUTH_GRID_ANGLE=180.4378695652174 MEAN_SUN_ZENITH_ANGLE=63.9790721741866 MEAN_SUN_AZIMUTH_ANGLE=180.437882291128 ZENITH_ANGLE_5=9.9540335513936 AZIMUTH_ANGLE_5=295.354861828927 |
By register_file option i.sentinel.import allows creating a file which can be used to register imported imagery data into space-time raster dateset (STRDS) by t.register. Note that currently a register file can be created only for Sentinel-2 data. See example below.
i.sentinel.import -p input=data data/S2B_MSIL1C_20180216T102059_N0206_R065_T32UPB_20180216T140508.SAFE/GRANULE/.../T32UPB_20180216T102059_B04.jp2 1 (EPSG: 32632) data/S2B_MSIL1C_20180216T102059_N0206_R065_T32UPB_20180216T140508.SAFE/GRANULE/.../T32UPB_20180216T102059_B07.jp2 1 (EPSG: 32632) data/S2B_MSIL1C_20180216T102059_N0206_R065_T32UPB_20180216T140508.SAFE/GRANULE/.../T32UPB_20180216T102059_B11.jp2 1 (EPSG: 32632)
i.sentinel.import -j input=data
Limit import to only to 4th and 8th bands:
i.sentinel.import -j input=data pattern='B0(4|8)'
Limit import to all bands with 10m resolution (excluding AOT, WVP, ... bands):
i.sentinel.import -j input=data pattern='B0(2|3|4|8)_10m'
Limit import to only selected bands with 10m and 20m resolution (excluding AOT, WVP, ... bands):
i.sentinel.import -j input=data pattern='B(02_1|03_1|04_1|08_1|11_2)0m'
Limit import to all bands with 10m and 20m resolution (excluding AOT, WVP, ... bands):
i.sentinel.import -j input=data pattern='_B((0[2348]_1)|(0[567]|8A|11|12)_2)0m'
Import cloud and shadow mask:
i.sentinel.import input=data i.sentinel.import input=data -c -s i.sentinel.import input=data cloud_probability_threshold=25 cloud_area_threshold=10 -c -s
Link data from specific UTM zone while ignoring projection check
i.sentinel.import -l -o -j input=data pattern_file="_T32"
Limit import to only bands 3 and 4 from level 2A products for tile T32VNR in 2019
i.sentinel.import -j input=data pattern_file="MSIL2A.*T32VNR_2019" pattern='B(03|04)'
Limit import to only bands 3 and 4 from level 2A products for tile T32VNR in 2019, unzip to directory "safefiles_dir":
i.sentinel.import -j input=data unzip_dir=safefiles_dir pattern_file="MSIL2A.*T32VNR_2019" pattern='B(03|04)'
i.sentinel.import -j input=data register_output=t_register.txt # register imported data into existing STRDS t.register input=sentinel_ds file=t_register.txt
# register file produced by stable GRASS GIS 7.8 version T33UVR_20181205T101401_B05|2018-12-05 10:16:43.275000 T33UVR_20181205T101401_B03|2018-12-05 10:16:43.275000 T33UVR_20181205T101401_B06|2018-12-05 10:16:43.275000 ... # register file produced by development GRASS GIS 7.9 version T33UVR_20181205T101401_B05|2018-12-05 10:16:43.275000|S2_5 T33UVR_20181205T101401_B03|2018-12-05 10:16:43.275000|S2_3 T33UVR_20181205T101401_B06|2018-12-05 10:16:43.275000|S2_6
i.sentinel.download, i.sentinel.preproc, i.sentinel.mask, r.import, r.external, v.import
See also GRASS GIS Workshop in Jena for usage examples.
Available at: i.sentinel.import source code (history)
Latest change: Tuesday Nov 05 09:35:47 2024 in commit: f00067506253c89598cffadc3c7fa07cff7233fd
Main index | Imagery index | Topics index | Keywords index | Graphical index | Full index
© 2003-2024 GRASS Development Team, GRASS GIS 8.4.1dev Reference Manual