vrt.PixelFunction

A GDAL built-in pixel function applied by a derived band.

Usage

Source

vrt.PixelFunction(
    name,
    args=dict(),
    transfer_type=None,
)

Parameters

name: str

GDAL pixel function name, such as "dB" or "div".

args: dict[str, str | int | float] = dict()

Pixel function arguments; values are stored as strings.

transfer_type: str | None = None
NumPy dtype name the sources are read as before the function runs.

Methods

Name Description
__post_init__() Store argument values as strings, as they read back from XML.
db() Convert to decibels.
diff() Subtract the second source from the first.
div() Divide the first source by the second.
maximum() Take the per-pixel maximum of the sources.
mean() Take the per-pixel mean of the sources.
minimum() Take the per-pixel minimum of the sources.
scale() Apply the source’s scale and offset.

__post_init__()

Store argument values as strings, as they read back from XML.

Usage

Source

__post_init__()

db()

Convert to decibels.

Usage

Source

db(fact=10)
Parameters
fact: (10, 20) = 10
10 for intensity, 20 for amplitude.
Returns
PixelFunction
fact * log10(x).

diff()

Subtract the second source from the first.

Usage

Source

diff()
Returns
PixelFunction
The diff pixel function.

div()

Divide the first source by the second.

Usage

Source

div()
Returns
PixelFunction
The div pixel function.

maximum()

Take the per-pixel maximum of the sources.

Usage

Source

maximum()
Returns
PixelFunction
The max pixel function.

mean()

Take the per-pixel mean of the sources.

Usage

Source

mean()
Returns
PixelFunction
The mean pixel function.

minimum()

Take the per-pixel minimum of the sources.

Usage

Source

minimum()
Returns
PixelFunction
The min pixel function.

scale()

Apply the source’s scale and offset.

Usage

Source

scale()
Returns
PixelFunction
The scale pixel function.