Skip to content
This repository was archived by the owner on Apr 20, 2026. It is now read-only.

Commit 8254f81

Browse files
committed
Merge fix for indexing
1 parent b6e6b55 commit 8254f81

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

utilities/sa_tools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,14 @@ def cal_slope_aspect(dem, slope_fname, aspect_fname):
258258
for i in range(ny):
259259
for j in range(nx -1, -1, -1):
260260
if (elevation_array[j, i] == nodata_value and
261-
elevation_array[j+1, i] != nodata_value):
262-
elevation_array[j, i] = elevation_array[j+1, i]
261+
elevation_array[j-1, i] != nodata_value):
262+
elevation_array[j, i] = elevation_array[j-1, i]
263263

264264
for i in range(nx):
265265
for j in range(ny-1, -1, -1):
266266
if (elevation_array[i, j] == nodata_value and
267-
elevation_array[i, j+1] != nodata_value):
268-
elevation_array[i, j] = elevation_array[i, j+1]
267+
elevation_array[i, j-1] != nodata_value):
268+
elevation_array[i, j] = elevation_array[i, j-1]
269269

270270
# Calculate gradient:
271271
# See https://docs.scipy.org/doc/numpy-1.6.0/reference/generated/numpy.gradient.html

0 commit comments

Comments
 (0)