Skip to content

Commit 7680857

Browse files
authored
Merge pull request #160 from mcflugen/mcflugen/minor-edits-to-landlab-notebooks
Minor edits of the landlab notebooks
2 parents 9ff882d + ffc6ae7 commit 7680857

File tree

9 files changed

+67
-29
lines changed

9 files changed

+67
-29
lines changed

lessons/landlab/landlab/00_welcome.ipynb

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
"Landlab is an open-source Python-language package for numerical modeling of Earth surface dynamics.\n",
1717
"It contains:\n",
1818
"\n",
19-
"* A gridding engine which represents the model domain. Regular and irregular grids are supported.\n",
20-
"* A library of process components, each of which represents a physical process (e.g., generation\n",
19+
"* A **gridding engine** that represents the model domain. Regular and irregular grids are supported.\n",
20+
"* A **library of process components**, each of which represents a physical process (e.g., generation\n",
2121
" of rain, erosion by flowing water). These components have a common interface and can be combined\n",
2222
" based on a user's needs.\n",
23-
"* Utilities that support general numerical methods, file input/output, and visualization.\n"
23+
"* Utilities that support general **numerical methods**, file **input/output**, and **visualization**.\n"
2424
]
2525
},
2626
{
@@ -42,7 +42,7 @@
4242
" * Grid elements: *cells*\n",
4343
" \n",
4444
"* [Numerics](04-numerics.ipynb)\n",
45-
" * Calculations on a grid elements\n",
45+
" * Calculations on grid elements\n",
4646
" * Example: Fault scarp\n",
4747
"\n",
4848
"* [Components](05-components.ipynb)\n",
@@ -54,10 +54,10 @@
5454
"* [HyLands demo](bedrock_landslides_on_dems.ipynb)\n",
5555
"* [Overland flow](overland_flow.ipynb)\n",
5656
" * This notebook illustrates running the deAlmeida overland flow component in an extremely\n",
57-
" simple-minded way on a real topography, then shows it creating a flood sequence along\n",
57+
" simple-minded way on real topography, it then shows how to create a flood sequence along\n",
5858
" an inclined surface with an oscillating water surface at one end.\n",
5959
"\n",
60-
"**For more Landlab tutorials, click here:** <a href=\"https://landlab.readthedocs.io/en/latest/user_guide/tutorials.html\">https://landlab.readthedocs.io/en/latest/user_guide/tutorials.html</a></small>\n"
60+
"For more Landlab tutorials, see the [Tutorial Gallery](https://landlab.csdms.io/generated/tutorials)\n"
6161
]
6262
},
6363
{
@@ -67,12 +67,20 @@
6767
"## Links\n",
6868
"\n",
6969
"* Reference\n",
70-
" * [Documentation](https://landlab.readthedocs.io)\n",
70+
" * [Documentation](https://landlab.csdms.io)\n",
71+
" * [Tutorial Gallery](https://landlab.csdms.io/generated/tutorials)\n",
7172
" * [Source code](https://github.com/landlab/landlab)\n",
7273
"* Ask for help\n",
7374
" * [Issues on GitHub](https://github.com/csdms/landlab/issues)\n",
7475
" * [CSDMS Help Desk](https://csdms.github.io/help-desk)"
7576
]
77+
},
78+
{
79+
"cell_type": "markdown",
80+
"metadata": {},
81+
"source": [
82+
"👉 [Introduction to grids](01-intro.ipynb)"
83+
]
7684
}
7785
],
7886
"metadata": {

lessons/landlab/landlab/01-intro.a.ipynb

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"cell_type": "markdown",
6464
"metadata": {},
6565
"source": [
66-
"\n",
6766
"## What you need to know about Landlab grids\n",
6867
"\n",
6968
"Landlab model grids are 2D data structures that represent the model domain. A few things to know about grid management:\n",
@@ -80,9 +79,14 @@
8079
"\n",
8180
"<img src=\"./media/Grids1.png\"/>\n",
8281
"\n",
83-
"**Figure** Geometry and topology of grid elements on various Landlab grids ([Hobley et al. 2017](https://esurf.copernicus.org/articles/5/21/2017/))\n",
84-
"\n",
85-
"-- [Interactive sketchbook](https://landlab.github.io/grid-sketchbook/)"
82+
"**Figure** Geometry and topology of grid elements on various Landlab grids ([Hobley et al. 2017](https://esurf.copernicus.org/articles/5/21/2017/))"
83+
]
84+
},
85+
{
86+
"cell_type": "markdown",
87+
"metadata": {},
88+
"source": [
89+
"### 👉 [Interactive sketchbook](https://landlab.github.io/grid-sketchbook/)"
8690
]
8791
},
8892
{
@@ -113,7 +117,7 @@
113117
"\n",
114118
"---\n",
115119
"\n",
116-
"**More complete descriptions of these grid types can be found in [Landlab's documentation](https://landlab.readthedocs.io/en/master/user_guide/grid.html).**\n",
120+
"**More complete descriptions of these grid types can be found in [Landlab's documentation](https://landlab.csdms.io/user_guide/reference/grid.html)**\n",
117121
"\n",
118122
"---"
119123
]
@@ -132,7 +136,7 @@
132136
"cell_type": "markdown",
133137
"metadata": {},
134138
"source": [
135-
"These are all Python <i>classes</i>, and the instances we create of those classes will be our grid <i>objects</i>. For starters, we'll get some basic information on `RasterModelGrid`. Then we'll create an instance of the class `RasterModelGrid` with 3 rows, 4 columns, and 10-unit grid spacing."
139+
"These are all Python <i>classes</i>, and the instances we create of those classes will be our grid <i>objects</i>. For starters, we'll get some basic information on `RasterModelGrid`. Then we'll create an instance of the class `RasterModelGrid` with 4 rows, 5 columns, and 10.0-unit grid spacing in the *x* (column) direction and 5.0 in the *y* (row) direction."
136140
]
137141
},
138142
{
@@ -150,7 +154,7 @@
150154
"source": [
151155
"#### Nodes\n",
152156
"\n",
153-
"*nodes* are simply points that have *x* and *y* coordinates. Different grid types simply lay out\n",
157+
"*nodes* are simply points that have *x* and *y* coordinates. Different grid types lay out\n",
154158
"*nodes* in different ways.\n",
155159
"\n",
156160
"Below we create a `RasterModelGrid` that has four rows and 5 columns of nodes."

lessons/landlab/landlab/01-intro.ipynb

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"cell_type": "markdown",
6464
"metadata": {},
6565
"source": [
66-
"\n",
6766
"## What you need to know about Landlab grids\n",
6867
"\n",
6968
"Landlab model grids are 2D data structures that represent the model domain. A few things to know about grid management:\n",
@@ -80,9 +79,14 @@
8079
"\n",
8180
"<img src=\"./media/Grids1.png\"/>\n",
8281
"\n",
83-
"**Figure** Geometry and topology of grid elements on various Landlab grids ([Hobley et al. 2017](https://esurf.copernicus.org/articles/5/21/2017/))\n",
84-
"\n",
85-
"-- [Interactive sketchbook](https://landlab.github.io/grid-sketchbook/)"
82+
"**Figure** Geometry and topology of grid elements on various Landlab grids ([Hobley et al. 2017](https://esurf.copernicus.org/articles/5/21/2017/))"
83+
]
84+
},
85+
{
86+
"cell_type": "markdown",
87+
"metadata": {},
88+
"source": [
89+
"### 👉 [Interactive sketchbook](https://landlab.github.io/grid-sketchbook/)"
8690
]
8791
},
8892
{
@@ -113,7 +117,7 @@
113117
"\n",
114118
"---\n",
115119
"\n",
116-
"**More complete descriptions of these grid types can be found in [Landlab's documentation](https://landlab.readthedocs.io/en/master/user_guide/grid.html).**\n",
120+
"**More complete descriptions of these grid types can be found in [Landlab's documentation](https://landlab.csdms.io/user_guide/reference/grid.html)**\n",
117121
"\n",
118122
"---"
119123
]
@@ -132,7 +136,7 @@
132136
"cell_type": "markdown",
133137
"metadata": {},
134138
"source": [
135-
"These are all Python <i>classes</i>, and the instances we create of those classes will be our grid <i>objects</i>. For starters, we'll get some basic information on `RasterModelGrid`. Then we'll create an instance of the class `RasterModelGrid` with 3 rows, 4 columns, and 10-unit grid spacing."
139+
"These are all Python <i>classes</i>, and the instances we create of those classes will be our grid <i>objects</i>. For starters, we'll get some basic information on `RasterModelGrid`. Then we'll create an instance of the class `RasterModelGrid` with 4 rows, 5 columns, and 10.0-unit grid spacing in the *x* (column) direction and 5.0 in the *y* (row) direction."
136140
]
137141
},
138142
{
@@ -150,7 +154,7 @@
150154
"source": [
151155
"#### Nodes\n",
152156
"\n",
153-
"*nodes* are simply points that have *x* and *y* coordinates. Different grid types simply lay out\n",
157+
"*nodes* are simply points that have *x* and *y* coordinates. Different grid types lay out\n",
154158
"*nodes* in different ways.\n",
155159
"\n",
156160
"Below we create a `RasterModelGrid` that has four rows and 5 columns of nodes."

lessons/landlab/landlab/02-data.a.ipynb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,11 @@
140140
"metadata": {},
141141
"outputs": [],
142142
"source": [
143-
"from landlab.io import read_esri_ascii\n",
143+
"from landlab.io import esri_ascii\n",
144144
"\n",
145-
"(grid, z) = read_esri_ascii(\"data/square-test-basin.asc\", name=\"topographic__elevation\")"
145+
"with open(\"data/square-test-basin.asc\") as stream:\n",
146+
" grid = esri_ascii.load(stream, name=\"topographic__elevation\")\n",
147+
"z = grid.at_node[\"topographic__elevation\"]"
146148
]
147149
},
148150
{
@@ -321,7 +323,7 @@
321323
"metadata": {},
322324
"outputs": [],
323325
"source": [
324-
"?Topography"
326+
"help(Topography)"
325327
]
326328
},
327329
{

lessons/landlab/landlab/02-data.ipynb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,11 @@
144144
"metadata": {},
145145
"outputs": [],
146146
"source": [
147-
"from landlab.io import read_esri_ascii\n",
147+
"from landlab.io import esri_ascii\n",
148148
"\n",
149-
"(grid, z) = read_esri_ascii(\"data/square-test-basin.asc\", name=\"topographic__elevation\")"
149+
"with open(\"data/square-test-basin.asc\") as stream:\n",
150+
" grid = esri_ascii.load(stream, name=\"topographic__elevation\")\n",
151+
"z = grid.at_node[\"topographic__elevation\"]"
150152
]
151153
},
152154
{
@@ -329,7 +331,7 @@
329331
"metadata": {},
330332
"outputs": [],
331333
"source": [
332-
"?Topography"
334+
"help(Topography)"
333335
]
334336
},
335337
{

lessons/landlab/landlab/04-numerics.a.ipynb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,13 @@
331331
"\n",
332332
"grid.imshow(z)"
333333
]
334+
},
335+
{
336+
"cell_type": "markdown",
337+
"metadata": {},
338+
"source": [
339+
"👉 [Components](05-components.ipynb)"
340+
]
334341
}
335342
],
336343
"metadata": {

lessons/landlab/landlab/04-numerics.ipynb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,13 @@
335335
"```\n",
336336
"</details>"
337337
]
338+
},
339+
{
340+
"cell_type": "markdown",
341+
"metadata": {},
342+
"source": [
343+
"👉 [Components](05-components.ipynb)"
344+
]
338345
}
339346
],
340347
"metadata": {

lessons/landlab/landlab/05-components.a.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"Component modeling is a bit like the potluck tradition: one can construct a complete simulation by assembling components to represent the different parts of the system to be modeled. In Landlab, a **component** is a semi-standardized Python *class* that represents a particular process or calculation. Components are not stand-alone programs, but rather are designed to be used within another Python program that creates an integrated model or workflow.\n",
1919
"\n",
2020
"<img src=\"./media/Eat_Alberta_Potluck.jpg\">\n",
21-
"*Figure 1: A potluck meal (\"Eat Alberta Potluck\" from Wikimedia Commons).*\n"
21+
"\n",
22+
"*Figure 1: A potluck meal (\"Eat Alberta Potluck\" from Wikimedia Commons).*"
2223
]
2324
},
2425
{
@@ -46,6 +47,7 @@
4647
},
4748
"source": [
4849
"<img src=\"./media/bijou_gully_infiltration.png\">\n",
50+
"\n",
4951
"*Figure 3: cumulative infiltration water depth during a simulated five-minute heavy rainfall (from Landlab tutorial \"Green-Ampt infiltration and kinematic wave overland flow\")*\n",
5052
"\n",
5153
"The following code snippets illustrate how the components are imported...\n",

lessons/landlab/landlab/05-components.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"Component modeling is a bit like the potluck tradition: one can construct a complete simulation by assembling components to represent the different parts of the system to be modeled. In Landlab, a **component** is a semi-standardized Python *class* that represents a particular process or calculation. Components are not stand-alone programs, but rather are designed to be used within another Python program that creates an integrated model or workflow.\n",
1919
"\n",
2020
"<img src=\"./media/Eat_Alberta_Potluck.jpg\">\n",
21-
"*Figure 1: A potluck meal (\"Eat Alberta Potluck\" from Wikimedia Commons).*\n"
21+
"\n",
22+
"*Figure 1: A potluck meal (\"Eat Alberta Potluck\" from Wikimedia Commons).*"
2223
]
2324
},
2425
{
@@ -46,6 +47,7 @@
4647
},
4748
"source": [
4849
"<img src=\"./media/bijou_gully_infiltration.png\">\n",
50+
"\n",
4951
"*Figure 3: cumulative infiltration water depth during a simulated five-minute heavy rainfall (from Landlab tutorial \"Green-Ampt infiltration and kinematic wave overland flow\")*\n",
5052
"\n",
5153
"The following code snippets illustrate how the components are imported...\n",

0 commit comments

Comments
 (0)