Skip to content

Commit

Permalink
deploy: 68b9c78
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrjones committed Dec 5, 2024
1 parent deab023 commit f8a3540
Show file tree
Hide file tree
Showing 10 changed files with 261 additions and 257 deletions.
34 changes: 14 additions & 20 deletions _sources/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ tutorials for making maps 🗺️ and animations 🎦
:gutter: 1
:padding: 1


:::::{grid-item}
::::{grid} 1 1 1 1
:gutter: 1

:::{grid-item-card} Tutorial 1 - First figure 🚀 and Subplots / layout
:img-top: _images/fd70248f75b8b37ee54b3135f77705f98c6d8489eb18b6910184b447d0f0638d.png
:img-top: \_images/fd70248f75b8b37ee54b3135f77705f98c6d8489eb18b6910184b447d0f0638d.png
:link: ./tut01_firstfigure.html
by [Jing-Hui Tong](https://orcid.org/0009-0002-7195-3071)
+++
Expand All @@ -29,7 +28,7 @@ by [Jing-Hui Tong](https://orcid.org/0009-0002-7195-3071)
:::

:::{grid-item-card} Tutorial 2 - Integration with the scientific Python ecosystem 🐍: pandas and GeoPandas (tabular data 🗒️)
:img-top: _images/7f18327908c8dd210197cc51845e45a933f356b9fd12bd029a4a8cbda080eb2b.png
:img-top: \_images/7f18327908c8dd210197cc51845e45a933f356b9fd12bd029a4a8cbda080eb2b.png
:link: ./tut02_spe_pd_gpd.html
by [Yvonne Fröhlich](https://orcid.org/0000-0002-8566-0619)
+++
Expand All @@ -47,13 +46,12 @@ by [Yvonne Fröhlich](https://orcid.org/0000-0002-8566-0619)
::::
:::::


:::::{grid-item}
::::{grid} 1 1 1 1
:gutter: 1

:::{grid-item-card} Tutorial 3 - Integration with the scientific Python ecosystem 🐍: Xarray (gridded data 🌐)
:img-top: _images/a18fcb026fb0d0c83360f2b8382a360e552dd50db6aa2db5311259bf5223d3a2.png
:img-top: \_images/a18fcb026fb0d0c83360f2b8382a360e552dd50db6aa2db5311259bf5223d3a2.png
:link: ./tut03_spe_xarray.html
by [Max Jones](https://orcid.org/0000-0003-0180-8928)
+++
Expand Down Expand Up @@ -89,13 +87,12 @@ and [Yvonne Fröhlich](https://orcid.org/0000-0002-8566-0619)
::::
:::::


:::::{grid-item}
::::{grid} 1 1 1 1
:gutter: 1

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

:::{grid-item-card} Tutorial 6 - Animations with GMT
:img-top: _images/5847818951ca8fbc9b86a6f2c67389b6.png
:img-top: \_images/5847818951ca8fbc9b86a6f2c67389b6.png
:link: ./tut06_animation.html
by [Federico Esteban](https://orcid.org/0000-0002-0641-7371)
+++
Expand All @@ -124,15 +121,12 @@ by [Federico Esteban](https://orcid.org/0000-0002-0641-7371)
::::
:::::


::::::


Each tutorial is rendered on this website for easy viewing 👀, but they are all Jupyter
notebooks designed to be ran interactively 💫. See the instructions below on how you can
start running the tutorials in no time! 🚀


# 🌠 Quickstart

To run these notebooks in an interactive Jupyter session online, 🖱️ click on the button
Expand Down Expand Up @@ -181,18 +175,18 @@ Here's the instructions to install the `agu24workshop` environment:

4. Run the following commands on the 🧑‍💻 command-line to create the virtual environment

```bash
cd /path/to/agu24workshop
conda env create --name agu24workshop --file environment.yml
```
```bash
cd /path/to/agu24workshop
conda env create --name agu24workshop --file environment.yml
```

5. Once the installation is completed 🏁, launch
[Jupyter Lab](https://jupyterlab.readthedocs.io) as follows:

```bash
conda activate agu24workshop
jupyter lab
```
```bash
conda activate agu24workshop
jupyter lab
```

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
Expand All @@ -202,7 +196,7 @@ Here's the instructions to install the `agu24workshop` environment:
https://www.generic-mapping-tools.org/agu24workshop/tut01_firstfigure.html) using
either the download button on the ↗️ top right (select '.ipynb') or from GitHub at
https://github.com/GenericMappingTools/agu24workshop/tree/main/book. Make sure to put
the *.ipynb file(s) inside of the 'agu24workshop' folder.
the \*.ipynb file(s) inside of the 'agu24workshop' folder.

7. Open the Jupyter notebook in the left-pane file browser, e.g. by 🖱️ double-clicking
on `first-figure.ipynb`. You are now ready to run through the course materials 🎉!
Expand Down
119 changes: 58 additions & 61 deletions _sources/tut01_firstfigure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"metadata": {},
"outputs": [],
"source": [
"fig=pygmt.Figure()"
"fig = pygmt.Figure()"
]
},
{
Expand Down Expand Up @@ -155,14 +155,12 @@
"metadata": {},
"outputs": [],
"source": [
"region=[-180, -150, 50, 65]\n",
"region = [-180, -150, 50, 65]\n",
"\n",
"fig.coast(region=region, \n",
" projection=\"M10c\",\n",
" shorelines=True)\n",
"fig.coast(region=region, projection=\"M10c\", shorelines=True)\n",
"\n",
"# To see the figure looks like\n",
"fig.show() "
"fig.show()"
]
},
{
Expand Down Expand Up @@ -212,9 +210,7 @@
"metadata": {},
"outputs": [],
"source": [
"fig.coast(water=\"lightblue\", \n",
" land=\"grey\",\n",
" frame=[\"WSne\",\"a10f5g5\"]) \n",
"fig.coast(water=\"lightblue\", land=\"grey\", frame=[\"WSne\", \"a10f5g5\"])\n",
"fig.show()"
]
},
Expand Down Expand Up @@ -249,16 +245,15 @@
"metadata": {},
"outputs": [],
"source": [
"grid=pygmt.datasets.load_earth_relief(resolution=\"03m\", region=region)\n",
"grid = pygmt.datasets.load_earth_relief(resolution=\"03m\", region=region)\n",
"\n",
"# You also can access then cut the grid\n",
"# and this way can save grid (outgrid) as a file in your folder. \n",
"# and this way can save grid (outgrid) as a file in your folder.\n",
"# https://www.generic-mapping-tools.org/remote-datasets/\n",
"\n",
"# pygmt.grdcut(grid=\"@earth_relief_03m\", \n",
"# region=region,\n",
"# outgrid=\"Alaska.grd\", \n",
"# ) "
"# pygmt.grdcut(\n",
"# grid=\"@earth_relief_03m\", region=region, outgrid=\"Alaska.grd\"\n",
"# )"
]
},
{
Expand Down Expand Up @@ -300,14 +295,11 @@
"metadata": {},
"outputs": [],
"source": [
"fig=pygmt.Figure()\n",
"fig = pygmt.Figure()\n",
"\n",
"fig.grdimage(grid=grid,\n",
" region=region, \n",
" projection=\"M10c\")\n",
"fig.grdimage(grid=grid, region=region, projection=\"M10c\")\n",
"\n",
"fig.coast(shorelines=\"1p,black\",\n",
" frame=[\"WSne\", \"a5f2.5\"]) \n",
"fig.coast(shorelines=\"1p,black\", frame=[\"WSne\", \"a5f2.5\"])\n",
"\n",
"fig.show()"
]
Expand All @@ -334,12 +326,13 @@
"metadata": {},
"outputs": [],
"source": [
"pygmt.makecpt(cmap=\"geo\", \n",
" series=[-8000, 7000, 500],\n",
" continuous=True,\n",
" # The file name with extension .cpt to store the generated CPT file\n",
" output=\"eleva.cpt\") \n",
" "
"pygmt.makecpt(\n",
" cmap=\"geo\",\n",
" series=[-8000, 7000, 500],\n",
" continuous=True,\n",
" # The file name with extension .cpt to store the generated CPT file\n",
" output=\"eleva.cpt\",\n",
")"
]
},
{
Expand Down Expand Up @@ -381,19 +374,17 @@
"metadata": {},
"outputs": [],
"source": [
"fig=pygmt.Figure()\n",
"fig = pygmt.Figure()\n",
"\n",
"fig.grdimage(grid=grid,\n",
" region=region, \n",
" projection=\"M10c\",\n",
" cmap=\"eleva.cpt\") \n",
"fig.grdimage(grid=grid, region=region, projection=\"M10c\", cmap=\"eleva.cpt\")\n",
"\n",
"fig.coast(shorelines=\"1p,black\",\n",
" frame=[\"WSne\", \"a5f2.5\"]) \n",
"fig.coast(shorelines=\"1p,black\", frame=[\"WSne\", \"a5f2.5\"])\n",
"\n",
"fig.colorbar(cmap=\"eleva.cpt\", \n",
" frame=\"a2000f500+lElevation (m)\",\n",
" position=\"JBC+w10c/0.4c+mc+h\",) \n",
"fig.colorbar(\n",
" cmap=\"eleva.cpt\",\n",
" frame=\"a2000f500+lElevation (m)\",\n",
" position=\"JBC+w10c/0.4c+mc+h\",\n",
")\n",
"\n",
"fig.show()"
]
Expand Down Expand Up @@ -425,39 +416,45 @@
"metadata": {},
"outputs": [],
"source": [
"fig=pygmt.Figure()\n",
"fig = pygmt.Figure()\n",
"\n",
"grid_crust_age=pygmt.datasets.load_earth_age(resolution=\"30m\", region=[-210, -150, 35, 65])\n",
"grid_crust_age = pygmt.datasets.load_earth_age(\n",
" resolution=\"30m\", region=[-210, -150, 35, 65]\n",
")\n",
"\n",
"with fig.subplot(\n",
" nrows=1, ncols=2, figsize=[\"18c\",\"12c\"]\n",
"):\n",
"with fig.subplot(nrows=1, ncols=2, figsize=[\"18c\", \"12c\"]):\n",
"\n",
" with fig.set_panel(panel=0):\n",
"\n",
" fig.grdimage(grid=grid,\n",
" region=region, \n",
" # \"?\" means that map width automatically determined from the subplot width.\n",
" projection=\"M?\", \n",
" cmap=\"eleva.cpt\") \n",
" fig.coast(shorelines=\"1p,black\",\n",
" frame=[\"WSne\", \"a5f2.5\"]) \n",
" fig.colorbar(cmap=\"eleva.cpt\", \n",
" position=\"JBC+w8c/0.3c+mc+h\", \n",
" frame=\"a2000f500+lElevation (m)\") \n",
" fig.grdimage(\n",
" grid=grid,\n",
" region=region,\n",
" # \"?\" means that map width automatically determined from the subplot width.\n",
" projection=\"M?\",\n",
" cmap=\"eleva.cpt\",\n",
" )\n",
" fig.coast(shorelines=\"1p,black\", frame=[\"WSne\", \"a5f2.5\"])\n",
" fig.colorbar(\n",
" cmap=\"eleva.cpt\",\n",
" position=\"JBC+w8c/0.3c+mc+h\",\n",
" frame=\"a2000f500+lElevation (m)\",\n",
" )\n",
"\n",
" with fig.set_panel(panel=1):\n",
"\n",
" pygmt.makecpt(cmap=\"@earth_age.cpt\", series=[0, 340])\n",
" fig.grdimage(grid=grid_crust_age,\n",
" region=[-210, -150, 35, 65], \n",
" # changing projection method\n",
" projection=\"L-180/55/35/65/?\",\n",
" frame=[\"a5f2.5\",\"SEnw\"],\n",
" cmap=True) \n",
" \n",
" fig.colorbar(position=\"JBC+w6c/0.3c+mc+h\", \n",
" frame=\"a40f20+lSeafloor crustal asge (Ma)\") \n",
" fig.grdimage(\n",
" grid=grid_crust_age,\n",
" region=[-210, -150, 35, 65],\n",
" # changing projection method\n",
" projection=\"L-180/55/35/65/?\",\n",
" frame=[\"a5f2.5\", \"SEnw\"],\n",
" cmap=True,\n",
" )\n",
"\n",
" fig.colorbar(\n",
" position=\"JBC+w6c/0.3c+mc+h\", frame=\"a40f20+lSeafloor crustal asge (Ma)\"\n",
" )\n",
"\n",
"fig.show()"
]
Expand Down
Loading

0 comments on commit f8a3540

Please sign in to comment.