ATMS 391: Homework 5a
Problem 1
I have placed a file called precip.mon.total.nc
, which is a netCDF file containing monthly averaged 5° lat-lon gridded precipitation data. Use xray
to load the dataset, and matplotlib
to plot the results of your calculations.
(a) Load in the data using xray
, and plot the monthly time series of precipitation averaged globally.
(b) Extract the time series over the nearest point over Champaign. Create a two panel plot. Plot the time series from 1900-2014 in the left panel, and the time series from 2000-2014 in the right panel.
(c) Repeat (b), but average the data every year (January-December) before plotting.
Problem 2
For this problem, you will use the dataset we used in Exercise 2 in addition to the data in Problem 1.
(a) Create a yearly time series from 1901 to 2014 of annually-averaged temperature and precipitation globally, and at the grid point over Champaign-Urbana.
(b) Plot time series of each of these variables in a two panel plot, stacked vertically. Use symbols and lines for each time series. Do this globally and for the grid point closest to Champaign-Urbana.
(c) Plot annual average temperature versus annual average precipitation globally and at the grid point closest to Champaign-Urbana. Color the points by year using the scatter
function, and add a colorbar using the colorbar
function. Do you see any trends?
Hint: A code that has similar functionality is given here: