vrt.derive()
Derive bands from rasters or VRTs with a GDAL pixel function.
Usage
vrt.derive(
sources,
function,
*,
dtype="float32",
nodata=math.nan,
description="",
band=None
)Parameters
sources: str | Path | UPath | VRT | Sequence[str | Path | UPath | VRT]-
One input, or several on an identical grid. A VRT is nested whole, so the function sees its mosaicked pixels.
function: PixelFunction-
Function applied to the sources.
propagateNoDatais set to"true"unless its arguments already set it, so a nodata input gives a nodata output. dtype: str = "float32"-
NumPy dtype name of the derived bands.
nodata: float | None = math.nan-
NODATA of the derived bands.
description: str = ""-
Description of every derived band.
band: int | None = None- 1-based band read from each input. With several inputs it defaults to 1; with one input, it derives only that band instead of every band.
Returns
VRT-
With one input, a derived band per input band; with several, one derived band. Each source carries its input’s NODATA, and
transfer_typedefaults todtype.