## vrt.PixelFunction


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


Usage

``` python
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__()](#__post_init__) | Store argument values as strings, as they read back from XML. |
| [db()](#db) | Convert to decibels. |
| [diff()](#diff) | Subtract the second source from the first. |
| [div()](#div) | Divide the first source by the second. |
| [maximum()](#maximum) | Take the per-pixel maximum of the sources. |
| [mean()](#mean) | Take the per-pixel mean of the sources. |
| [minimum()](#minimum) | Take the per-pixel minimum of the sources. |
| [scale()](#scale) | Apply the source's scale and offset. |

------------------------------------------------------------------------


#### \_\_post_init\_\_()


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


Usage

``` python
__post_init__()
```


------------------------------------------------------------------------


#### db()


Convert to decibels.


Usage

``` python
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

``` python
diff()
```


##### Returns


`PixelFunction`  
The [diff](vrt.PixelFunction.md#freezebase.vrt.PixelFunction.diff) pixel function.


------------------------------------------------------------------------


#### div()


Divide the first source by the second.


Usage

``` python
div()
```


##### Returns


`PixelFunction`  
The [div](vrt.PixelFunction.md#freezebase.vrt.PixelFunction.div) pixel function.


------------------------------------------------------------------------


#### maximum()


Take the per-pixel maximum of the sources.


Usage

``` python
maximum()
```


##### Returns


`PixelFunction`  
The `max` pixel function.


------------------------------------------------------------------------


#### mean()


Take the per-pixel mean of the sources.


Usage

``` python
mean()
```


##### Returns


`PixelFunction`  
The [mean](vrt.PixelFunction.md#freezebase.vrt.PixelFunction.mean) pixel function.


------------------------------------------------------------------------


#### minimum()


Take the per-pixel minimum of the sources.


Usage

``` python
minimum()
```


##### Returns


`PixelFunction`  
The `min` pixel function.


------------------------------------------------------------------------


#### scale()


Apply the source's scale and offset.


Usage

``` python
scale()
```


##### Returns


`PixelFunction`  
The [scale](vrt.PixelFunction.md#freezebase.vrt.PixelFunction.scale) pixel function.
