Skip to content

Commit

Permalink
Merge pull request #43 from geo-smart/revert-41-dem-warning
Browse files Browse the repository at this point in the history
Revert "Arctan warning in dem.ipynb"
  • Loading branch information
srinijammula authored Dec 4, 2024
2 parents 4297d6f + ce13dbd commit 7c4dae8
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 7c4dae8

Please sign in to comment.