From ce13dbd9d33c9cc7cae7af20f0b75e95175b9428 Mon Sep 17 00:00:00 2001 From: Srini Jammula <67372928+srinijammula@users.noreply.github.com> Date: Wed, 4 Dec 2024 17:08:49 -0500 Subject: [PATCH] Revert "Arctan warning in dem.ipynb" --- book/chapters/dem.ipynb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/book/chapters/dem.ipynb b/book/chapters/dem.ipynb index 562240c..0ff64a8 100644 --- a/book/chapters/dem.ipynb +++ b/book/chapters/dem.ipynb @@ -248,7 +248,6 @@ }, { "cell_type": "markdown", - "id": "55ffbb9d", "metadata": {}, "source": [ "Extract various terrain features from the DEM, such as slope, aspect, curvature, northness, and eastness, and save the results." @@ -444,7 +443,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "5c04ab81", "metadata": {}, "outputs": [], @@ -453,8 +452,8 @@ " with rasterio.open(dem_file) as dataset:\n", " dem_data = dataset.read(1)\n", " dy, dx = np.gradient(dem_data, dataset.res[0], dataset.res[1])\n", - " northness = np.arctan2(dy , np.sqrt(dx**2 + dy**2))\n", - " eastness = np.arctan2(dx , np.sqrt(dx**2 + dy**2))\n", + " northness = np.arctan(dy / np.sqrt(dx**2 + dy**2))\n", + " eastness = np.arctan(dx / np.sqrt(dx**2 + dy**2))\n", " return northness, eastness\n" ] },