Skip to content

Commit

Permalink
Overall fixes (typos, links, emojis, consistency, etc.) (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
yvonnefroehlich authored Dec 6, 2024
1 parent 7b1dd66 commit 7e9e7b6
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 49 deletions.
6 changes: 3 additions & 3 deletions book/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ and [Yvonne Fröhlich](https://orcid.org/0000-0002-8566-0619)
::::{grid} 1 1 1 1
:gutter: 1

:::{grid-item-card} Tutorial 5 - 3-D Topography (Planetary / Antarctic maps)
:::{grid-item-card} Tutorial 5 - 3-D Topography (Planetary / Antarctic maps) 🏔️
:img-top: \_images/0a6fc097b1fcaa99eff8632dab714787757564ed60e07f20825101c6a8e045ae.png
:link: ./tut05_topography.html
by [Wei Ji Leong](https://orcid.org/0000-0003-2354-1988)
Expand All @@ -107,7 +107,7 @@ and [André Belém](https://orcid.org/0000-0002-8865-6180)
{bdg-success-line}`DEM`
:::

:::{grid-item-card} Tutorial 6 - Animations with GMT
:::{grid-item-card} Tutorial 6 - Animations with GMT 🎦
:img-top: \_images/5847818951ca8fbc9b86a6f2c67389b6.png
:link: ./tut06_animation.html
by [Federico Esteban](https://orcid.org/0000-0002-0641-7371)
Expand Down Expand Up @@ -192,7 +192,7 @@ Here's the instructions to install the `agu24workshop` environment:

This should open up a page in your default browser. If not, you can click and open
the 🔗 link that says `http://localhost:8888/lab?token=...` in your command-line
terminal and this will will take you to the Jupyter Lab page.
terminal and this will take you to the Jupyter Lab page.

6. Download the Jupyter notebook(s) you want to run (e.g.
https://www.generic-mapping-tools.org/agu24workshop/tut01_firstfigure.html) using
Expand Down
17 changes: 4 additions & 13 deletions book/tut01_firstfigure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"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",
"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",
"\n",
"> Determining the size of your images `10c`, the size will affect how large of your following fontsize and markersize\n",
"> Determining the size of your images `10c`, the size will affect how large of your following font size and marker size\n",
">> **length unit** `c`: centimeter (default)\n",
"\n",
"> More projections please click https://www.pygmt.org/v0.13.0/projections/index.html"
Expand Down Expand Up @@ -453,7 +453,7 @@
" )\n",
"\n",
" fig.colorbar(\n",
" position=\"JBC+w6c/0.3c+mc+h\", frame=\"a40f20+lSeafloor crustal asge (Ma)\"\n",
" position=\"JBC+w6c/0.3c+mc+h\", frame=\"a40f20+lSeafloor crustal age (Ma)\"\n",
" )\n",
"\n",
"fig.show()"
Expand All @@ -465,7 +465,7 @@
"id": "25aeb001-48ed-417b-94dc-637c3fad15c1",
"metadata": {},
"source": [
"## 5️⃣ Basic projection types: \n",
"## 5️⃣ Basic projection types\n",
"\n",
"<img src=\"_static/tut01_projection.jpg\" alt=\"position\" />\n",
"By default, PyGMT will use an equidistant cylindrical projection if the region seems to be geographic longitude and latitude.\n",
Expand All @@ -483,17 +483,8 @@
"3. Azimuthal Projection -- projecting the Earth onto a plane, preserving directions from a central point.\n",
" \n",
"* Use Case: Suitable for mapping polar regions or any area where direction from a central point is essential.\n",
"* GMT Command: **E[lon]/[lat]**, with lon and lat defining the central point.\n",
"\n"
"* GMT Command: **E[lon]/[lat]**, with lon and lat defining the central point."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "00558ccf-06c9-43d5-9e76-5edd36c6fc35",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
8 changes: 4 additions & 4 deletions book/tut02_spe_pd_gpd.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"source": [
"### 1.3 Create a geographical map showing the epicenters (scatter plot)\n",
"\n",
"Now it's time to create a geographical map showing the earthquakes. You can start with using [`pygmt.Figure.basemap`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.basemap.html) and [`pygmt.Figure.coast`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.coast.html) to set up the map. To create a scatter plot we can pass appropriate columns of the `pandas.DataFrame` to the `x`, `y`, `size`, and `fill` parameters of [`pygmt.Figure.plot`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.plot.html). This allows use to plot the epicenters as size (moment magnitude) and color (hypocentral depth) coded circles on top of the map. For details you can have a look at [**Plotting data points**](https://www.pygmt.org/v0.13.0/tutorials/basics/plot.html)."
"Now it's time to create a geographical map showing the earthquakes. You can start with using [`pygmt.Figure.basemap`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.basemap.html) and [`pygmt.Figure.coast`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.coast.html) to set up the map. To create a scatter plot we can pass appropriate columns of a `pandas.DataFrame` to the `x`, `y`, `size`, and `fill` parameters of [`pygmt.Figure.plot`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.plot.html). This allows us to plot the epicenters as size (moment magnitude) and color (hypocentral depth) coded circles on top of the map. For details you can have a look at [**Plotting data points**](https://www.pygmt.org/v0.13.0/tutorials/basics/plot.html)."
]
},
{
Expand Down Expand Up @@ -229,7 +229,7 @@
"source": [
"### 2.1 Line geometry\n",
"\n",
"Features which can be represented as a **line geometry** are for example rivers, roads, national boundaries, shorlines, and any kind of profiles."
"Features which can be represented as a **line geometry** are for example rivers, roads, national boundaries, shorelines, and any kind of profiles."
]
},
{
Expand Down Expand Up @@ -397,7 +397,7 @@
"source": [
"#### 2.2.1 Spatial Data - `geopandas.GeoDataFrame` with polygon geometry\n",
"\n",
"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",
"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 Chicago.\n",
"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."
]
},
Expand Down Expand Up @@ -476,7 +476,7 @@
"Some helpful and interesting aspects:\n",
"\n",
"- Use suitable colormaps for your data: [**Scientific colourmaps by Fabio Crameri**](https://www.fabiocrameri.ch/colourmaps/), see also the publications [Crameri et al. 2024](https://doi.org/10.1002/cpz1.1126) and [Crameri et al. 2020](https://doi.org/10.1038/s41467-020-19160-7)\n",
"- Datasets provided by `GeoPandas`: Checkout the [**geodatasets**](https://geodatasets.readthedocs.io) libaray\n",
"- Datasets provided by `GeoPandas`: Checkout the [**geodatasets**](https://geodatasets.readthedocs.io) library\n",
"- Convert other objects to `pandas` or `GeoPandas` objects to make them usable in `PyGMT`: For example, convert [**OSMnx**](https://osmnx.readthedocs.io)'s `MultiDiGraph` to a `geopandas.DataFrame`\n",
"- Create more complex geometries: Combine `GeoPandas` with [**shapely**](https://shapely.readthedocs.io) (i.e., `from shapely.geometry import Polygon`)\n",
"- Support of OGR formats: Use [`geopandas.read_file`](https://geopandas.org/en/v1.0.1/docs/reference/api/geopandas.read_file.html) to load data provided as shapefile (.shp), GeoJSON (.geojson), geopackage (.gpkg), etc."
Expand Down
2 changes: 1 addition & 1 deletion book/tut04_geophysics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
"source": [
"### 3.2 [`pygmt.project`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.project.html)\n",
"\n",
"[`pygmt.project`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.project.html) is designed to sample points along a great circle, a straight line, or across specified distance. In our case, we will create a profile point-to-point. Therefore you need to define: \n",
"[`pygmt.project`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.project.html) is designed to sample points along a great circle, a straight line, or across specified distance. In our case, we will create a profile point-to-point. Therefore, you need to define: \n",
"\n",
"1. `center` and `endpoint`: Specify the start and end coordinates of the profile.\n",
"2. `generate`: Distance interval of each point, e.g., `10` means points are generated every 10 degrees along the profile. \n",
Expand Down
6 changes: 3 additions & 3 deletions book/tut05_topography.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"- Created: November-December 2024\n",
"- 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",
"\n",
"🔖 References\n",
"References\n",
"- https://www.generic-mapping-tools.org/remote-datasets/mars-relief.html\n",
"- https://github.com/andrebelem/PlanetaryMaps\n",
"- {cite:t}`NeumannMarsOrbiterLaser2003`\n",
Expand Down Expand Up @@ -380,7 +380,7 @@
"## 3️⃣ Draping RGB image on 3-D topography\n",
"\n",
"We have our RGB imagery from Sentinel-2, and a DEM from REMA, and now we can learn how\n",
"to render the colour image on top of the 3-D topography! Once again, we will be using\n",
"to render the color image on top of the 3-D topography! Once again, we will be using\n",
"[`grdview`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.Figure.grdview.html), but\n",
"pass in some extra arguments:\n",
"\n",
Expand All @@ -403,7 +403,7 @@
"This is how the code will look like. We'll also use\n",
"[`pygmt.config`](https://www.pygmt.org/v0.13.0/api/generated/pygmt.config.html) to set\n",
"[`PS_PAGE_COLOR`](https://docs.generic-mapping-tools.org/6.5/gmt.conf.html#term-PS_PAGE_COLOR)\n",
"(the background colour) to an off-white colour instead of the default black to better\n",
"(the background color) to an off-white color instead of the default black to better\n",
"match the polar landscape."
]
},
Expand Down
33 changes: 17 additions & 16 deletions book/tut06_animation.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
**Tutorial 6** - Animations with GMT
------------------------------------
**Tutorial 6** - Animations with GMT 🎦
---------------------------------------

Content
- This tutorial explains the basic aspect of doing animations with GMT.
- It serves as a guide to help beginners understand and troubleshoot potential issues.
- It explains the basic aspect of the :gmt-module:`movie` and :gmt-module:`events` modules.

* This tutorial explains the basic aspect of doing animations with GMT.
* It serves as a guide to help beginners understand and troubleshoot potential issues.
* It explains the basic aspect of the :gmt-module:`movie` and :gmt-module:`events` modules.

.. note::
This tutorial is part of the AGU24 annual meeting GMT/PyGMT pre-conference workshop (PREWS9) **Mastering Geospatial Visualizations with GMT/PyGMT**
Expand All @@ -22,8 +23,8 @@ Content
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.


1. Introduction
~~~~~~~~~~~~~~~
1️⃣. Introduction
~~~~~~~~~~~~~~~~~

Prior to GMT 6.0, ambitious movie makers had to write complicated scripts where the advancement of frames was explicitly done by a shell loop.
At the end of the script, you would have to convert your PostScript plot to a raster image with a name that is lexically increasing,
Expand Down Expand Up @@ -80,8 +81,9 @@ For the purposes of this tutorial, I define two types of animations that can be
- GMT version 6.5 or later.
- Bash scripting environment: The examples in this tutorial are written in Bash and may not work correctly in other shell environments (e.g., zsh, fish, or Windows cmd).

2. Tutorial 1. Earth spinning
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2️⃣. Tutorial 1. Earth spinning
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here I explain how to make an animation of a moving object which only requires the :gmt-module:`movie` module.

Expand Down Expand Up @@ -496,17 +498,16 @@ In the step, I increase:
Also you could use `-x <https://docs.generic-mapping-tools.org/6.5/gmt.html#core-full>`_ to specify the number of active cores to be used.
3. Tutorial 2. Earthquakes
~~~~~~~~~~~~~~~~~~~~~~~~~~
3️⃣. Tutorial 2. Earthquakes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Check the extended section to see the tutorial 2 about appearing objects.
That type of animation is more complex and requires the use :gmt-module:`events` and :gmt-module:`movie` modules.
In that tutorial, I create an animation showing the occurrences of earthquakes during the year 2018 (with one frame per day).
4. See also
~~~~~~~~~~~
4️⃣. See also
~~~~~~~~~~~~~
- The paper about animations which include explanation and examples (`Wessel et al. 2024 <https://doi.org/10.1029/2024GC011545>`_).
Expand All @@ -515,8 +516,8 @@ In that tutorial, I create an animation showing the occurrences of earthquakes d
- See the `GMT animation gallery <https://docs.generic-mapping-tools.org/6.5/animations.html>`_ for more examples.
5. References
~~~~~~~~~~~~~
5️. References
~~~~~~~~~~~~~~~
- Wessel, P., Luis, J. F., Uieda, L., Scharroo, R., Wobbe, F., Smith, W. H. F., & Tian, D. (2019). The Generic Mapping Tools Version 6. Geochemistry, Geophysics, Geosystems, 20(11), 5556–5564. https://doi.org/10.1029/2019GC008515
- Wessel, P., Esteban, F., & Delaviel-Anger, G. (2024). The Generic Mapping Tools and animations for the masses. Geochemistry, Geophysics, Geosystems, 25, e2024GC011545. https://doi.org/10.1029/2024GC011545.
19 changes: 10 additions & 9 deletions book/tut06_animation_extended.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
**Tutorial 6** - Animations with GMT (extended)
-----------------------------------------------
**Tutorial 6** - Animations with GMT 🎦 (extended)
--------------------------------------------------

Content
- Extension of "Tutorial 6 - Animations with GMT"

* Extension of "Tutorial 6 - Animations with GMT"

.. note::
This tutorial is part of the AGU24 annual meeting GMT/PyGMT pre-conference workshop (PREWS9) **Mastering Geospatial Visualizations with GMT/PyGMT**
Expand All @@ -21,8 +22,8 @@ Content

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.

3. Tutorial 2. Earthquakes
~~~~~~~~~~~~~~~~~~~~~~~~~~
3️. Tutorial 2. Earthquakes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here I explain how to make an animation with appearing objects.
This is more complex and requires the use :gmt-module:`events` and :gmt-module:`movie` modules.
Expand Down Expand Up @@ -419,8 +420,8 @@ The plateau phase is not used.
- -Mi1+c0: modify the intensity of the color. It gets lighter during the rise phase and then returns to its original color in the coda phase.
4. See also
~~~~~~~~~~~
4️⃣. See also
~~~~~~~~~~~~~
- The paper about animations which include explanation and examples (`Wessel et al. 2024 <https://doi.org/10.1029/2024GC011545>`_).
Expand All @@ -429,8 +430,8 @@ The plateau phase is not used.
- See the `GMT animation gallery <https://docs.generic-mapping-tools.org/6.5/animations.html>`_ for more examples.
5. References
~~~~~~~~~~~~~
5️⃣. References
~~~~~~~~~~~~~~~
- Wessel, P., Luis, J. F., Uieda, L., Scharroo, R., Wobbe, F., Smith, W. H. F., & Tian, D. (2019). The Generic Mapping Tools Version 6. Geochemistry, Geophysics, Geosystems, 20(11), 5556–5564. https://doi.org/10.1029/2019GC008515
- Wessel, P., Esteban, F., & Delaviel-Anger, G. (2024). The Generic Mapping Tools and animations for the masses. Geochemistry, Geophysics, Geosystems, 25, e2024GC011545. https://doi.org/10.1029/2024GC011545.

0 comments on commit 7e9e7b6

Please sign in to comment.