pytopocomplexity 0.7.4__tar.gz → 0.8.0__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.
Files changed (23) hide show
  1. {pytopocomplexity-0.7.4 → pytopocomplexity-0.8.0}/PKG-INFO +42 -31
  2. pytopocomplexity-0.8.0/README-pypi.md +66 -0
  3. pytopocomplexity-0.8.0/README.md +138 -0
  4. {pytopocomplexity-0.7.4 → pytopocomplexity-0.8.0}/pyproject.toml +0 -2
  5. pytopocomplexity-0.8.0/pytopocomplexity/__init__.py +7 -0
  6. pytopocomplexity-0.8.0/pytopocomplexity/pycwtmexhat.py +342 -0
  7. pytopocomplexity-0.8.0/pytopocomplexity/pyfracd.py +575 -0
  8. pytopocomplexity-0.8.0/pytopocomplexity/pyrugosity.py +421 -0
  9. pytopocomplexity-0.8.0/pytopocomplexity/pytpi.py +346 -0
  10. {pytopocomplexity-0.7.4 → pytopocomplexity-0.8.0}/pytopocomplexity.egg-info/PKG-INFO +42 -31
  11. {pytopocomplexity-0.7.4 → pytopocomplexity-0.8.0}/pytopocomplexity.egg-info/SOURCES.txt +1 -0
  12. {pytopocomplexity-0.7.4 → pytopocomplexity-0.8.0}/pytopocomplexity.egg-info/requires.txt +0 -1
  13. {pytopocomplexity-0.7.4 → pytopocomplexity-0.8.0}/setup.py +1 -2
  14. pytopocomplexity-0.7.4/README-pypi.md +0 -62
  15. pytopocomplexity-0.7.4/README.md +0 -140
  16. pytopocomplexity-0.7.4/pytopocomplexity/__init__.py +0 -5
  17. pytopocomplexity-0.7.4/pytopocomplexity/pycwtmexhat.py +0 -149
  18. pytopocomplexity-0.7.4/pytopocomplexity/pyfracd.py +0 -259
  19. pytopocomplexity-0.7.4/pytopocomplexity/pyrugosity.py +0 -119
  20. {pytopocomplexity-0.7.4 → pytopocomplexity-0.8.0}/LICENSE +0 -0
  21. {pytopocomplexity-0.7.4 → pytopocomplexity-0.8.0}/pytopocomplexity.egg-info/dependency_links.txt +0 -0
  22. {pytopocomplexity-0.7.4 → pytopocomplexity-0.8.0}/pytopocomplexity.egg-info/top_level.txt +0 -0
  23. {pytopocomplexity-0.7.4 → pytopocomplexity-0.8.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytopocomplexity
3
- Version: 0.7.4
3
+ Version: 0.8.0
4
4
  Summary: A package for topographic complexity analysis
5
5
  Home-page: https://github.com/GeoLarryLai/pyTopoComplexity
6
6
  Author: Larry Syu-Heng Lai
@@ -207,7 +207,6 @@ License: Apache License
207
207
  See the License for the specific language governing permissions and
208
208
  limitations under the License.
209
209
 
210
- Project-URL: Homepage, https://github.com/GeoLarryLai/pyTopoComplexity
211
210
  Project-URL: Repository, https://github.com/GeoLarryLai/pyTopoComplexity.git
212
211
  Classifier: Programming Language :: Python :: 3
213
212
  Classifier: License :: OSI Approved :: Apache Software License
@@ -215,17 +214,26 @@ Classifier: Operating System :: OS Independent
215
214
  Requires-Python: >=3.10
216
215
  Description-Content-Type: text/markdown
217
216
  License-File: LICENSE
217
+ Requires-Dist: numpy>=1.20
218
+ Requires-Dist: scipy>=1.6
219
+ Requires-Dist: rasterio>=1.2
220
+ Requires-Dist: dask>=2021.0
221
+ Requires-Dist: matplotlib>=3.3
222
+ Requires-Dist: tqdm>=4.0
223
+ Requires-Dist: numba>=0.53
224
+ Requires-Dist: statsmodels>=0.12
218
225
 
219
- # pyTopoComlexity (v0.7.4)
226
+ # pyTopoComplexity
220
227
  [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11239338.svg)](https://doi.org/10.5281/zenodo.11239338)
221
228
 
222
- `pytopocomplexity` is an open-source Python package designed to measure the topographic complexity (i.e., surface roughness) of land surfaces using digital elevation model (DEM) data. This package includes modules for three methods commonly used in the fields of geomorphology and oceanography for measuring topographic complexity, which are not fully available in Geographic Information System (GIS) software like QGIS.
229
+ **pyTopoComplexity** is an open-source Python package designed to measure the topographic complexity (i.e., surface roughness) of land surfaces using digital elevation model (DEM) data. This package includes modules for **four** modern methods used to measure topographic complexity in the fields of geology, geomorphology, geography, ecology, and oceanography.
223
230
 
224
- | Modules | Method Descriptions |
225
- | ------------- | ------------- |
226
- | pycwtmexhat.py | Quanitfy the wavelet-based curvature of the land surface using two-dimensional continuous wavelet transform (2D-CWT) with a Mexican Hat wevalet |
227
- | pyfracd.py | Conduct fractal dimension analysis on the land surface |
228
- | pyrugostiy.py | Calculate rugosity indext of the land surface |
231
+ | Modules | Classes | Method Descriptions |
232
+ | ------------- | ------------- | ------------- |
233
+ | pycwtmexhat.py | CWTMexHat | Quanitfy the wavelet-based curvature of the terrain surface using two-dimensional continuous wavelet transform (2D-CWT) with a Mexican Hat wevalet |
234
+ | pyfracd.py | FracD | Conduct fractal dimension analysis on the terrain surface using variogram procedure |
235
+ | pyrugostiy.py | RugosityIndex | Calculate rugosity index of the terrain surface |
236
+ | pytpi.py | TPI | Calculate Terrain Position Index of the topography |
229
237
 
230
238
  ## Installation
231
239
 
@@ -235,46 +243,49 @@ pip install pytopocomplexity
235
243
 
236
244
  ## Modules for Surface Complexity Measurement
237
245
 
238
- ### 1. `pycwtmexhat`: 2D Continuous Wavelet Transform Method
246
+ ### 1. Two-Dimensional Continuous Wavelet Transform Analysis
239
247
 
240
248
  ```python
241
- from pytopocomplexity import pycwtmexhat
249
+ from pytopocomplexity import CWTMexHat
242
250
  ```
243
251
 
244
- The module `pycwtmexhat` uses two-dimensional continuous wavelet transform (2D-CWT) with a Mexican Hat wevalet to measure the topographic complexity (i.e., surface roughness) of a land surface from a Digital Elevation Model (DEM). Such method quanitfy the wavelet-based curvature of the surface, which has been proposed to be a effective geomorphic metric for identifying and estimating the ages of historical deep-seated landslide deposits.
252
+ The module **pycwtmexhat.py** uses two-dimensional continuous wavelet transform (2D-CWT) with a Mexican Hat wevalet to measure the topographic complexity (i.e., surface roughness) of a land surface from a Digital Elevation Model (DEM). Such method quanitfy the wavelet-based curvature of the surface, which has been proposed to be a effective geomorphic metric for identifying and estimating the ages of historical deep-seated landslide deposits. The method and early version of the code was developed by Dr. Adam M. Booth (Portland State Univeristy) in [2009](https://doi.org/10.1016/j.geomorph.2009.02.027), written in MATLAB (source code available from [Booth's personal website](https://web.pdx.edu/~boothad/tools.html)). This MATLAB code was later revised and adapted by Dr. Sean R. LaHusen (Univeristy of Washington) and Dr. Erich N. Herzig (Univeristy of Washington) in their research ([LaHusen et al., 2020](https://doi.org/10.1126/sciadv.aba6790); [Herzig et al. (2023)](https://doi.org/10.1785/0120230079)). Dr. Larry Syu-Heng Lai (Univeristy of Washington), under the supervision of Dr. Alison R. Duvall (Univeristy of Washington), translated the code into this optimized open-source Python version in 2024.
245
253
 
246
- The method and early version of the code was developed by Dr. Adam M. Booth (Portland State Univeristy) in [2009](https://doi.org/10.1016/j.geomorph.2009.02.027), written in MATLAB (Source code available from [Booth's personal website](https://web.pdx.edu/~boothad/tools.html)). This MATLAB code was later revised and adapted by Dr. Sean R. LaHusen (Univeristy of Washington) and Dr. Erich N. Herzig (Univeristy of Washington) in their research ([LaHusen et al., 2020](https://doi.org/10.1126/sciadv.aba6790); [Herzig et al. (2023)](https://doi.org/10.1785/0120230079)). Dr. Larry Syu-Heng Lai (Univeristy of Washington), under the supervision of Dr. Alison R. Duvall (Univeristy of Washington), translated the code into this optimized open-source Python version in 2024.
247
-
248
- ### 2. `pyfracd`: Fractal Dimentsion Analysis
254
+ ### 2. Fractal Dimentsion Analysis
249
255
 
250
256
  ```python
251
- from pytopocomplexity import pyfracd
257
+ from pytopocomplexity import FracD
252
258
  ```
253
259
 
254
- The `pyfracd` module calculates local fractal dimensions to assess topographic complexity. It also computes reliability parameters such as the standard error and the coefficient of determination (R²). The development of pyfracd is made possible through the gratitude of Dr. Eulogio Pardo-Iguzquiza, who kindly shared his Fortran code used in his recent publication [Pardo-Igúzquiza and Dowd (2022)](https://doi.org/10.1016/j.icarus.2022.115109).
255
-
256
- The local fractal dimension is determined by intersecting the surface within a moving window with four vertical planes in principal geographical directions, simplifying the problem to one-dimensional topographic profiles. The fractal dimension of these profiles is estimated using the variogram method, which models the relationship between dissimilarity and distance using a power-law function. While the fractal dimension value does not directly scale with the degree of surface roughness, smoother or more regular surfaces generally have lower fractal dimension values (closer to 2), whereas surfaces with higher fractal dimension values tend to be more complex or irregular. This method has been applied in terrain analysis for understanding spatial variability in surface roughness, classifying geomorphologic features, uncovering hidden spatial structures, and supporting geomorphological and geological mapping on Earth and other planetary bodies.
260
+ The **pyfracd.py** module calculates local fractal dimensions to assess topographic complexity. It also computes reliability parameters such as the standard error and the coefficient of determination (R²). The development of this module was greatly influenced by the Fortran code shared by Dr. Eulogio Pardo-Igúzquiza from his work in [Pardo-Igúzquiza and Dowd (2022)](https://doi.org/10.1016/j.icarus.2022.115109). The local fractal dimension is determined by intersecting the surface within a moving window with four vertical planes in principal geographical directions, simplifying the problem to one-dimensional topographic profiles. The fractal dimension of these profiles is estimated using the variogram method, which models the relationship between dissimilarity and distance using a power-law function. While the fractal dimension value does not directly scale with the degree of surface roughness, smoother or more regular surfaces generally have lower fractal dimension values (closer to 2), whereas surfaces with higher fractal dimension values tend to be more complex or irregular. This method has been applied in terrain analysis for understanding spatial variability in surface roughness, classifying geomorphologic features, uncovering hidden spatial structures, and supporting geomorphological and geological mapping on Earth and other planetary bodies.
257
261
 
258
- ### 3. `pyrugosity`: Rugosity Index
262
+ ### 3. Rugosity Index Calculation
259
263
 
260
264
  ```python
261
- from pytopocomplexity import pyrugosity
265
+ from pytopocomplexity import RugosityIndex
262
266
  ```
263
267
 
264
- The module `pyrugosity` measure rugosity index of the land surface, which is widely used to assess landscape structural complexity. The development of this module is influenced by another open-source tool [`Rugosity_Calculator`](https://github.com/drk944/Rugosity_Calculator) created by [drk944](https://github.com/drk944).
268
+ The module **pyrugosity.py** measure Rugosity Index of the land surface, which is widely used to assess landscape structural complexity. By definition, the Rugosity Index has a minimum value of one, representing a completely flat surface. Typical values of the conventional Rugosity Index without slope correction ([Jenness, 2004](https://onlinelibrary.wiley.com/doi/abs/10.2193/0091-7648%282004%29032%5B0829%3ACLSAFD%5D2.0.CO%3B2)) range from one to three, although larger values are possible in very steep terrains. The slope-corrected Rugosity Index, also known as the Arc-Chord Ratio (ACR) Rugosity Index ([Du Preez, 2015](https://doi.org/10.1007/s10980-014-0118-8)), provides a better representation of local surface complexity. This method has been applied in classifying seafloor types by marine geologists and geomorphologists, studying small-scale hydrodynamics by oceanographers, and assessing available habitats in landscapes by ecologists and coral biologists.
269
+
270
+ ### 4. Terrain Position Index Calculation
271
+
272
+ ```python
273
+ from pytopocomplexity import TPI
274
+ ```
265
275
 
266
- The rugosity index is determined as the ratio of the real surface area to the geometric surface area, highlighting smaller-scale variations in surface height. This module adapt triangulated irregular networks method ([Jenness, 2004](https://doi.org/10.2193/0091-7648(2004)032[0829:CLSAFD]2.0.CO;2)), which approximate the surface area of with within each 9 cell as the sum of 8 truncated-triangle area connecting each cell centerpoint with the centerpoints of the 8 surrounding cells. The geometric surface area is assumed to be the planimetric area of the center cell. By definition, the rugosity index is as a minimum value of one (completely flate surface). Typical valuesrange from one to three although larger values are possible in very steep terrains. Such method has been applied in classifying seafloor types by marine geologists and geomorphologist, small-scale hydrodynamics by oceanographers, and studying available habitats in the landscape by ecologists and coral biologists.
276
+ The module **pytpi.py** calculates the Terrain Position Index (TPI) of the land surface following ([Weiss, 2001](https://www.jennessent.com/arcview/TPI_Weiss_poster.htm)), which is a measure of the relative topographic position of a point in relation to the surrounding landforms. This metric is useful for determining surface ruggedness, classifying terrain, assessing local hydrodynamics, and identifying habitat hotspots. TPI, also known as the Topographic Position Index in terrestrial studies, distinguishes landscape features such as hilltops, valleys, flat plains, and upper or lower slopes. In oceanography, researchers adapt the Bathymetric Position Index (BPI), which applies the equivalent TPI algorithm to bathymetric data to assess seafloor complexity. Positive TPI values indicate locations that are higher than the average of their surroundings (e.g., ridges), while negative values indicate locations that are lower (e.g., valleys). Values near zero indicate flat areas or areas of constant slope. The module also returns the absolute values of the TPI, which is suggested to be useful for quick assessments in mapping and relative dating of deep-seated landslide deposits using high-resolution DTM data ([Lai et al., 2023](https://agu.confex.com/agu/fm23/meetingapp.cgi/Paper/1270349)).
267
277
 
268
278
  ## Requirements
269
279
  For `pytopocomplexity` package
270
280
  * Python >= 3.10
271
- * `numpy`
272
- * `scipy`
273
- * `rasterio`
274
- * `dask`
275
- * `matplotlib`
276
- * `tqdm`
277
- * `numba`
281
+ * `numpy` >= 1.24
282
+ * `scipy` >= 1.10
283
+ * `rasterio` >= 1.3
284
+ * `dask` >= 2024.3
285
+ * `matplotlib` >= 3.7
286
+ * `tqdm` >= 4.66
287
+ * `numba` >= 0.57
288
+ * `statsmodels` >= 0.14
278
289
 
279
290
  ## License
280
- pyTopoComlexity is licensed under the [Apache License 2.0](LICENSE).
291
+ **pyTopoComplexity** is licensed under the [Apache License 2.0](LICENSE).
@@ -0,0 +1,66 @@
1
+ # pyTopoComplexity
2
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11239338.svg)](https://doi.org/10.5281/zenodo.11239338)
3
+
4
+ **pyTopoComplexity** is an open-source Python package designed to measure the topographic complexity (i.e., surface roughness) of land surfaces using digital elevation model (DEM) data. This package includes modules for **four** modern methods used to measure topographic complexity in the fields of geology, geomorphology, geography, ecology, and oceanography.
5
+
6
+ | Modules | Classes | Method Descriptions |
7
+ | ------------- | ------------- | ------------- |
8
+ | pycwtmexhat.py | CWTMexHat | Quanitfy the wavelet-based curvature of the terrain surface using two-dimensional continuous wavelet transform (2D-CWT) with a Mexican Hat wevalet |
9
+ | pyfracd.py | FracD | Conduct fractal dimension analysis on the terrain surface using variogram procedure |
10
+ | pyrugostiy.py | RugosityIndex | Calculate rugosity index of the terrain surface |
11
+ | pytpi.py | TPI | Calculate Terrain Position Index of the topography |
12
+
13
+ ## Installation
14
+
15
+ ```
16
+ pip install pytopocomplexity
17
+ ```
18
+
19
+ ## Modules for Surface Complexity Measurement
20
+
21
+ ### 1. Two-Dimensional Continuous Wavelet Transform Analysis
22
+
23
+ ```python
24
+ from pytopocomplexity import CWTMexHat
25
+ ```
26
+
27
+ The module **pycwtmexhat.py** uses two-dimensional continuous wavelet transform (2D-CWT) with a Mexican Hat wevalet to measure the topographic complexity (i.e., surface roughness) of a land surface from a Digital Elevation Model (DEM). Such method quanitfy the wavelet-based curvature of the surface, which has been proposed to be a effective geomorphic metric for identifying and estimating the ages of historical deep-seated landslide deposits. The method and early version of the code was developed by Dr. Adam M. Booth (Portland State Univeristy) in [2009](https://doi.org/10.1016/j.geomorph.2009.02.027), written in MATLAB (source code available from [Booth's personal website](https://web.pdx.edu/~boothad/tools.html)). This MATLAB code was later revised and adapted by Dr. Sean R. LaHusen (Univeristy of Washington) and Dr. Erich N. Herzig (Univeristy of Washington) in their research ([LaHusen et al., 2020](https://doi.org/10.1126/sciadv.aba6790); [Herzig et al. (2023)](https://doi.org/10.1785/0120230079)). Dr. Larry Syu-Heng Lai (Univeristy of Washington), under the supervision of Dr. Alison R. Duvall (Univeristy of Washington), translated the code into this optimized open-source Python version in 2024.
28
+
29
+ ### 2. Fractal Dimentsion Analysis
30
+
31
+ ```python
32
+ from pytopocomplexity import FracD
33
+ ```
34
+
35
+ The **pyfracd.py** module calculates local fractal dimensions to assess topographic complexity. It also computes reliability parameters such as the standard error and the coefficient of determination (R²). The development of this module was greatly influenced by the Fortran code shared by Dr. Eulogio Pardo-Igúzquiza from his work in [Pardo-Igúzquiza and Dowd (2022)](https://doi.org/10.1016/j.icarus.2022.115109). The local fractal dimension is determined by intersecting the surface within a moving window with four vertical planes in principal geographical directions, simplifying the problem to one-dimensional topographic profiles. The fractal dimension of these profiles is estimated using the variogram method, which models the relationship between dissimilarity and distance using a power-law function. While the fractal dimension value does not directly scale with the degree of surface roughness, smoother or more regular surfaces generally have lower fractal dimension values (closer to 2), whereas surfaces with higher fractal dimension values tend to be more complex or irregular. This method has been applied in terrain analysis for understanding spatial variability in surface roughness, classifying geomorphologic features, uncovering hidden spatial structures, and supporting geomorphological and geological mapping on Earth and other planetary bodies.
36
+
37
+ ### 3. Rugosity Index Calculation
38
+
39
+ ```python
40
+ from pytopocomplexity import RugosityIndex
41
+ ```
42
+
43
+ The module **pyrugosity.py** measure Rugosity Index of the land surface, which is widely used to assess landscape structural complexity. By definition, the Rugosity Index has a minimum value of one, representing a completely flat surface. Typical values of the conventional Rugosity Index without slope correction ([Jenness, 2004](https://onlinelibrary.wiley.com/doi/abs/10.2193/0091-7648%282004%29032%5B0829%3ACLSAFD%5D2.0.CO%3B2)) range from one to three, although larger values are possible in very steep terrains. The slope-corrected Rugosity Index, also known as the Arc-Chord Ratio (ACR) Rugosity Index ([Du Preez, 2015](https://doi.org/10.1007/s10980-014-0118-8)), provides a better representation of local surface complexity. This method has been applied in classifying seafloor types by marine geologists and geomorphologists, studying small-scale hydrodynamics by oceanographers, and assessing available habitats in landscapes by ecologists and coral biologists.
44
+
45
+ ### 4. Terrain Position Index Calculation
46
+
47
+ ```python
48
+ from pytopocomplexity import TPI
49
+ ```
50
+
51
+ The module **pytpi.py** calculates the Terrain Position Index (TPI) of the land surface following ([Weiss, 2001](https://www.jennessent.com/arcview/TPI_Weiss_poster.htm)), which is a measure of the relative topographic position of a point in relation to the surrounding landforms. This metric is useful for determining surface ruggedness, classifying terrain, assessing local hydrodynamics, and identifying habitat hotspots. TPI, also known as the Topographic Position Index in terrestrial studies, distinguishes landscape features such as hilltops, valleys, flat plains, and upper or lower slopes. In oceanography, researchers adapt the Bathymetric Position Index (BPI), which applies the equivalent TPI algorithm to bathymetric data to assess seafloor complexity. Positive TPI values indicate locations that are higher than the average of their surroundings (e.g., ridges), while negative values indicate locations that are lower (e.g., valleys). Values near zero indicate flat areas or areas of constant slope. The module also returns the absolute values of the TPI, which is suggested to be useful for quick assessments in mapping and relative dating of deep-seated landslide deposits using high-resolution DTM data ([Lai et al., 2023](https://agu.confex.com/agu/fm23/meetingapp.cgi/Paper/1270349)).
52
+
53
+ ## Requirements
54
+ For `pytopocomplexity` package
55
+ * Python >= 3.10
56
+ * `numpy` >= 1.24
57
+ * `scipy` >= 1.10
58
+ * `rasterio` >= 1.3
59
+ * `dask` >= 2024.3
60
+ * `matplotlib` >= 3.7
61
+ * `tqdm` >= 4.66
62
+ * `numba` >= 0.57
63
+ * `statsmodels` >= 0.14
64
+
65
+ ## License
66
+ **pyTopoComplexity** is licensed under the [Apache License 2.0](LICENSE).
@@ -0,0 +1,138 @@
1
+ # pyTopoComplexity
2
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11239338.svg)](https://doi.org/10.5281/zenodo.11239338)
3
+ <p align="left">
4
+ <img src="image/pyTopoComplexity_logo.png" width="30%" height="30%""/>
5
+ </p>
6
+
7
+ **pyTopoComplexity** is an open-source Python package designed to measure the topographic complexity (i.e., surface roughness) of land surfaces using digital elevation model (DEM) data. This package includes modules for **four** modern methods used to measure topographic complexity in the fields of geology, geomorphology, geography, ecology, and oceanography.
8
+
9
+ | Modules | Classes | Method Descriptions |
10
+ | ------------- | ------------- | ------------- |
11
+ | pycwtmexhat.py | CWTMexHat | Quanitfy the wavelet-based curvature of the terrain surface using two-dimensional continuous wavelet transform (2D-CWT) with a Mexican Hat wevalet |
12
+ | pyfracd.py | FracD | Conduct fractal dimension analysis on the terrain surface using variogram procedure |
13
+ | pyrugostiy.py | RugosityIndex | Calculate Rugosity Index of the terrain surface |
14
+ | pytpi.py | TPI | Calculate Terrain Position Index of the topography |
15
+
16
+ In this GitHub repository, each module has a corresponding example Jupyter Notebook file that includes detailed instructions on module usage and brief explanations of the applied theories with cited references. Example DEM raster file data are included in the `~/example/` folder.
17
+
18
+ There is also an additional Jupyter Notebook, **nonlineardiff_Landlab.ipynb**, which leverages the power of [Landlab](https://landlab.readthedocs.io/en/latest/index.html) to perform forward simulation of landscape smoothing through non-linear hillslope diffusion process.
19
+
20
+ ## Installation
21
+
22
+ ```
23
+ pip install pytopocomplexity
24
+ ```
25
+
26
+ ## Citation
27
+
28
+ A manuscript is being prepared for submission to the [Journal of Open Source Software](https://joss.theoj.org). If you use **pyTopoComplexity** and the associated Jupyter Notebooks in your work, please consider citing the paper once it is accepted. In the meantime, users may cite the [Zenodo DOI](https://doi.org/10.5281/zenodo.11239338)).
29
+
30
+ ## Modules for Surface Complexity Measurement
31
+
32
+ ### 1. Two-Dimensional Continuous Wavelet Transform Analysis
33
+
34
+ ```python
35
+ from pytopocomplexity import CWTMexHat
36
+ ```
37
+
38
+ The module **pycwtmexhat.py** uses two-dimensional continuous wavelet transform (2D-CWT) with a Mexican Hat wevalet to measure the topographic complexity (i.e., surface roughness) of a land surface from a Digital Elevation Model (DEM). Such method quanitfy the wavelet-based curvature of the surface, which has been proposed to be a effective geomorphic metric for identifying and estimating the ages of historical deep-seated landslide deposits. The method and early version of the code was developed by Dr. Adam M. Booth (Portland State Univeristy) in [2009](https://doi.org/10.1016/j.geomorph.2009.02.027), written in MATLAB (source code available from [Booth's personal website](https://web.pdx.edu/~boothad/tools.html)). This MATLAB code was later revised and adapted by Dr. Sean R. LaHusen (Univeristy of Washington) and Dr. Erich N. Herzig (Univeristy of Washington) in their research ([LaHusen et al., 2020](https://doi.org/10.1126/sciadv.aba6790); [Herzig et al. (2023)](https://doi.org/10.1785/0120230079)). Dr. Larry Syu-Heng Lai (Univeristy of Washington), under the supervision of Dr. Alison R. Duvall (Univeristy of Washington), translated the code into this optimized open-source Python version in 2024.
39
+
40
+ See **pycwtmexhat_example.ipynb** for detailed explanations and usage instructions.
41
+
42
+ <p align="center">
43
+ <img src="image/fig1-pycwtmexhat.png" width="100%" height="100%""/>
44
+ </p>
45
+
46
+ ### 2. Fractal Dimentsion Analysis
47
+
48
+ ```python
49
+ from pytopocomplexity import FracD
50
+ ```
51
+
52
+ The **pyfracd.py** module calculates local fractal dimensions to assess topographic complexity. It also computes reliability parameters such as the standard error and the coefficient of determination (R²). The development of this module was greatly influenced by the Fortran code shared by Dr. Eulogio Pardo-Igúzquiza from his work in [Pardo-Igúzquiza and Dowd (2022)](https://doi.org/10.1016/j.icarus.2022.115109). The local fractal dimension is determined by intersecting the surface within a moving window with four vertical planes in principal geographical directions, simplifying the problem to one-dimensional topographic profiles. The fractal dimension of these profiles is estimated using the variogram method, which models the relationship between dissimilarity and distance using a power-law function. While the fractal dimension value does not directly scale with the degree of surface roughness, smoother or more regular surfaces generally have lower fractal dimension values (closer to 2), whereas surfaces with higher fractal dimension values tend to be more complex or irregular. This method has been applied in terrain analysis for understanding spatial variability in surface roughness, classifying geomorphologic features, uncovering hidden spatial structures, and supporting geomorphological and geological mapping on Earth and other planetary bodies.
53
+
54
+ See **pyfracd_example.ipynb** for detailed explanations and usage instructions.
55
+
56
+ <p align="center">
57
+ <img src="image/fig2-pyfracd.png" width="100%" height="100%""/>
58
+ </p>
59
+
60
+ ### 3. Rugosity Index Calculation
61
+
62
+ ```python
63
+ from pytopocomplexity import RugosityIndex
64
+ ```
65
+
66
+ The module **pyrugosity.py** measure Rugosity Index of the land surface, which is widely used to assess landscape structural complexity. By definition, the Rugosity Index has a minimum value of one, representing a completely flat surface. Typical values of the conventional Rugosity Index without slope correction ([Jenness, 2004](https://onlinelibrary.wiley.com/doi/abs/10.2193/0091-7648%282004%29032%5B0829%3ACLSAFD%5D2.0.CO%3B2)) range from one to three, although larger values are possible in very steep terrains. The slope-corrected Rugosity Index, also known as the Arc-Chord Ratio (ACR) Rugosity Index ([Du Preez, 2015](https://doi.org/10.1007/s10980-014-0118-8)), provides a better representation of local surface complexity. This method has been applied in classifying seafloor types by marine geologists and geomorphologists, studying small-scale hydrodynamics by oceanographers, and assessing available habitats in landscapes by ecologists and coral biologists.
67
+
68
+ See **pyrugosity_example.ipynb** for detailed explanations and usage instructions.
69
+
70
+ <p align="center">
71
+ <img src="image/fig3-pyrugosity.png" width="100%" height="100%""/>
72
+ </p>
73
+
74
+ ### 4. Terrain Position Index Calculation
75
+
76
+ ```python
77
+ from pytopocomplexity import TPI
78
+ ```
79
+
80
+ The module **pytpi.py** calculates the Terrain Position Index (TPI) of the land surface following ([Weiss, 2001](https://www.jennessent.com/arcview/TPI_Weiss_poster.htm)), which is a measure of the relative topographic position of a point in relation to the surrounding landforms. This metric is useful for determining surface ruggedness, classifying terrain, assessing local hydrodynamics, and identifying habitat hotspots. TPI, also known as the Topographic Position Index in terrestrial studies, distinguishes landscape features such as hilltops, valleys, flat plains, and upper or lower slopes. In oceanography, researchers adapt the Bathymetric Position Index (BPI), which applies the equivalent TPI algorithm to bathymetric data to assess seafloor complexity. Positive TPI values indicate locations that are higher than the average of their surroundings (e.g., ridges), while negative values indicate locations that are lower (e.g., valleys). Values near zero indicate flat areas or areas of constant slope. The module also returns the absolute values of the TPI, which is suggested to be useful for quick assessments in mapping and relative dating of deep-seated landslide deposits using high-resolution DTM data ([Lai et al., 2023](https://agu.confex.com/agu/fm23/meetingapp.cgi/Paper/1270349)).
81
+
82
+ See **pytpi_example.ipynb** for detailed explanations and usage instructions.
83
+
84
+ <p align="center">
85
+ <img src="image/fig4-pytpi.png" width="100%" height="100%""/>
86
+ </p>
87
+ ```
88
+
89
+ ## Forward Simulation of Landscape Smoothing through Nonlinear Hillslope Diffusion Process
90
+
91
+ In the `~/example/` folder, the Jupyter Notebook file **nonlineardiff_Landlab.ipynb** demonstrates the use of [Landlab](https://landlab.readthedocs.io/en/latest/index.html), an open-source Python framework for simulating landscape evolution, to model topographic smoothing driven by near-surface soil disturbance and downslope soil creep processes. Specifically, this notebook employs the [`TaylorNonLinearDiffuser`](https://landlab.readthedocs.io/en/latest/reference/components/taylor_nonlinear_hillslope_flux.html) component from [Landlab](https://landlab.readthedocs.io/en/latest/index.html), described as one element in the [`terrainBento`](https://github.com/TerrainBento/terrainbento) package, developed by [Barnhart et al. (2019)](https://gmd.copernicus.org/articles/12/1267/2019/), to simulate topographic smoothing over time through non-linear hillslope diffusion processes ([Roering et al., 1999](https://doi.org/10.1029/1998WR900090)). Users need to define the diffusion coefficient (K) for the simulation.
92
+
93
+ <p align="center">
94
+ <img src="image/NonlinearDiff_demo.gif" width="65%" height="65%" align="center"/>
95
+ </p>
96
+
97
+ ## Example DEM Raster Files
98
+
99
+ This repository include example LiDAR DEM files under `~/example/ExampleDEM/` that cover the area and nearby region of a deep-seated landslide occurred in 2014 at Oso area of the North Fork Stillaguamish River (NFSR) valley, Washington State, USA. The souce LiDAR DEM files was cropped from the 'Stillaguamish 2014' project that was originally contracted by Washington State Department of Transportation (WSDOT), downloaded from the [Washington Lidar Portal](http://lidarportal.dnr.wa.gov) on April 4, 2024. A goal of this work allow users to reproduce the research by [Booth et al. (2017)](https://doi.org/10.1002/2016JF003934) and permit comparison of topographic complexity metrics derived from other regions using **pyTopoComplexity** package and the **nonlineardiff_Landlab.ipynb** simulation tool.
100
+
101
+ The example DEM raster files have various grid size, coordinate reference system (CRS), and unit of grid value (elevation, Z).
102
+
103
+ | LiDAR DEM Files | CRS | XY Grid Size | Z Unit | Descriptions |
104
+ | ------------- | ------------- | ------------- | ------------- | ------------- |
105
+ | Ososlid2014_f_3ftgrid.tif | NAD83/Washington South (ftUS) (EPSG: 2286) | 3.0 [US survey feet] | US survey feet | 2014 Oso Landslide |
106
+ | Ososlid2014_m_3ftgrid.tif | NAD83/Washington South (EPSG: 32149) | ~0.9144 [meters] | meters | 2014 Oso Landslide |
107
+ | Ososlid2014_f_6ftgrid.tif | NAD83/Washington South (ftUS) (EPSG: 2286) | 6.0 [US survey feet] | US survey feet | 2014 Oso Landslide |
108
+ | Ososlid2014_m_6ftgrid.tif | NAD83/Washington South (EPSG: 32149) | ~1.8288 [meters] | meters | 2014 Oso Landslide |
109
+
110
+ > [!NOTE]
111
+ > When testing the code with the example DEM files, users should place the entire `~/ExampleDEM/` subfolder in the same directory as the Jupyter Notebook files. Both the **pyTopoComplexity** package and the **nonlineardiff_landlab.ipynb** land-smoothing modeling tool have the capability to automatically detect the grid spacing and the units of the XYZ directions (must be in feet or meters) of the input DEM raster and compute the results in SI units.
112
+
113
+ ## Requirements
114
+ For **pyTopoComplexity** package"
115
+ * Python >= 3.10
116
+ * `numpy` >= 1.24
117
+ * `scipy` >= 1.10
118
+ * `rasterio` >= 1.3
119
+ * `dask` >= 2024.3
120
+ * `matplotlib` >= 3.7
121
+ * `tqdm` >= 4.66
122
+ * `numba` >= 0.57
123
+ * `statsmodels` >= 0.14
124
+
125
+ Additional packages for Jupyter Notebook examples:
126
+ * `pandas` >= 2.1
127
+ * `jupyter` >= 1.0
128
+
129
+ For landscape smoothing simulation:
130
+ * [`landlab`](https://landlab.readthedocs.io/en/latest/index.html) >= 2.7
131
+ * Used components: `TaylorNonLinearDiffuser`, `esri_ascii`, `imshowhs`
132
+ * `gdal`>= 3.6
133
+ * `ipywidgets` >= 8.1 [optional for interactive visualization]
134
+
135
+ See also the `environment.yml` file which can be used to create a virtual environment.
136
+
137
+ ## License
138
+ **pyTopoComplexity** is licensed under the [Apache License 2.0](LICENSE).
@@ -23,12 +23,10 @@ dependencies = [
23
23
  "matplotlib>=3.3",
24
24
  "tqdm>=4.0",
25
25
  "numba>=0.53",
26
- "gdal>=3.0",
27
26
  "statsmodels>=0.12",
28
27
  ]
29
28
 
30
29
  [project.urls]
31
- Homepage = "https://github.com/GeoLarryLai/pyTopoComplexity"
32
30
  Repository = "https://github.com/GeoLarryLai/pyTopoComplexity.git"
33
31
 
34
32
  [tool.setuptools]
@@ -0,0 +1,7 @@
1
+ "Measure Topographic Complexity"
2
+ from .pycwtmexhat import CWTMexHat
3
+ from .pyfracd import FracD
4
+ from .pyrugosity import RugosityIndex
5
+ from .pytpi import TPI
6
+
7
+ __all__ = ['CWTMexHat', 'FracD', 'RugosityIndex', 'TPI']