Skip to content

Commit 45705b7

Browse files
Standardize frontmatter across Tutorials (#29)
* Make frontmatter consistent * Shorten links | Clear cells * Make title consistent * Fix emojis * Fix emojis * Fix typos | Add links * Add note for reporting errors * Fix bold font * Make headings consistent * Make headings consistent * Format header for animations as a note --------- Co-authored-by: Max Jones <[email protected]>
1 parent 5eaa158 commit 45705b7

8 files changed

+248
-130
lines changed

book/intro.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tutorials for making maps 🗺️ and animations 🎦
1313
::::{grid} 1 1 1 1
1414
:gutter: 1
1515

16-
:::{grid-item-card} Tutorial 1 - First figure + Subplots / layout
16+
:::{grid-item-card} Tutorial 1 - First figure 🚀 and Subplots / layout
1717
:img-top: _images/fd70248f75b8b37ee54b3135f77705f98c6d8489eb18b6910184b447d0f0638d.png
1818
:link: ./tut01_firstfigure.html
1919
by [Jing-Hui Tong](https://orcid.org/0009-0002-7195-3071)
@@ -28,7 +28,7 @@ by [Jing-Hui Tong](https://orcid.org/0009-0002-7195-3071)
2828
{bdg-secondary-line}`earth_age`
2929
:::
3030

31-
:::{grid-item-card} Tutorial 2 - Integration with the scientific Python ecosystem: pandas / GeoPandas
31+
:::{grid-item-card} Tutorial 2 - Integration with the scientific Python ecosystem 🐍: pandas and GeoPandas (tabular data 🗒️)
3232
:img-top: _images/7f18327908c8dd210197cc51845e45a933f356b9fd12bd029a4a8cbda080eb2b.png
3333
:link: ./tut02_spe_pd_gpd.html
3434
by [Yvonne Fröhlich](https://orcid.org/0000-0002-8566-0619)
@@ -52,7 +52,7 @@ by [Yvonne Fröhlich](https://orcid.org/0000-0002-8566-0619)
5252
::::{grid} 1 1 1 1
5353
:gutter: 1
5454

55-
:::{grid-item-card} Tutorial 3 - Integration with the scientific Python ecosystem: Xarray (grids)
55+
:::{grid-item-card} Tutorial 3 - Integration with the scientific Python ecosystem 🐍: Xarray (gridded data 🌐)
5656
:img-top: _images/a18fcb026fb0d0c83360f2b8382a360e552dd50db6aa2db5311259bf5223d3a2.png
5757
:link: ./tut03_spe_xarray.html
5858
by [Max Jones](https://orcid.org/0000-0003-0180-8928)
@@ -67,7 +67,7 @@ by [Max Jones](https://orcid.org/0000-0003-0180-8928)
6767
{bdg-success-line}`CMIP6`
6868
:::
6969

70-
:::{grid-item-card} Tutorial 4 - Geophysics (Seismology)
70+
:::{grid-item-card} Tutorial 4 - Geophysics (Seismology) 🌎🌏🌍
7171
:img-top: https://github.com/user-attachments/assets/37d94581-b9e9-4dec-a021-07c1b58c132a
7272
:link: ./tut04_geophysics.html
7373
by [Jing-Hui Tong](https://orcid.org/0009-0002-7195-3071)

book/tut01_firstfigure.ipynb

+58-35
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "eb4b43cc-dc76-45d1-a370-7266bd943910",
5+
"id": "123cc524-73bd-40e5-b727-ebef5b3b1f0b",
66
"metadata": {
77
"panel-layout": {
88
"height": 218.611,
@@ -11,27 +11,49 @@
1111
}
1212
},
1313
"source": [
14-
"# **Tutorial 1** - First figure and subplot \n",
15-
"\n",
16-
"This tutorial will cover the fundamental concepts behind making figures with PyGMT: \n",
17-
"- drawing coastlines\n",
18-
"- drawing a map frame\n",
19-
"- choosing a projection\n",
20-
"- downloading remote dataset\n",
21-
"- imaging Earth's relief\n",
22-
"- creating colorbar\n",
23-
"- subplot in a figure\n",
24-
"\n",
25-
"-----\n",
26-
"This tutorial is part of the AGU2024 annual meeting GMT/PyGMT pre-conference workshop (PREWS9) **Mastering Geospatial Visualizations with GMT/PyGMT**\n",
27-
"- Conference: https://agu.confex.com/agu/agu24/meetingapp.cgi/Session/226736\n",
28-
"- GitHub: https://github.com/GenericMappingTools/agu24workshop\n",
14+
"# **Tutorial 1** - First figure 🚀 and Subplots / layout \n",
15+
"\n",
16+
"This tutorial will cover the fundamental concepts behind making figures with PyGMT:\n",
17+
"\n",
18+
"- Drawing coastlines\n",
19+
"- Drawing a map frame\n",
20+
"- Choosing a projection\n",
21+
"- Downloading remote dataset\n",
22+
"- Imaging Earth's relief\n",
23+
"- Creating colorbar\n",
24+
"- Subplot in a figure"
25+
]
26+
},
27+
{
28+
"cell_type": "markdown",
29+
"id": "dfa0db02-962e-4031-a35c-4eaf4bf7d4f2",
30+
"metadata": {
31+
"panel-layout": {
32+
"height": 218.611,
33+
"visible": true,
34+
"width": 100
35+
}
36+
},
37+
"source": [
38+
":::{note}\n",
39+
"\n",
40+
"This tutorial is part of the AGU24 annual meeting GMT/PyGMT pre-conference workshop (PREWS9) **Mastering Geospatial Visualizations with GMT/PyGMT**\n",
2941
"- Website: https://www.generic-mapping-tools.org/agu24workshop\n",
30-
"- Recommended version: PyGMT v0.13.0 with GMT 6.5.0\n",
31-
"----\n",
32-
"References:\n",
42+
"- GitHub: https://github.com/GenericMappingTools/agu24workshop\n",
43+
"- Conference: https://agu.confex.com/agu/agu24/meetingapp.cgi/Session/226736\n",
44+
"\n",
45+
"History\n",
46+
"- Author: [Jing-Hui Tong](https://orcid.org/0009-0002-7195-3071)\n",
47+
"- Created: November-December 2024\n",
48+
"- Recommended versions: [PyGMT v0.13.0](https://www.pygmt.org/v0.13.0) with [GMT 6.5.0](https://docs.generic-mapping-tools.org/6.5)\n",
49+
"\n",
50+
"References\n",
3351
"- Liam Toney, [2021 IRIS ROSES unit05](https://github.com/roseseismo/roses2021/blob/main/unit05/roses_mapping_lecture.ipynb)\n",
34-
"- Chih-Ming Lin, GMT courses for 2019 NTNUES summer program"
52+
"- Chih-Ming Lin, GMT courses for 2019 NTNUES summer program\n",
53+
"\n",
54+
"Fee free to play around with these code examples 🚀. In case you found any kind of error, just report it by [opening an issue](https://github.com/GenericMappingTools/agu24workshop/issues) or [provide a fix via a pull request](https://github.com/GenericMappingTools/agu24workshop/pulls). Please use the [GMT forum](https://forum.generic-mapping-tools.org/) to ask questions.\n",
55+
"\n",
56+
":::"
3557
]
3658
},
3759
{
@@ -66,7 +88,7 @@
6688
}
6789
},
6890
"source": [
69-
"## Importing \n",
91+
"## 0️⃣ Importing \n",
7092
"\n",
7193
"First thing to do is load PyGMT (`import`) so that we can access its functionality. \n",
7294
"\n",
@@ -88,8 +110,8 @@
88110
"id": "ce622686-4279-4ab3-b00a-a9f3e7dc8cd4",
89111
"metadata": {},
90112
"source": [
91-
"## Starting your first figure -- [`pygmt.Figure`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.html)\n",
92-
"Every figure must start with the creation of a pygmt.Figure"
113+
"## 1️⃣ Starting your first figure -- [`pygmt.Figure`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.html)\n",
114+
"Every figure must start with the creation of a pygmt.Figure()"
93115
]
94116
},
95117
{
@@ -115,7 +137,7 @@
115137
"id": "03827f08-f6f5-4056-b73b-2071c90d8f0e",
116138
"metadata": {},
117139
"source": [
118-
"## Drawing coastline -- [`pygmt.Figure.coast`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.coast.html)\n",
140+
"### 1.1 Drawing coastline -- [`pygmt.Figure.coast`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.coast.html)\n",
119141
"Before plotting, you need to define \n",
120142
"1. `region`: Controlling the geographic or Cartesian extent of the figure. Regions are specified as lists of `[xmin, xmax, ymin, ymax]`. Another shortcut, `region=\"g\"`, which specifies a **global** domain.\n",
121143
"2. `projection`: Controlling the map projection. GMT (and therefore PyGMT) supports 31 different map projections, from basic Cartesian axes to [arbitrary vertical perspectives](https://docs.generic-mapping-tools.org/6.5/gallery/ex26.html).\n",
@@ -158,7 +180,9 @@
158180
"id": "e28639db-0e21-4c12-91b7-2a96f6158160",
159181
"metadata": {},
160182
"source": [
161-
"::::{seealso} If the image size is too small, the default annotation fonts may appear disproportionately large, impacting the overall visual balance and readability."
183+
"::::{seealso}\n",
184+
"If the image size is too small, the default annotation fonts may appear disproportionately large, impacting the overall visual balance and readability.\n",
185+
"::::"
162186
]
163187
},
164188
{
@@ -167,7 +191,7 @@
167191
"id": "bc713bc7-6c8b-4709-b683-e7908b4a91ef",
168192
"metadata": {},
169193
"source": [
170-
"#### Coloring and add map element (frame and ticks)\n",
194+
"### 1.2 Coloring and add map element (frame and ticks)\n",
171195
"1. axis labels `WSne`: If an upper-case letter (W, S, N, E) is passed, the axis is plotted with tick marks and annotations. The lower-case version (w, s, n, e) plots the axis only with tick marks. To only plot the axis pass (l, b, t, r).\n",
172196
"\n",
173197
"2. annotations `a`: tick labels\n",
@@ -199,7 +223,7 @@
199223
"id": "c9b6acaa-ffea-4c8a-bf2a-91b73070d06c",
200224
"metadata": {},
201225
"source": [
202-
"#### NOTE\n",
226+
"### 1.3 Stacking approach of GMT / PyGMT\n",
203227
"1. In GMT/PyGMT, plotting is achieved by layering new elements, meaning that each new element is stacked on top of the previous layers. \n",
204228
"Therefore, if you draw a black line in an earlier layer and then add a new layer (such as color filling), these new layers might cover the original black line, making it invisible.\n",
205229
"2. In a **same figure**, once you define region/projection before, you don't need to define again. "
@@ -211,8 +235,7 @@
211235
"id": "244b61fe-c349-41ce-9dca-6eefb35d9393",
212236
"metadata": {},
213237
"source": [
214-
"## Downloading global dataset -- [`pygmt.datasets`](https://www.pygmt.org/v0.13.0/api/index.html#datasets)\n",
215-
"\n",
238+
"## 2️⃣ Downloading global dataset -- [`pygmt.datasets`](https://www.pygmt.org/v0.13.0/api/index.html#datasets)\n",
216239
"\n",
217240
"Before you access remote dataset from PyGMT, you need to define \n",
218241
"1. `region`: Region of interest, format is [xmin, xmax, ymin, ymax]\n",
@@ -261,7 +284,7 @@
261284
"id": "79fb24e7-fefe-45b4-b952-29f60172b76b",
262285
"metadata": {},
263286
"source": [
264-
"## Visualizing grid -- [`pygmt.Figure.grdimage`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.grdimage.html)\n",
287+
"## 3️⃣ Visualizing grid -- [`pygmt.Figure.grdimage`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.grdimage.html)\n",
265288
"Project and plot grids or images\n",
266289
"\n",
267290
"Now, we start with a new canvas. So you need to set up region/projection again!\n",
@@ -294,7 +317,7 @@
294317
"id": "2a1567c3-5ccd-4c17-bc2f-92fe33d4a398",
295318
"metadata": {},
296319
"source": [
297-
"## Customizing colorbar -- [`pygmt.makecpt`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.makecpt.html)\n",
320+
"### 3.1 Customizing colorbar -- [`pygmt.makecpt`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.makecpt.html)\n",
298321
"Making GMT color palette tables (CPT).\n",
299322
"\n",
300323
"You need to define:\n",
@@ -326,7 +349,7 @@
326349
"metadata": {},
327350
"source": [
328351
"Now, re-plot the figure with new colormap and ...\n",
329-
"## Adding [`pygmt.Figure.colorbar`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.colorbar.html)\n",
352+
"### 3.2 Adding [`pygmt.Figure.colorbar`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.colorbar.html)\n",
330353
"Plot a gray or color scale-bar on maps.\n",
331354
"\n",
332355
"You need to define,\n",
@@ -381,7 +404,7 @@
381404
"id": "d11eff82-e03c-4a89-9480-2860aa033ff6",
382405
"metadata": {},
383406
"source": [
384-
"## Creating multi-panel figures in a canvas -- [`pygmt.Figure.subplot`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.subplot.html#pygmt.Figure.subplot) and [`pygmt.Figure.set_panel`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.set_panel.html#pygmt.Figure.set_panel)\n",
407+
"## 4️⃣ Creating multi-panel figures in a canvas -- [`pygmt.Figure.subplot`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.subplot.html#pygmt.Figure.subplot) and [`pygmt.Figure.set_panel`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.set_panel.html#pygmt.Figure.set_panel)\n",
385408
"\n",
386409
"\n",
387410
"You need to define the figure layout with figure.subplot:\n",
@@ -445,7 +468,7 @@
445468
"id": "25aeb001-48ed-417b-94dc-637c3fad15c1",
446469
"metadata": {},
447470
"source": [
448-
"### Basic projection types: \n",
471+
"## 5️⃣ Basic projection types: \n",
449472
"\n",
450473
"<img src=\"_static/tut01_projection.jpg\" alt=\"position\" />\n",
451474
"By default, PyGMT will use an equidistant cylindrical projection if the region seems to be geographic longitude and latitude.\n",
@@ -492,7 +515,7 @@
492515
"name": "python",
493516
"nbconvert_exporter": "python",
494517
"pygments_lexer": "ipython3",
495-
"version": "3.12.2"
518+
"version": "3.12.7"
496519
},
497520
"panel-cell-order": [
498521
"eb4b43cc-dc76-45d1-a370-7266bd943910",

book/tut02_spe_pd_gpd.ipynb

+31-16
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,46 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "315a335b-1325-4319-aa06-cb1b239616b8",
5+
"id": "ef4bd355-d444-4afd-8f27-b0a2f7d97a76",
66
"metadata": {},
77
"source": [
8-
"# **Tutorial 2** - scientific Python ecosystem: `pandas` and `GeoPandas`\n",
8+
"# **Tutorial 2** - scientific Python ecosystem 🐍: `pandas` and `GeoPandas` (tabular data 🗒️)\n",
99
"\n",
1010
"In this tutorial we will learn using\n",
1111
" 1. [**pandas**](https://pandas.pydata.org/docs/): **tabular data** stored in ``pandas.DataFrame``s\n",
1212
" 2. [**GeoPandas**](https://geopandas.org/en/stable/docs.html): **spatial data** (points, lines, polygons) stored in ``geopandas.GeoDataFrame``s\n",
1313
"\n",
14-
"within [`PyGMT`](https://www.pygmt.org) to create histograms and different maps.\n",
14+
"within [`PyGMT`](https://www.pygmt.org) to create histograms and different maps."
15+
]
16+
},
17+
{
18+
"cell_type": "markdown",
19+
"id": "06acf2fb-08b1-48b0-bfc7-5e7c46b27ffa",
20+
"metadata": {},
21+
"source": [
22+
":::{note}\n",
1523
"\n",
16-
"-----\n",
17-
"This tutorial is part of the AGU2024 annual meeting GMT/PyGMT pre-conference workshop (PREWS9) **Mastering Geospatial Visualizations with GMT/PyGMT**\n",
18-
"- Conference: https://agu.confex.com/agu/agu24/meetingapp.cgi/Session/226736\n",
19-
"- GitHub: https://github.com/GenericMappingTools/agu24workshop\n",
24+
"This tutorial is part of the AGU24 annual meeting GMT/PyGMT pre-conference workshop (PREWS9) **Mastering Geospatial Visualizations with GMT/PyGMT**\n",
2025
"- Website: https://www.generic-mapping-tools.org/agu24workshop\n",
21-
"- Recommended version: PyGMT v0.13.0 with GMT 6.5.0"
26+
"- GitHub: https://github.com/GenericMappingTools/agu24workshop\n",
27+
"- Conference: https://agu.confex.com/agu/agu24/meetingapp.cgi/Session/226736\n",
28+
"\n",
29+
"History\n",
30+
"- Author: [Yvonne Fröhlich](https://orcid.org/0000-0002-8566-0619)\n",
31+
"- Created: November-December 2024\n",
32+
"- Recommended versions: [PyGMT v0.13.0](https://www.pygmt.org/v0.13.0) with [GMT 6.5.0](https://docs.generic-mapping-tools.org/6.5)\n",
33+
"\n",
34+
"Fee free to play around with these code examples 🚀. In case you found any kind of error, just report it by [opening an issue](https://github.com/GenericMappingTools/agu24workshop/issues) or [provide a fix via a pull request](https://github.com/GenericMappingTools/agu24workshop/pulls). Please use the [GMT forum](https://forum.generic-mapping-tools.org/) to ask questions.\n",
35+
"\n",
36+
":::"
2237
]
2338
},
2439
{
2540
"cell_type": "markdown",
2641
"id": "f56cbd63-a1bd-4e53-837c-13473e0db0d0",
2742
"metadata": {},
2843
"source": [
29-
"## 0. General stuff"
44+
"## 0️⃣ General stuff"
3045
]
3146
},
3247
{
@@ -58,7 +73,7 @@
5873
"id": "22e12c23-d01b-4c9f-91ca-0d9d1ed07409",
5974
"metadata": {},
6075
"source": [
61-
"## 1. `pandas`"
76+
"## 1️⃣ `pandas`"
6277
]
6378
},
6479
{
@@ -204,7 +219,7 @@
204219
"id": "0b238bef-3018-4bdc-92f8-9caa888a2c32",
205220
"metadata": {},
206221
"source": [
207-
"## 2. `GeoPandas`"
222+
"## 2️⃣ `GeoPandas`"
208223
]
209224
},
210225
{
@@ -224,7 +239,7 @@
224239
"source": [
225240
"#### 2.1.1 Spatial Data - `geopandas.GeoDataFrame` with line geometry\n",
226241
"\n",
227-
"First we download some data into in a `geopandas.GeoDataFrame`. This dataset contains European rivers with its length and name."
242+
"First we download some data into in a [`geopandas.GeoDataFrame`](https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.html). This dataset contains European rivers with their lengths and names."
228243
]
229244
},
230245
{
@@ -378,8 +393,8 @@
378393
"source": [
379394
"#### 2.2.1 Spatial Data - `geopandas.GeoDataFrame` with polygon geometry\n",
380395
"\n",
381-
"Again we download some data into in a `geopandas.GeoDataFrame`. This dataset contains information regarding airbnb rentals, socioeconomics, and crime in Chicagos.\n",
382-
"This time we are lucky and the data is directly provided in the geographic coordinate reference system (longitude/latitude) and no further coordinate transformation is needed."
396+
"Again we download some data into in a [`geopandas.GeoDataFrame`](https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.html). This dataset contains information regarding airbnb rentals, socioeconomics, and crime in Chicagos.\n",
397+
"This time we are lucky and the data is directly provided in the geographic coordinate reference system (longitude/latitude) and no coordinate transformation is needed."
383398
]
384399
},
385400
{
@@ -450,7 +465,7 @@
450465
"id": "03516fe8-5013-4acb-89d1-a1ebdbc1d426",
451466
"metadata": {},
452467
"source": [
453-
"## 3. Additional comments\n",
468+
"## 3️⃣ Additional comments\n",
454469
"\n",
455470
"Some helpful and interesting aspects:\n",
456471
"\n",
@@ -466,7 +481,7 @@
466481
"id": "9e7abfa1-13ac-4bed-896d-4e55438f1f94",
467482
"metadata": {},
468483
"source": [
469-
"## 4. Orientation / suggestion for \"2.1.4 Plot the rivers with color-coding for the river length\"\n",
484+
"## 4️⃣ Orientation / suggestion for \"2.1.4 Plot the rivers with color-coding for the river length\"\n",
470485
"\n",
471486
"Below you find a rough code shipset for plotting the rives with color-coding in section 2.1.4."
472487
]

0 commit comments

Comments
 (0)