GRASS logo

Note: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.

Note: This addon document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade your GRASS GIS installation, and read the current addon manual page.

NAME

i.zero2null - Replaces zero values with null at edges, otherwise replaces zero values with appropriate neighboring values.

KEYWORDS

imagery, satellite

SYNOPSIS

i.zero2null
i.zero2null --help
i.zero2null map=name[,name,...] [--help] [--verbose] [--quiet] [--ui]

Flags:

--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

map=name[,name,...] [required]
Name of raster map(s)

Table of contents

DESCRIPTION

i.zero2null replaces zero cells with NULL cells at the edges of imagery, e.g. Sentinel-2 scenes.

Sentinel-2 scenes can also have small patches of zero cells, typically in water bodies. These patches are removed and filled with neighboring cells.

EXAMPLE

The Sentinel-2 scene S2B_MSIL2A_20190724T103029_N0213_R108_T32ULA_20190724T130550, uuid: 0a7cb5ee-80d4-4d15-be19-0b3fdf40791f shows unexpected no-data pixels in lakes.
# download S2 scene affected by no.data pixels within the scene
i.sentinel.download settings=credentials.txt \
  uuid=0a7cb5ee-80d4-4d15-be19-0b3fdf40791f output=test_s2_scene

# show lst of granules in scene
i.sentinel.import -p input=test_s2_scene

# import selected bands of scene
i.sentinel.import input=test_s2_scene pattern='B0(2|3|4|8)_10m'
g.list raster
g.region raster=T32ULA_20190724T103029_B04_10m -p
i.zero2null example 1
Figure: Sentinel-2 red band with undesired 0-value pixels
# zoom to scene subset with undesired 0-value pixels
g.region n=5516940 s=5516840 w=334410 e=334550 res=10
# visualize pixel values, e.g. in red band
d.rast T32ULA_20190724T103029_B04_10m
d.rast.num T32ULA_20190724T103029_B04_10m text_color=blue

# fix 0-value pixels
i.zero2null map=T32ULA_20190724T103029_B02_10m,T32ULA_20190724T103029_B03_10m,T32ULA_20190724T103029_B04_10m,T32ULA_20190724T103029_B08_10m
# visualize updated pixel values (0 values now replaced), e.g. in red band
d.rast T32ULA_20190724T103029_B04_10m
d.rast.num T32ULA_20190724T103029_B04_10m text_color=blue
i.zero2null example 2
Figure: Sentinel-2 red band after correction with i.zero2null

SEE ALSO

i.sentinel module set

AUTHOR

Markus Metz, mundialis

SOURCE CODE

Available at: i.zero2null source code (history)

Latest change: Monday Jun 28 07:54:09 2021 in commit: 1cfc0af029a35a5d6c7dae5ca7204d0eb85dbc55


Note: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.

Note: This addon document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade your GRASS GIS installation, and read the current addon manual page.

Main index | Imagery index | Topics index | Keywords index | Graphical index | Full index

© 2003-2023 GRASS Development Team, GRASS GIS 7.8.9dev Reference Manual