GDAL_CALC(1) GDAL GDAL_CALC(1) NAME gdal_calc - Command line raster calculator with numpy syntax. SYNOPSIS gdal_calc.py [--help] [--help-general] --calc=expression --outfile= [-A ] [--A_band=] [-B...-Z ] [] DESCRIPTION Command line raster calculator with numpy syntax. Use any basic arithmetic supported by numpy arrays such as +, -, *, and / along with logical operators such as >. Note that all files must have the same dimensions (unless extent option is used), but no projection checking is performed (unless projectionCheck option is used). --help Show this help message and exit --help-general Gives a brief usage message for the generic GDAL commandline options and exit. --calc= Calculation in numpy syntax using +, -, /, *, or any numpy array functions (i.e. log10()). Multiple --calc options can be listed to produce a multiband file (GDAL >= 3.2). -A Input gdal raster file, you can use any letter (a-z, A-Z). (lower case supported since GDAL 3.3) A letter may be repeated, or several values (separated by space) can be provided (GDAL >= 3.3). Since GDAL 3.5, wildcard exceptions (using ?, *) are supported for all shells/platforms. The effect will be to create a 3-dim numpy array. In such a case, the calculation formula must use this input as a 3-dim array and must return a 2D array (see examples below). In case the calculation does not return a 2D array an error would be generated. --A_band= Number of raster band for file A (default 1). --outfile= Output file to generate or fill. --NoDataValue= Output NoDataValue (default datatype specific value). To indicate not setting a NoDataValue use --NoDataValue=none (GDAL >= 3.3) NOTE: Using the Python API: None value will indicate default datatype specific value. 'none' value will indicate not setting a NoDataValue. --hideNoData New in version 3.3. Ignores the input bands NoDataValue. By default, the input bands NoDataValue are not participating in the calculation. By setting this setting - no special treatment will be performed on the input NoDataValue. and they will be participating in the calculation as any other value. The output will not have a set NoDataValue, unless you explicitly specified a specific value by setting --NoDataValue=. --type= Output datatype, must be one of [Byte, Int8, UInt16, Int16, UInt32, Int32, UInt64, Int64, Float64, Float32, CInt16, CInt32, CFloat64, CFloat32]. NOTE: Despite the datatype set using --type, when doing intermediate aritmethic operations using operands of the same type, the operation result will honor the original datatype. This may lead into unexpected results in the final result. NOTE: UInt64, Int64, CInt16, CInt32, CFloat32, CFloat64 have been added in GDAL 3.5.3 Int8 has been added in GDAL 3.7 --format= GDAL format for output file. --color-table= Allows specifying a filename of a color table (or a ColorTable object) (with Palette Index interpretation) to be used for the output raster. Supported formats: txt (i.e. like gdaldem, but color names are not supported), qlr, qml (i.e. exported from QGIS) --extent=