Skip to main content

Z-Split Normalization: Zero-Preserving Split Normalization for bipolar spectral indices

Project description

zsplit — Zero-Preserving Split Normalization

PyPI version DOI License: MIT

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zsplit-1.0.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

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

Hashes for zsplit-1.0.0.tar.gz
Algorithm Hash digest
SHA256 daaeebd2342e7d6a6484997bfa258d644257b2a3c7c7fcbc6ffef9d51cc8bbbf
MD5 7e13fbbd9eea8ec20c9fbb1193aee0f6
BLAKE2b-256 8b219324de96f61d6631a9b467f7961430254b3d985359e59b7ddbda6f8461c8

See more details on using hashes here.

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

Hashes for zsplit-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5117f1c6e02dbcb0f4f6806a0e039d5e80f3cd855dbddedc194fea657e66c97
MD5 ee8220b4b43a5d35e7cda83d46ec77e8
BLAKE2b-256 ad437261c47e2f6844f0972d5d544f75d38debd955eeae30bc46915296700848

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page