Skip to content

i.sentinel.coverage

Checks the area coverage of Sentinel-1 or Sentinel-2 scenes selected by filters.

i.sentinel.coverage settings=name area=name [start=string] [end=string] [producttype=string] [clouds=integer] [minpercent=integer] [names=string [,string,...]] [output=name] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

i.sentinel.coverage settings=name area=name

grass.script.run_command("i.sentinel.coverage", settings, area, start=None, end=None, producttype="S2MSI2A", clouds=None, minpercent=None, names=None, output=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("i.sentinel.coverage", settings="name", area="name")

Parameters

settings=name [required]
    Full path to settings file (user, password)
    Name of input file
area=name [required]
    Name of input vector map
    Area input vector maps
start=string
    Start date ('YYYY-MM-DD')
end=string
    End date ('YYYY-MM-DD')
producttype=string
    Sentinel product type to filter
    Allowed values: SLC, GRD, OCN, S2MSI1C, S2MSI2A, S2MSI2Ap
    Default: S2MSI2A
clouds=integer
    Maximum cloud cover percentage for Sentinel scene
minpercent=integer
    Minimal percentage of coverage for Sentinel scene; error otherwise
names=string [,string,...]
    Sentinel-1 or Sentinel-2 names
output=name
    Output file with a list of Sentinel-1 or Sentinel-2 scene names
    Name for output file
--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

settings : str, required
    Full path to settings file (user, password)
    Name of input file
    Used as: input, file, name
area : str, required
    Name of input vector map
    Area input vector maps
    Used as: input, vector, name
start : str, optional
    Start date ('YYYY-MM-DD')
end : str, optional
    End date ('YYYY-MM-DD')
producttype : str, optional
    Sentinel product type to filter
    Allowed values: SLC, GRD, OCN, S2MSI1C, S2MSI2A, S2MSI2Ap
    Default: S2MSI2A
clouds : int, optional
    Maximum cloud cover percentage for Sentinel scene
minpercent : int, optional
    Minimal percentage of coverage for Sentinel scene; error otherwise
names : str | list[str], optional
    Sentinel-1 or Sentinel-2 names
output : str, optional
    Output file with a list of Sentinel-1 or Sentinel-2 scene names
    Name for output file
    Used as: output, file, name
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

i.sentinel.coverage is a GRASS GIS addon Python script to check the area coverage by Sentinel scenes selected by a filter.

The coverage test considers only the geometric coverage by Sentinel scene footprints and does not include the cloud covered pixels.

EXAMPLES

Check Sentinel-1 scenes by region, start and end time

Note that only the last 12 months of Sentinel data are online available ESA Hub, older scenes are stored in the Long Term Archive (LTA) and cannot be retrieved immediately. The example is based on the North Carolina dataset:

# extract Durham (NC) county
v.extract input=boundary_county output=county_durham where="NAME = 'DURHAM'"

# simplify geometry (needed for ESA Hub)
v.generalize input=county_durham output=county_durham_dp1000 method=douglas threshold=1000

# search for SLC scenes in certain period of time
i.sentinel.coverage settings=credentials.txt output=s1names.txt \
  producttype=SLC minpercent=95 area=county_durham_dp1000 start=2020-10-01 end=2021-01-31

Check Sentinel-2 scenes by region, cloud coverage, start and end time

Note that only the last 12 months of Sentinel data are online available ESA Hub, older scenes are stored in the Long Term Archive (LTA) and cannot be retrieved immediately. The example is based on the North Carolina dataset:

# extract Durham (NC) county
v.extract input=boundary_county output=county_durham where="NAME = 'DURHAM'"

# simplify geometry (needed for ESA Hub)
v.generalize input=county_durham output=county_durham_dp1000 method=douglas threshold=1000

# search for L2A scenes with minimal clouds in certain period of time
i.sentinel.coverage settings=credentials.txt output=s2names.txt \
  producttype=S2MSI2A clouds=10 minpercent=95 area=county_durham_dp1000 start=2020-10-01 end=2021-01-31

Check Sentinel-2 scenes by names

i.sentinel.coverage settings=credentials.txt output=s2names.txt \
  names=S2A_MSIL2A_20200104T024111_N0213_R089_T49MGU_20200104T061337,S2B_MSIL2A_20200129T023939_N0213_R089_T49MGU_20200201T153252 \
  producttype=S2MSI2A clouds=20 minpercent=95 area=mangkawuk

Use retrieved Sentinel-2 scene names for import

When storing the list of scenes into a file, this resulting file can be used for a parallelized import, using the t.sentinel set of addons:

# install t.sentinel.import and related addons
g.extension extension=t.sentinel url=https://github.com/mundialis/t.sentinel

# download and import into space-time cube (STRDS), using 4 CPUs
t.sentinel.import settings=credentials.txt s2names=s2names.txt nprocs=4 \
  pattern='B(02_10|03_10|04_10|08_10)m' strds_output=s2_myarea directory=s2_data/

SEE ALSO

i.sentinel.download, v.dissolve, v.overlay, v.to.db

AUTHOR

Anika Weinmann, mundialis

SOURCE CODE

Available at: i.sentinel.coverage source code (history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit 53de819