Assignment: 1D and 2D data#
With one exception, you should be able to copy and paste code from the previous notebook and make minimal code modifications (e.g. changing the name of a variable, add a small computation…) to solve the following exercises.
Don’t think too “complicated”!
Importing the modules#
This one is easy. I’ll do it for you:
# Import the tools we are going to need today:
import matplotlib.pyplot as plt # plotting library
import numpy as np # numerical library
import xarray as xr # netCDF library
import cartopy # Map projections libary
import cartopy.crs as ccrs # Projections list
# Some defaults:
plt.rcParams['figure.figsize'] = (12, 5) # Default plot size
Invariant data#
Download the ERA5_LowRes_Invariant.nc
file, store it alongside the temperature one. Open it with xarray, and explore its content
# Your answer here
How many variables does the file have? What are their names and units? What do they represent?
# Your answer here
Topography according to ERA5#
Plot the model topography on a map in the Equal Earth projection. Interpret what you see.
# Your answer here
Compute the highest and lowest point on Earth according to these ERA5 data. Compare with the actual values. Discuss.
# Your answer here
Bonus question: we didn’t learn about how to find the location (in longitude and latitude) of the maximum value. Now use a web search or generative AI to find out how to do this. The task is to find out the longitude and latitude of the highest grid point in ERA5.
# Your answer here
Water covered areas on Earth according to ERA5#
Plot the land-sea mask on a map in the Equal Earth projection. Interpret what you see.
# Your answer here
Compute the percentage (%) of ocean cover accross latidudes (100% means there is only ocean at this specific latitude). Make a zonal plot showing your result. Interpret what you see.
# Your answer here
Now compute the % coverage of water over the planet. Hint: you will need to remember how to compute averages on a sphere! Compare your result with a google search.
# Your answer here
Temperature data#
Read the temperature data from the lesson:
# Your answer here
Timeseries#
Now select the temperature timeseries at two or three locations of your choice. Compute and compare their average temperature (in °C), and plot them on a single graph.
# Your answer here
2D timeslices#
Finally, select the decades 2015-2024 and 1979-1988 out of the 3D temperature data. Compute their time average. This should give you two 2D data arrays, yes? Each of them is a decadal average temperature. Now plot the difference between the last and the first decade of the ERA5 period. Interpret what you see!
# Your answer here