API reference¶
Small example functions. Replace them with your own code.
linear_to_db(intensity, floor=1e-10)
¶
Convert linear SAR intensity (e.g. sigma0) to decibels.
Values below floor are clipped to avoid log10(0).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
intensity
|
ArrayLike
|
Linear intensity values. |
required |
floor
|
float
|
Smallest value used before taking the logarithm. |
1e-10
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
The intensity in dB. |
Examples:
>>> linear_to_db([1.0, 0.1]).tolist()
[0.0, -10.0]
Source code in src/mypackage/core.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | |
normalize(image, eps=1e-12)
¶
Scale an array to zero mean and unit standard deviation, ignoring NaNs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
ArrayLike
|
Input array, e.g. a SAR backscatter image in dB. |
required |
eps
|
float
|
Small constant that prevents division by zero for constant images. |
1e-12
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
The normalized array, with NaNs preserved. |
Examples:
>>> normalize([1.0, 3.0]).round(6).tolist()
[-1.0, 1.0]
Source code in src/mypackage/core.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |