Skip to content

Commit

Permalink
Revert "Arctan warning in dem.ipynb"
Browse files Browse the repository at this point in the history
  • Loading branch information
srinijammula authored Dec 4, 2024
1 parent 4297d6f commit ce13dbd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions book/chapters/dem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -444,7 +443,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"id": "5c04ab81",
"metadata": {},
"outputs": [],
Expand All @@ -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"
]
},
Expand Down

0 comments on commit ce13dbd

Please sign in to comment.