GRASS logo


r.bitpattern - Compares bit patterns with a raster map.


raster, algebra


r.bitpattern --help
r.bitpattern input=name output=name pattern=integer patval=integer [--overwrite] [--help] [--verbose] [--quiet] [--ui]


Allow output files to overwrite existing files
Print usage summary
Verbose module output
Quiet module output
Force launching GUI dialog


input=name [required]
Name of input raster map
output=name [required]
Name for output raster map
pattern=integer [required]
Bit pattern position(s)
patval=integer [required]
Bit pattern value

Table of contents


r.bitpattern performs bit pattern comparisons. The module can be used to pixelwise verify a satellite image for low quality pixels if a Quality Control Bit Index map is provided (e.g. as for MODIS sensor maps). The functionality is two-fold:
  1. define position: set bit(s) to 1 which shall match, then convert this position pattern to integer, set pattern= parameter with that integer value
  2. define pattern *value* which should be in that position: first bit pattern of value, convert to integer, set patval= parameter
If several bitpatterns have to be tested, the resulting maps can be used to exclude low quality pixel in the input satellite image using r.mapcalc (OR and NOT operators).


  1. define position:
    	xx xx 1x xx
    	binary: 1000 -> integer: 8 -> pattern=8
  2. define value:
            Ex.: we want to check for 0 in that position
    	xx xx 0x xx
    	binary: 0000 -> integer: 0 -> patval=0
            if value can be arbitray (0/1), then assume 0 value


i.modis.qc, r.mapcalc


Radim Blazek, Markus Neteler

Last changed: $Date: 2013-10-02 22:30:48 +0200 (Wed, 02 Oct 2013) $


Available at: r.bitpattern source code (history)

Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2017 GRASS Development Team, GRASS GIS 7.2.3svn Reference Manual