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" ] },