Assignment 6: Cartopy¶
For this assignment, your goal is to make three maps that look like the maps shown below.
1) Plot data from NARR¶
NARR is NCEP's North American Regional Reanalysis, a widely used product for studying the weather and climate of the continental US. The data is available from NOAA's Earth System Research Laboratory via OPeNDAP, meaing that xarray can opent the data "remotely" without downloading a file.
For this problem, you should open this precipitation file:
https://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/NARR/Dailies/monolevel/apcp.2023.nc
Your goal is to make a map that looks like the one below. It shows total precipitation on Sept. 29, 2023 in blue.
Hint: examine the dataset variables and attirbutes carefully in order to determine the projection of the data.
import xarray as xr
from matplotlib import pyplot as plt
import cartopy.crs as ccrs
import cartopy
import pandas as pd
import numpy as np
ds_apcp = xr.open_dataset('https://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/NARR/Dailies/monolevel/apcp.2023.nc')
<cartopy.mpl.gridliner.Gridliner at 0x183235ac0>
2) Antarctic Sea Ice¶
Download this file and then use it to plot the concentration of Antarctic Sea Ice on June 29, 2023. Again, you will need to explore the file contents in order to determine the correct projection.
Download the data from NOAA@NSIDC.
Hint: Check if the coordinates are correctly read. If not, assign the coordiates using swap_dims
.
! wget https://noaadata.apps.nsidc.org/NOAA/G02202_V4/south/daily/2023/seaice_conc_daily_sh_20230629_f17_v04r00.nc
<cartopy.mpl.geocollection.GeoQuadMesh at 0x17f757d60>
3) Global Largest Earthquakes¶
Create a map that shows the locations of the biggest earthquakes globally.
Text(0.5, 1.0, 'Big Earthquakes (Magnitude 8+)')