Dequantise¶
aef_bng.dequantise
¶
AEF embedding dequantisation.
Converts raw signed int8 AEF embeddings to analysis-ready float32 values in the range [-1, 1].
The mapping is
de_quantized = (value / 127.5) ** 2 * sign(value)
where -128 is reserved as nodata.
dequantise(values)
¶
Dequantise raw int8 AEF embedding values to float32.
Maps int8 [-127, 127] to float32 [-1, 1] using the AEF dequantisation formula. Nodata pixels (-128) become NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
ndarray
|
Array of raw int8 pixel values. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Float32 array of analysis-ready values in [-1, 1]. |
ndarray
|
Nodata (-128) values are set to NaN. |
Source code in aef_bng/dequantise.py
dequantise_table(table)
¶
Dequantise all band columns (A00..A63) in an Arrow table.
Replaces each int8 band column with a float32 dequantised column. Non-band columns are passed through unchanged.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Table
|
Arrow table with int8 band columns named A00..A63. |
required |
Returns:
| Type | Description |
|---|---|
Table
|
Arrow table with float32 band columns. |
Source code in aef_bng/dequantise.py
dequantise_dataframe(df)
¶
Dequantise all band columns (A00..A63) in a pandas DataFrame.
Replaces each int8 band column with a float32 dequantised column. Non-band columns are passed through unchanged.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
DataFrame with int8 band columns named A00..A63. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with float32 band columns. |
Source code in aef_bng/dequantise.py
dequantise_spark(df)
¶
Dequantise all 64 band columns (A00..A63) in a PySpark DataFrame.
Maps int8 [-127, 127] → float [-1, 1] using: (value / 127.5)² x sign(value) Nodata (-128) becomes null.