zsplit 1.0.0__tar.gz → 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
zsplit-1.0.1/PKG-INFO ADDED
@@ -0,0 +1,221 @@
1
+ Metadata-Version: 2.4
2
+ Name: zsplit
3
+ Version: 1.0.1
4
+ Summary: Z-Split Normalization: Zero-Preserving Split Normalization for bipolar spectral indices
5
+ Author-email: Abdulrhman Almoadi <aalmoadi@kacst.edu.sa>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Abdulrhman Almoadi
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/aalmoadi/endwi
29
+ Project-URL: Repository, https://github.com/aalmoadi/endwi
30
+ Project-URL: Documentation, https://github.com/aalmoadi/endwi/tree/main/Z-Split_Normalization
31
+ Project-URL: Bug Tracker, https://github.com/aalmoadi/endwi/issues
32
+ Project-URL: DOI, https://doi.org/10.5281/zenodo.20602710
33
+ Project-URL: Paper, https://doi.org/10.5194/egusphere-2026-672
34
+ Keywords: normalization,remote-sensing,flood-detection,spectral-index,ENDWI,NDWI,bipolar,zero-preserving,Otsu,GIS,GeoAI,machine-learning,deep-learning,SAR,Sentinel-2
35
+ Classifier: Development Status :: 5 - Production/Stable
36
+ Classifier: Intended Audience :: Science/Research
37
+ Classifier: License :: OSI Approved :: MIT License
38
+ Classifier: Programming Language :: Python :: 3
39
+ Classifier: Programming Language :: Python :: 3.8
40
+ Classifier: Programming Language :: Python :: 3.9
41
+ Classifier: Programming Language :: Python :: 3.10
42
+ Classifier: Programming Language :: Python :: 3.11
43
+ Classifier: Programming Language :: Python :: 3.12
44
+ Classifier: Topic :: Scientific/Engineering :: GIS
45
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
46
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
47
+ Requires-Python: >=3.8
48
+ Description-Content-Type: text/markdown
49
+ License-File: LICENSE
50
+ Requires-Dist: numpy>=1.20
51
+ Provides-Extra: raster
52
+ Requires-Dist: rasterio>=1.2; extra == "raster"
53
+ Provides-Extra: dev
54
+ Requires-Dist: pytest; extra == "dev"
55
+ Requires-Dist: rasterio>=1.2; extra == "dev"
56
+ Requires-Dist: matplotlib; extra == "dev"
57
+ Dynamic: license-file
58
+
59
+ # Z-Split Normalization (Zero-Preserving Split Normalization)
60
+
61
+ **Version:** 1.0.0
62
+ **License:** MIT
63
+
64
+ ---
65
+
66
+ ## What is Z-Split?
67
+
68
+ Z-Split **preserves zero as a fixed physical boundary** while **expanding narrow distributions clustered around zero** into the full [−1, 1] range — normalizing and expanding in a single operation. This prevents the low-contrast output common with near-zero indices and creates a well-formed distribution suitable for Otsu thresholding and multi-temporal analysis.
69
+
70
+ ---
71
+
72
+ ## Core Idea and Motivation
73
+
74
+ Spectral indices and remote sensing operations often produce values clustered tightly around zero due to radiometric constraints, surface reflectance properties, or normalized difference formulations. Standard normalization compresses these values further, producing low-contrast images and unstable thresholds.
75
+
76
+ Z-Split expands each side of zero independently into [−1, 0] and [0, 1], simultaneously normalizing and stretching narrow distributions. This preserves distributional contrast for reliable thresholding, maintains the zero boundary across scenes for stable multi-temporal comparison, and broadens the practical utility of spectral indices in analytical workflows where near-zero clustering would otherwise limit accuracy.
77
+
78
+ ---
79
+
80
+ ## The Problem
81
+
82
+ Bipolar remote sensing indices share one property: **zero is a physical class boundary** (water/non-water, uplift/subsidence). Standard methods destroy it: Min-Max shifts zero into [0, 1]; Z-Score centers on the mean and produces an unbounded range. Both fail when values cluster near zero, making thresholding unreliable, multi-temporal comparisons artifact-driven, and in the worst case producing entirely empty, white, or black images due to values compressed around zero.
83
+
84
+ ---
85
+
86
+ ## The Solution — Z-Split
87
+
88
+ Z-Split normalizes each side of zero **independently**, stretching the full negative range to [−1, 0] and the full positive range to [0, 1].
89
+
90
+ ### Formula
91
+
92
+ $$
93
+ Z\text{-}Split(x) =
94
+ \begin{cases}
95
+ x \;/\; \max(X^+) & \text{if } x > 0 \\
96
+ 0 & \text{if } x = 0 \\
97
+ x \;/\; |\min(X^-)| & \text{if } x < 0
98
+ \end{cases}
99
+ $$
100
+
101
+ where $X^+$ is the set of positive values and $X^-$ is the set of negative values.
102
+ **Output range:** [−1, 1] with zero strictly preserved.
103
+
104
+ ---
105
+
106
+ ## Why Z-Split?
107
+
108
+ | Property | Min-Max | Z-Score | Z-Split |
109
+ |----------|:-------:|:-------:|:-------:|
110
+ | Preserves zero as class boundary | ❌ | ❌ | ✅ |
111
+ | Expands narrow near-zero distributions | ❌ | ⚠️ | ✅ |
112
+ | Stable on skewed distributions | ❌ | ⚠️ | ✅ |
113
+ | Suitable for Otsu thresholding | ❌ | ⚠️ | ✅ |
114
+ | Multi-temporal direction preserved | ❌ | ❌ | ✅ |
115
+ | Output range | [0, 1] | Unbounded | [−1, 1] |
116
+
117
+ ---
118
+
119
+ ## Installation
120
+
121
+ ```bash
122
+ pip install zsplit
123
+ ```
124
+
125
+ ## Quick Start
126
+
127
+ ```python
128
+ from zsplit import normalize
129
+
130
+ result = normalize(your_bipolar_index)
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Validation
136
+
137
+ ### 1. NDWI — Optical Remote Sensing
138
+
139
+ Tested on Sentinel-2 NDWI data. Z-Split successfully expanded near-zero clustered values while preserving the original image structure, producing contrast-enhanced output suitable for thresholding and multi-temporal comparison.
140
+
141
+ ### 2. Multi-Temporal Change Analysis — NDVI, Riyadh 2018–2024
142
+
143
+ Validated on four Sentinel-2 NDVI scenes (March–April, 2018–2020–2022–2024) over Riyadh, Saudi Arabia (scale: 10 m, 5603 × 5129 pixels per scene) across 11,424 spatial patches.
144
+
145
+ #### A. Linear Trend (Slope per pixel, 2018–2024)
146
+
147
+ | Method | Mean Slope | Std | Correlation with Raw |
148
+ |--------|:----------:|:---:|:--------------------:|
149
+ | Raw (no normalization) | 0.000894 | 0.0165 | — |
150
+ | Min-Max | 0.027454 | 0.2170 | r = 0.511 |
151
+ | **Z-Split** | **−0.000120** | **0.0167** | **r = 0.995** |
152
+
153
+ Z-Split preserves the original temporal signal with **99.5% fidelity**. Min-Max introduces artificial trends with slope Std **13× larger** than raw data.
154
+
155
+ #### B. Anomaly Detection (2024 vs. multi-year mean)
156
+
157
+ Min-Max anomaly maps show spatially inverted patterns relative to raw data. Z-Split anomaly maps are visually and statistically consistent with raw data.
158
+
159
+ #### C. Coefficient of Variation (CV across 2018–2024)
160
+
161
+ | Method | Mean CV |
162
+ |--------|:-------:|
163
+ | Raw | 0.150 |
164
+ | **Z-Split** | **0.173** |
165
+ | Min-Max | 0.832 |
166
+
167
+ Min-Max inflates temporal variability by **5.5×**. Z-Split stays within 15% of the raw baseline.
168
+
169
+ #### D. Threshold Stability (Otsu across 11,424 patches)
170
+
171
+ | Method | Threshold Std |
172
+ |--------|:-------------:|
173
+ | Min-Max | 0.0882 |
174
+ | **Z-Split** | **0.2220** |
175
+ | Z-Score | 1.2012 |
176
+
177
+ > **Note:** For strongly unipolar NDVI in arid urban areas, Min-Max threshold stability is comparable to Z-Split. Z-Split's primary advantage is in bipolar indices with narrow near-zero distributions (NDWI, InSAR LOS), consistent with its design objective.
178
+
179
+ ---
180
+
181
+ ## Application Scope
182
+
183
+ Most effective when:
184
+ - Values cluster near zero (NDWI in arid regions, InSAR LOS over stable terrain)
185
+ - Multi-temporal consistency is required
186
+ - Otsu or zero-based thresholding is applied
187
+ - Cross-scene or cross-sensor comparisons are performed
188
+
189
+ ---
190
+
191
+ ## Files
192
+
193
+ | File | Description |
194
+ |------|-------------|
195
+ | `zsplit_normalization.ipynb` | Jupyter Notebook with visual demonstration |
196
+ | `zsplit_arcpy.py` | ArcGIS Pro implementation |
197
+ | `Z-Split_Normalization/Validation/` | Multi-temporal NDVI change analysis |
198
+ | `Validation/01_Optical_ENDWI/` | Optical NDWI validation |
199
+
200
+ ---
201
+
202
+ ## Figures
203
+
204
+ **Figure 1:** Otsu threshold distribution across 11,424 spatial patches — Min-Max vs Z-Score vs Z-Split.
205
+
206
+ **Figure 2:** Multi-temporal NDVI change analysis (Linear Trend, Anomaly, CV) — Raw vs Min-Max vs Z-Split, Riyadh 2018–2024.
207
+
208
+ ---
209
+
210
+ ## Author
211
+
212
+ **Abdulrhman Almoadi**
213
+ King Abdulaziz City for Science and Technology (KACST)
214
+
215
+ ---
216
+
217
+ ## Citation
218
+
219
+ If you use Z-Split, please cite:
220
+
221
+ > Almoadi, A.: Reducing False Alarms in Urban Flood Detection: An Enhanced NDWI (ENDWI) with Hybrid Max Fusion on Sentinel-2 Data, EGUsphere [preprint], https://doi.org/10.5194/egusphere-2026-672, 2026.
zsplit-1.0.1/README.md ADDED
@@ -0,0 +1,163 @@
1
+ # Z-Split Normalization (Zero-Preserving Split Normalization)
2
+
3
+ **Version:** 1.0.0
4
+ **License:** MIT
5
+
6
+ ---
7
+
8
+ ## What is Z-Split?
9
+
10
+ Z-Split **preserves zero as a fixed physical boundary** while **expanding narrow distributions clustered around zero** into the full [−1, 1] range — normalizing and expanding in a single operation. This prevents the low-contrast output common with near-zero indices and creates a well-formed distribution suitable for Otsu thresholding and multi-temporal analysis.
11
+
12
+ ---
13
+
14
+ ## Core Idea and Motivation
15
+
16
+ Spectral indices and remote sensing operations often produce values clustered tightly around zero due to radiometric constraints, surface reflectance properties, or normalized difference formulations. Standard normalization compresses these values further, producing low-contrast images and unstable thresholds.
17
+
18
+ Z-Split expands each side of zero independently into [−1, 0] and [0, 1], simultaneously normalizing and stretching narrow distributions. This preserves distributional contrast for reliable thresholding, maintains the zero boundary across scenes for stable multi-temporal comparison, and broadens the practical utility of spectral indices in analytical workflows where near-zero clustering would otherwise limit accuracy.
19
+
20
+ ---
21
+
22
+ ## The Problem
23
+
24
+ Bipolar remote sensing indices share one property: **zero is a physical class boundary** (water/non-water, uplift/subsidence). Standard methods destroy it: Min-Max shifts zero into [0, 1]; Z-Score centers on the mean and produces an unbounded range. Both fail when values cluster near zero, making thresholding unreliable, multi-temporal comparisons artifact-driven, and in the worst case producing entirely empty, white, or black images due to values compressed around zero.
25
+
26
+ ---
27
+
28
+ ## The Solution — Z-Split
29
+
30
+ Z-Split normalizes each side of zero **independently**, stretching the full negative range to [−1, 0] and the full positive range to [0, 1].
31
+
32
+ ### Formula
33
+
34
+ $$
35
+ Z\text{-}Split(x) =
36
+ \begin{cases}
37
+ x \;/\; \max(X^+) & \text{if } x > 0 \\
38
+ 0 & \text{if } x = 0 \\
39
+ x \;/\; |\min(X^-)| & \text{if } x < 0
40
+ \end{cases}
41
+ $$
42
+
43
+ where $X^+$ is the set of positive values and $X^-$ is the set of negative values.
44
+ **Output range:** [−1, 1] with zero strictly preserved.
45
+
46
+ ---
47
+
48
+ ## Why Z-Split?
49
+
50
+ | Property | Min-Max | Z-Score | Z-Split |
51
+ |----------|:-------:|:-------:|:-------:|
52
+ | Preserves zero as class boundary | ❌ | ❌ | ✅ |
53
+ | Expands narrow near-zero distributions | ❌ | ⚠️ | ✅ |
54
+ | Stable on skewed distributions | ❌ | ⚠️ | ✅ |
55
+ | Suitable for Otsu thresholding | ❌ | ⚠️ | ✅ |
56
+ | Multi-temporal direction preserved | ❌ | ❌ | ✅ |
57
+ | Output range | [0, 1] | Unbounded | [−1, 1] |
58
+
59
+ ---
60
+
61
+ ## Installation
62
+
63
+ ```bash
64
+ pip install zsplit
65
+ ```
66
+
67
+ ## Quick Start
68
+
69
+ ```python
70
+ from zsplit import normalize
71
+
72
+ result = normalize(your_bipolar_index)
73
+ ```
74
+
75
+ ---
76
+
77
+ ## Validation
78
+
79
+ ### 1. NDWI — Optical Remote Sensing
80
+
81
+ Tested on Sentinel-2 NDWI data. Z-Split successfully expanded near-zero clustered values while preserving the original image structure, producing contrast-enhanced output suitable for thresholding and multi-temporal comparison.
82
+
83
+ ### 2. Multi-Temporal Change Analysis — NDVI, Riyadh 2018–2024
84
+
85
+ Validated on four Sentinel-2 NDVI scenes (March–April, 2018–2020–2022–2024) over Riyadh, Saudi Arabia (scale: 10 m, 5603 × 5129 pixels per scene) across 11,424 spatial patches.
86
+
87
+ #### A. Linear Trend (Slope per pixel, 2018–2024)
88
+
89
+ | Method | Mean Slope | Std | Correlation with Raw |
90
+ |--------|:----------:|:---:|:--------------------:|
91
+ | Raw (no normalization) | 0.000894 | 0.0165 | — |
92
+ | Min-Max | 0.027454 | 0.2170 | r = 0.511 |
93
+ | **Z-Split** | **−0.000120** | **0.0167** | **r = 0.995** |
94
+
95
+ Z-Split preserves the original temporal signal with **99.5% fidelity**. Min-Max introduces artificial trends with slope Std **13× larger** than raw data.
96
+
97
+ #### B. Anomaly Detection (2024 vs. multi-year mean)
98
+
99
+ Min-Max anomaly maps show spatially inverted patterns relative to raw data. Z-Split anomaly maps are visually and statistically consistent with raw data.
100
+
101
+ #### C. Coefficient of Variation (CV across 2018–2024)
102
+
103
+ | Method | Mean CV |
104
+ |--------|:-------:|
105
+ | Raw | 0.150 |
106
+ | **Z-Split** | **0.173** |
107
+ | Min-Max | 0.832 |
108
+
109
+ Min-Max inflates temporal variability by **5.5×**. Z-Split stays within 15% of the raw baseline.
110
+
111
+ #### D. Threshold Stability (Otsu across 11,424 patches)
112
+
113
+ | Method | Threshold Std |
114
+ |--------|:-------------:|
115
+ | Min-Max | 0.0882 |
116
+ | **Z-Split** | **0.2220** |
117
+ | Z-Score | 1.2012 |
118
+
119
+ > **Note:** For strongly unipolar NDVI in arid urban areas, Min-Max threshold stability is comparable to Z-Split. Z-Split's primary advantage is in bipolar indices with narrow near-zero distributions (NDWI, InSAR LOS), consistent with its design objective.
120
+
121
+ ---
122
+
123
+ ## Application Scope
124
+
125
+ Most effective when:
126
+ - Values cluster near zero (NDWI in arid regions, InSAR LOS over stable terrain)
127
+ - Multi-temporal consistency is required
128
+ - Otsu or zero-based thresholding is applied
129
+ - Cross-scene or cross-sensor comparisons are performed
130
+
131
+ ---
132
+
133
+ ## Files
134
+
135
+ | File | Description |
136
+ |------|-------------|
137
+ | `zsplit_normalization.ipynb` | Jupyter Notebook with visual demonstration |
138
+ | `zsplit_arcpy.py` | ArcGIS Pro implementation |
139
+ | `Z-Split_Normalization/Validation/` | Multi-temporal NDVI change analysis |
140
+ | `Validation/01_Optical_ENDWI/` | Optical NDWI validation |
141
+
142
+ ---
143
+
144
+ ## Figures
145
+
146
+ **Figure 1:** Otsu threshold distribution across 11,424 spatial patches — Min-Max vs Z-Score vs Z-Split.
147
+
148
+ **Figure 2:** Multi-temporal NDVI change analysis (Linear Trend, Anomaly, CV) — Raw vs Min-Max vs Z-Split, Riyadh 2018–2024.
149
+
150
+ ---
151
+
152
+ ## Author
153
+
154
+ **Abdulrhman Almoadi**
155
+ King Abdulaziz City for Science and Technology (KACST)
156
+
157
+ ---
158
+
159
+ ## Citation
160
+
161
+ If you use Z-Split, please cite:
162
+
163
+ > Almoadi, A.: Reducing False Alarms in Urban Flood Detection: An Enhanced NDWI (ENDWI) with Hybrid Max Fusion on Sentinel-2 Data, EGUsphere [preprint], https://doi.org/10.5194/egusphere-2026-672, 2026.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "zsplit"
7
- version = "1.0.0"
7
+ version = "1.0.1"
8
8
  description = "Z-Split Normalization: Zero-Preserving Split Normalization for bipolar spectral indices"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -0,0 +1,221 @@
1
+ Metadata-Version: 2.4
2
+ Name: zsplit
3
+ Version: 1.0.1
4
+ Summary: Z-Split Normalization: Zero-Preserving Split Normalization for bipolar spectral indices
5
+ Author-email: Abdulrhman Almoadi <aalmoadi@kacst.edu.sa>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Abdulrhman Almoadi
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/aalmoadi/endwi
29
+ Project-URL: Repository, https://github.com/aalmoadi/endwi
30
+ Project-URL: Documentation, https://github.com/aalmoadi/endwi/tree/main/Z-Split_Normalization
31
+ Project-URL: Bug Tracker, https://github.com/aalmoadi/endwi/issues
32
+ Project-URL: DOI, https://doi.org/10.5281/zenodo.20602710
33
+ Project-URL: Paper, https://doi.org/10.5194/egusphere-2026-672
34
+ Keywords: normalization,remote-sensing,flood-detection,spectral-index,ENDWI,NDWI,bipolar,zero-preserving,Otsu,GIS,GeoAI,machine-learning,deep-learning,SAR,Sentinel-2
35
+ Classifier: Development Status :: 5 - Production/Stable
36
+ Classifier: Intended Audience :: Science/Research
37
+ Classifier: License :: OSI Approved :: MIT License
38
+ Classifier: Programming Language :: Python :: 3
39
+ Classifier: Programming Language :: Python :: 3.8
40
+ Classifier: Programming Language :: Python :: 3.9
41
+ Classifier: Programming Language :: Python :: 3.10
42
+ Classifier: Programming Language :: Python :: 3.11
43
+ Classifier: Programming Language :: Python :: 3.12
44
+ Classifier: Topic :: Scientific/Engineering :: GIS
45
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
46
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
47
+ Requires-Python: >=3.8
48
+ Description-Content-Type: text/markdown
49
+ License-File: LICENSE
50
+ Requires-Dist: numpy>=1.20
51
+ Provides-Extra: raster
52
+ Requires-Dist: rasterio>=1.2; extra == "raster"
53
+ Provides-Extra: dev
54
+ Requires-Dist: pytest; extra == "dev"
55
+ Requires-Dist: rasterio>=1.2; extra == "dev"
56
+ Requires-Dist: matplotlib; extra == "dev"
57
+ Dynamic: license-file
58
+
59
+ # Z-Split Normalization (Zero-Preserving Split Normalization)
60
+
61
+ **Version:** 1.0.0
62
+ **License:** MIT
63
+
64
+ ---
65
+
66
+ ## What is Z-Split?
67
+
68
+ Z-Split **preserves zero as a fixed physical boundary** while **expanding narrow distributions clustered around zero** into the full [−1, 1] range — normalizing and expanding in a single operation. This prevents the low-contrast output common with near-zero indices and creates a well-formed distribution suitable for Otsu thresholding and multi-temporal analysis.
69
+
70
+ ---
71
+
72
+ ## Core Idea and Motivation
73
+
74
+ Spectral indices and remote sensing operations often produce values clustered tightly around zero due to radiometric constraints, surface reflectance properties, or normalized difference formulations. Standard normalization compresses these values further, producing low-contrast images and unstable thresholds.
75
+
76
+ Z-Split expands each side of zero independently into [−1, 0] and [0, 1], simultaneously normalizing and stretching narrow distributions. This preserves distributional contrast for reliable thresholding, maintains the zero boundary across scenes for stable multi-temporal comparison, and broadens the practical utility of spectral indices in analytical workflows where near-zero clustering would otherwise limit accuracy.
77
+
78
+ ---
79
+
80
+ ## The Problem
81
+
82
+ Bipolar remote sensing indices share one property: **zero is a physical class boundary** (water/non-water, uplift/subsidence). Standard methods destroy it: Min-Max shifts zero into [0, 1]; Z-Score centers on the mean and produces an unbounded range. Both fail when values cluster near zero, making thresholding unreliable, multi-temporal comparisons artifact-driven, and in the worst case producing entirely empty, white, or black images due to values compressed around zero.
83
+
84
+ ---
85
+
86
+ ## The Solution — Z-Split
87
+
88
+ Z-Split normalizes each side of zero **independently**, stretching the full negative range to [−1, 0] and the full positive range to [0, 1].
89
+
90
+ ### Formula
91
+
92
+ $$
93
+ Z\text{-}Split(x) =
94
+ \begin{cases}
95
+ x \;/\; \max(X^+) & \text{if } x > 0 \\
96
+ 0 & \text{if } x = 0 \\
97
+ x \;/\; |\min(X^-)| & \text{if } x < 0
98
+ \end{cases}
99
+ $$
100
+
101
+ where $X^+$ is the set of positive values and $X^-$ is the set of negative values.
102
+ **Output range:** [−1, 1] with zero strictly preserved.
103
+
104
+ ---
105
+
106
+ ## Why Z-Split?
107
+
108
+ | Property | Min-Max | Z-Score | Z-Split |
109
+ |----------|:-------:|:-------:|:-------:|
110
+ | Preserves zero as class boundary | ❌ | ❌ | ✅ |
111
+ | Expands narrow near-zero distributions | ❌ | ⚠️ | ✅ |
112
+ | Stable on skewed distributions | ❌ | ⚠️ | ✅ |
113
+ | Suitable for Otsu thresholding | ❌ | ⚠️ | ✅ |
114
+ | Multi-temporal direction preserved | ❌ | ❌ | ✅ |
115
+ | Output range | [0, 1] | Unbounded | [−1, 1] |
116
+
117
+ ---
118
+
119
+ ## Installation
120
+
121
+ ```bash
122
+ pip install zsplit
123
+ ```
124
+
125
+ ## Quick Start
126
+
127
+ ```python
128
+ from zsplit import normalize
129
+
130
+ result = normalize(your_bipolar_index)
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Validation
136
+
137
+ ### 1. NDWI — Optical Remote Sensing
138
+
139
+ Tested on Sentinel-2 NDWI data. Z-Split successfully expanded near-zero clustered values while preserving the original image structure, producing contrast-enhanced output suitable for thresholding and multi-temporal comparison.
140
+
141
+ ### 2. Multi-Temporal Change Analysis — NDVI, Riyadh 2018–2024
142
+
143
+ Validated on four Sentinel-2 NDVI scenes (March–April, 2018–2020–2022–2024) over Riyadh, Saudi Arabia (scale: 10 m, 5603 × 5129 pixels per scene) across 11,424 spatial patches.
144
+
145
+ #### A. Linear Trend (Slope per pixel, 2018–2024)
146
+
147
+ | Method | Mean Slope | Std | Correlation with Raw |
148
+ |--------|:----------:|:---:|:--------------------:|
149
+ | Raw (no normalization) | 0.000894 | 0.0165 | — |
150
+ | Min-Max | 0.027454 | 0.2170 | r = 0.511 |
151
+ | **Z-Split** | **−0.000120** | **0.0167** | **r = 0.995** |
152
+
153
+ Z-Split preserves the original temporal signal with **99.5% fidelity**. Min-Max introduces artificial trends with slope Std **13× larger** than raw data.
154
+
155
+ #### B. Anomaly Detection (2024 vs. multi-year mean)
156
+
157
+ Min-Max anomaly maps show spatially inverted patterns relative to raw data. Z-Split anomaly maps are visually and statistically consistent with raw data.
158
+
159
+ #### C. Coefficient of Variation (CV across 2018–2024)
160
+
161
+ | Method | Mean CV |
162
+ |--------|:-------:|
163
+ | Raw | 0.150 |
164
+ | **Z-Split** | **0.173** |
165
+ | Min-Max | 0.832 |
166
+
167
+ Min-Max inflates temporal variability by **5.5×**. Z-Split stays within 15% of the raw baseline.
168
+
169
+ #### D. Threshold Stability (Otsu across 11,424 patches)
170
+
171
+ | Method | Threshold Std |
172
+ |--------|:-------------:|
173
+ | Min-Max | 0.0882 |
174
+ | **Z-Split** | **0.2220** |
175
+ | Z-Score | 1.2012 |
176
+
177
+ > **Note:** For strongly unipolar NDVI in arid urban areas, Min-Max threshold stability is comparable to Z-Split. Z-Split's primary advantage is in bipolar indices with narrow near-zero distributions (NDWI, InSAR LOS), consistent with its design objective.
178
+
179
+ ---
180
+
181
+ ## Application Scope
182
+
183
+ Most effective when:
184
+ - Values cluster near zero (NDWI in arid regions, InSAR LOS over stable terrain)
185
+ - Multi-temporal consistency is required
186
+ - Otsu or zero-based thresholding is applied
187
+ - Cross-scene or cross-sensor comparisons are performed
188
+
189
+ ---
190
+
191
+ ## Files
192
+
193
+ | File | Description |
194
+ |------|-------------|
195
+ | `zsplit_normalization.ipynb` | Jupyter Notebook with visual demonstration |
196
+ | `zsplit_arcpy.py` | ArcGIS Pro implementation |
197
+ | `Z-Split_Normalization/Validation/` | Multi-temporal NDVI change analysis |
198
+ | `Validation/01_Optical_ENDWI/` | Optical NDWI validation |
199
+
200
+ ---
201
+
202
+ ## Figures
203
+
204
+ **Figure 1:** Otsu threshold distribution across 11,424 spatial patches — Min-Max vs Z-Score vs Z-Split.
205
+
206
+ **Figure 2:** Multi-temporal NDVI change analysis (Linear Trend, Anomaly, CV) — Raw vs Min-Max vs Z-Split, Riyadh 2018–2024.
207
+
208
+ ---
209
+
210
+ ## Author
211
+
212
+ **Abdulrhman Almoadi**
213
+ King Abdulaziz City for Science and Technology (KACST)
214
+
215
+ ---
216
+
217
+ ## Citation
218
+
219
+ If you use Z-Split, please cite:
220
+
221
+ > Almoadi, A.: Reducing False Alarms in Urban Flood Detection: An Enhanced NDWI (ENDWI) with Hybrid Max Fusion on Sentinel-2 Data, EGUsphere [preprint], https://doi.org/10.5194/egusphere-2026-672, 2026.
zsplit-1.0.0/PKG-INFO DELETED
@@ -1,135 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: zsplit
3
- Version: 1.0.0
4
- Summary: Z-Split Normalization: Zero-Preserving Split Normalization for bipolar spectral indices
5
- Author-email: Abdulrhman Almoadi <aalmoadi@kacst.edu.sa>
6
- License: MIT License
7
-
8
- Copyright (c) 2026 Abdulrhman Almoadi
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
28
- Project-URL: Homepage, https://github.com/aalmoadi/endwi
29
- Project-URL: Repository, https://github.com/aalmoadi/endwi
30
- Project-URL: Documentation, https://github.com/aalmoadi/endwi/tree/main/Z-Split_Normalization
31
- Project-URL: Bug Tracker, https://github.com/aalmoadi/endwi/issues
32
- Project-URL: DOI, https://doi.org/10.5281/zenodo.20602710
33
- Project-URL: Paper, https://doi.org/10.5194/egusphere-2026-672
34
- Keywords: normalization,remote-sensing,flood-detection,spectral-index,ENDWI,NDWI,bipolar,zero-preserving,Otsu,GIS,GeoAI,machine-learning,deep-learning,SAR,Sentinel-2
35
- Classifier: Development Status :: 5 - Production/Stable
36
- Classifier: Intended Audience :: Science/Research
37
- Classifier: License :: OSI Approved :: MIT License
38
- Classifier: Programming Language :: Python :: 3
39
- Classifier: Programming Language :: Python :: 3.8
40
- Classifier: Programming Language :: Python :: 3.9
41
- Classifier: Programming Language :: Python :: 3.10
42
- Classifier: Programming Language :: Python :: 3.11
43
- Classifier: Programming Language :: Python :: 3.12
44
- Classifier: Topic :: Scientific/Engineering :: GIS
45
- Classifier: Topic :: Scientific/Engineering :: Image Processing
46
- Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
47
- Requires-Python: >=3.8
48
- Description-Content-Type: text/markdown
49
- License-File: LICENSE
50
- Requires-Dist: numpy>=1.20
51
- Provides-Extra: raster
52
- Requires-Dist: rasterio>=1.2; extra == "raster"
53
- Provides-Extra: dev
54
- Requires-Dist: pytest; extra == "dev"
55
- Requires-Dist: rasterio>=1.2; extra == "dev"
56
- Requires-Dist: matplotlib; extra == "dev"
57
- Dynamic: license-file
58
-
59
- # zsplit — Zero-Preserving Split Normalization
60
-
61
- [![PyPI version](https://badge.fury.io/py/zsplit.svg)](https://pypi.org/project/zsplit/)
62
- [![DOI](https://zenodo.org/badge/1037018439.svg)](https://doi.org/10.5281/zenodo.20602709)
63
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
64
-
65
- 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).
66
-
67
- ## Installation
68
-
69
- ```bash
70
- pip install zsplit
71
- ```
72
-
73
- With raster support:
74
-
75
- ```bash
76
- pip install zsplit[raster]
77
- ```
78
-
79
- ## Quick Start
80
-
81
- ```python
82
- import numpy as np
83
- from zsplit import normalize
84
-
85
- # Simulated raw ENDWI values (DN scale — extremely narrow range)
86
- arr = np.array([-0.00041, -0.00020, 0.0, 0.00008, 0.00015])
87
-
88
- result = normalize(arr)
89
- print(result)
90
- # [-1. -0.488 0. 0.533 1. ]
91
- ```
92
-
93
- ## Raster Support
94
-
95
- ```python
96
- from zsplit import normalize_raster
97
-
98
- normalize_raster('ENDWI_raw.tif', 'ENDWI_zsplit.tif')
99
- ```
100
-
101
- ## Formula
102
-
103
- ```
104
- ⎧ x / max(X⁺) if x > 0 → [0, 1]
105
- Z(x) = ⎨ 0 if x = 0 → 0 (preserved)
106
- ⎩ x / |min(X⁻)| if x < 0 → [-1, 0]
107
- ```
108
-
109
- ## Why Z-Split?
110
-
111
- | Property | Min-Max | Z-Score | **Z-Split** |
112
- |---|---|---|---|
113
- | Preserves zero as class boundary | ❌ | ❌ | ✅ |
114
- | Stable on narrow near-zero ranges | ❌ | ⚠️ | ✅ |
115
- | Suitable for Otsu thresholding | ❌ | ⚠️ | ✅ |
116
- | Handles skewed distributions | ❌ | ⚠️ | ✅ |
117
- | Multi-temporal direction preserved | ❌ | ❌ | ✅ |
118
- | Output range | [0, 1] | Unbounded | **[−1, 1]** |
119
-
120
- ## Citation
121
-
122
- ```bibtex
123
- @article{almoadi2026endwi,
124
- author = {Almoadi, Abdulrhman},
125
- title = {Reducing False Alarms in Urban Flood Detection: An Enhanced NDWI (ENDWI)
126
- with Hybrid Max Fusion on Sentinel-2 Data},
127
- journal = {EGUsphere [preprint]},
128
- year = {2026},
129
- doi = {10.5194/egusphere-2026-672}
130
- }
131
- ```
132
-
133
- ## License
134
-
135
- MIT License
zsplit-1.0.0/README.md DELETED
@@ -1,77 +0,0 @@
1
- # zsplit — Zero-Preserving Split Normalization
2
-
3
- [![PyPI version](https://badge.fury.io/py/zsplit.svg)](https://pypi.org/project/zsplit/)
4
- [![DOI](https://zenodo.org/badge/1037018439.svg)](https://doi.org/10.5281/zenodo.20602709)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
-
7
- 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).
8
-
9
- ## Installation
10
-
11
- ```bash
12
- pip install zsplit
13
- ```
14
-
15
- With raster support:
16
-
17
- ```bash
18
- pip install zsplit[raster]
19
- ```
20
-
21
- ## Quick Start
22
-
23
- ```python
24
- import numpy as np
25
- from zsplit import normalize
26
-
27
- # Simulated raw ENDWI values (DN scale — extremely narrow range)
28
- arr = np.array([-0.00041, -0.00020, 0.0, 0.00008, 0.00015])
29
-
30
- result = normalize(arr)
31
- print(result)
32
- # [-1. -0.488 0. 0.533 1. ]
33
- ```
34
-
35
- ## Raster Support
36
-
37
- ```python
38
- from zsplit import normalize_raster
39
-
40
- normalize_raster('ENDWI_raw.tif', 'ENDWI_zsplit.tif')
41
- ```
42
-
43
- ## Formula
44
-
45
- ```
46
- ⎧ x / max(X⁺) if x > 0 → [0, 1]
47
- Z(x) = ⎨ 0 if x = 0 → 0 (preserved)
48
- ⎩ x / |min(X⁻)| if x < 0 → [-1, 0]
49
- ```
50
-
51
- ## Why Z-Split?
52
-
53
- | Property | Min-Max | Z-Score | **Z-Split** |
54
- |---|---|---|---|
55
- | Preserves zero as class boundary | ❌ | ❌ | ✅ |
56
- | Stable on narrow near-zero ranges | ❌ | ⚠️ | ✅ |
57
- | Suitable for Otsu thresholding | ❌ | ⚠️ | ✅ |
58
- | Handles skewed distributions | ❌ | ⚠️ | ✅ |
59
- | Multi-temporal direction preserved | ❌ | ❌ | ✅ |
60
- | Output range | [0, 1] | Unbounded | **[−1, 1]** |
61
-
62
- ## Citation
63
-
64
- ```bibtex
65
- @article{almoadi2026endwi,
66
- author = {Almoadi, Abdulrhman},
67
- title = {Reducing False Alarms in Urban Flood Detection: An Enhanced NDWI (ENDWI)
68
- with Hybrid Max Fusion on Sentinel-2 Data},
69
- journal = {EGUsphere [preprint]},
70
- year = {2026},
71
- doi = {10.5194/egusphere-2026-672}
72
- }
73
- ```
74
-
75
- ## License
76
-
77
- MIT License
@@ -1,135 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: zsplit
3
- Version: 1.0.0
4
- Summary: Z-Split Normalization: Zero-Preserving Split Normalization for bipolar spectral indices
5
- Author-email: Abdulrhman Almoadi <aalmoadi@kacst.edu.sa>
6
- License: MIT License
7
-
8
- Copyright (c) 2026 Abdulrhman Almoadi
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
28
- Project-URL: Homepage, https://github.com/aalmoadi/endwi
29
- Project-URL: Repository, https://github.com/aalmoadi/endwi
30
- Project-URL: Documentation, https://github.com/aalmoadi/endwi/tree/main/Z-Split_Normalization
31
- Project-URL: Bug Tracker, https://github.com/aalmoadi/endwi/issues
32
- Project-URL: DOI, https://doi.org/10.5281/zenodo.20602710
33
- Project-URL: Paper, https://doi.org/10.5194/egusphere-2026-672
34
- Keywords: normalization,remote-sensing,flood-detection,spectral-index,ENDWI,NDWI,bipolar,zero-preserving,Otsu,GIS,GeoAI,machine-learning,deep-learning,SAR,Sentinel-2
35
- Classifier: Development Status :: 5 - Production/Stable
36
- Classifier: Intended Audience :: Science/Research
37
- Classifier: License :: OSI Approved :: MIT License
38
- Classifier: Programming Language :: Python :: 3
39
- Classifier: Programming Language :: Python :: 3.8
40
- Classifier: Programming Language :: Python :: 3.9
41
- Classifier: Programming Language :: Python :: 3.10
42
- Classifier: Programming Language :: Python :: 3.11
43
- Classifier: Programming Language :: Python :: 3.12
44
- Classifier: Topic :: Scientific/Engineering :: GIS
45
- Classifier: Topic :: Scientific/Engineering :: Image Processing
46
- Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
47
- Requires-Python: >=3.8
48
- Description-Content-Type: text/markdown
49
- License-File: LICENSE
50
- Requires-Dist: numpy>=1.20
51
- Provides-Extra: raster
52
- Requires-Dist: rasterio>=1.2; extra == "raster"
53
- Provides-Extra: dev
54
- Requires-Dist: pytest; extra == "dev"
55
- Requires-Dist: rasterio>=1.2; extra == "dev"
56
- Requires-Dist: matplotlib; extra == "dev"
57
- Dynamic: license-file
58
-
59
- # zsplit — Zero-Preserving Split Normalization
60
-
61
- [![PyPI version](https://badge.fury.io/py/zsplit.svg)](https://pypi.org/project/zsplit/)
62
- [![DOI](https://zenodo.org/badge/1037018439.svg)](https://doi.org/10.5281/zenodo.20602709)
63
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
64
-
65
- 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).
66
-
67
- ## Installation
68
-
69
- ```bash
70
- pip install zsplit
71
- ```
72
-
73
- With raster support:
74
-
75
- ```bash
76
- pip install zsplit[raster]
77
- ```
78
-
79
- ## Quick Start
80
-
81
- ```python
82
- import numpy as np
83
- from zsplit import normalize
84
-
85
- # Simulated raw ENDWI values (DN scale — extremely narrow range)
86
- arr = np.array([-0.00041, -0.00020, 0.0, 0.00008, 0.00015])
87
-
88
- result = normalize(arr)
89
- print(result)
90
- # [-1. -0.488 0. 0.533 1. ]
91
- ```
92
-
93
- ## Raster Support
94
-
95
- ```python
96
- from zsplit import normalize_raster
97
-
98
- normalize_raster('ENDWI_raw.tif', 'ENDWI_zsplit.tif')
99
- ```
100
-
101
- ## Formula
102
-
103
- ```
104
- ⎧ x / max(X⁺) if x > 0 → [0, 1]
105
- Z(x) = ⎨ 0 if x = 0 → 0 (preserved)
106
- ⎩ x / |min(X⁻)| if x < 0 → [-1, 0]
107
- ```
108
-
109
- ## Why Z-Split?
110
-
111
- | Property | Min-Max | Z-Score | **Z-Split** |
112
- |---|---|---|---|
113
- | Preserves zero as class boundary | ❌ | ❌ | ✅ |
114
- | Stable on narrow near-zero ranges | ❌ | ⚠️ | ✅ |
115
- | Suitable for Otsu thresholding | ❌ | ⚠️ | ✅ |
116
- | Handles skewed distributions | ❌ | ⚠️ | ✅ |
117
- | Multi-temporal direction preserved | ❌ | ❌ | ✅ |
118
- | Output range | [0, 1] | Unbounded | **[−1, 1]** |
119
-
120
- ## Citation
121
-
122
- ```bibtex
123
- @article{almoadi2026endwi,
124
- author = {Almoadi, Abdulrhman},
125
- title = {Reducing False Alarms in Urban Flood Detection: An Enhanced NDWI (ENDWI)
126
- with Hybrid Max Fusion on Sentinel-2 Data},
127
- journal = {EGUsphere [preprint]},
128
- year = {2026},
129
- doi = {10.5194/egusphere-2026-672}
130
- }
131
- ```
132
-
133
- ## License
134
-
135
- MIT License
File without changes
File without changes
File without changes
File without changes