EMSC 2022-2021 Week 5 - Making Maps with Python

EMSC 2022-2021 Week 5 - Making Maps with Python#

Required background#

In this week’s lab we will be make maps with the cartopy package and matplotlib within the jupyter notebook environment. We will work though how to download and manipulate the data that we need to use, but we will also need to check that we have downloaded the correct data, that we are reading it correctly and that is is not corrupted. For that there is no better check than plotting a map and taking a good look at the results.

Often in geosciences research, we wish to produce maps displaying spatial data. Python provides two sets of tools for handling mapping: Basemap and Cartopy. Basemap is currently probably more popular, but its developers have announced that it will shortly be phased out in favour of Cartopy.

Step 1#

This simple code will access geophysical data online, manipulate it, and then use the specified data to make a map of active volcanoes.

View the next notebook:LAB5_Volcano_Map.ipynb

Step 2#

This code uses Cartopy which provides access to various of the online mapping services that will serve image data on demand in the form of small image tiles at a specified resolution. The tools automatically query the service and assemble the tiles to make the map but there are some tricks that we need to know before we can use them.

View the next notebook:LAB5_On_Demand_MapServices.ipynb

Step 3#

This last code will take what you learned in the previous two steps to create a series of nice maps. However, this one you’ll have to write some of the code yourself!

View the next notebook:LAB5_Maps2020.ipynb