Z-Split Normalization: Zero-Preserving Split Normalization for bipolar spectral indices
Project description
zsplit — Zero-Preserving Split Normalization
A normalization technique for bipolar spectral indices where zero carries physical meaning as a class boundary (e.g., water vs. non-water in flood detection).
Installation
pip install zsplit
With raster support:
pip install zsplit[raster]
Quick Start
import numpy as np
from zsplit import normalize
# Simulated raw ENDWI values (DN scale — extremely narrow range)
arr = np.array([-0.00041, -0.00020, 0.0, 0.00008, 0.00015])
result = normalize(arr)
print(result)
# [-1. -0.488 0. 0.533 1. ]
Raster Support
from zsplit import normalize_raster
normalize_raster('ENDWI_raw.tif', 'ENDWI_zsplit.tif')
Formula
⎧ x / max(X⁺) if x > 0 → [0, 1]
Z(x) = ⎨ 0 if x = 0 → 0 (preserved)
⎩ x / |min(X⁻)| if x < 0 → [-1, 0]
Why Z-Split?
| Property | Min-Max | Z-Score | Z-Split |
|---|---|---|---|
| Preserves zero as class boundary | ❌ | ❌ | ✅ |
| Stable on narrow near-zero ranges | ❌ | ⚠️ | ✅ |
| Suitable for Otsu thresholding | ❌ | ⚠️ | ✅ |
| Handles skewed distributions | ❌ | ⚠️ | ✅ |
| Multi-temporal direction preserved | ❌ | ❌ | ✅ |
| Output range | [0, 1] | Unbounded | [−1, 1] |
Citation
@article{almoadi2026endwi,
author = {Almoadi, Abdulrhman},
title = {Reducing False Alarms in Urban Flood Detection: An Enhanced NDWI (ENDWI)
with Hybrid Max Fusion on Sentinel-2 Data},
journal = {EGUsphere [preprint]},
year = {2026},
doi = {10.5194/egusphere-2026-672}
}
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zsplit-1.0.0.tar.gz
(5.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zsplit-1.0.0.tar.gz.
File metadata
- Download URL: zsplit-1.0.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
daaeebd2342e7d6a6484997bfa258d644257b2a3c7c7fcbc6ffef9d51cc8bbbf
|
|
| MD5 |
7e13fbbd9eea8ec20c9fbb1193aee0f6
|
|
| BLAKE2b-256 |
8b219324de96f61d6631a9b467f7961430254b3d985359e59b7ddbda6f8461c8
|
File details
Details for the file zsplit-1.0.0-py3-none-any.whl.
File metadata
- Download URL: zsplit-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5117f1c6e02dbcb0f4f6806a0e039d5e80f3cd855dbddedc194fea657e66c97
|
|
| MD5 |
ee8220b4b43a5d35e7cda83d46ec77e8
|
|
| BLAKE2b-256 |
ad437261c47e2f6844f0972d5d544f75d38debd955eeae30bc46915296700848
|