Jupyter notebook ATMS-305-Content/Week-10/Week 9 Exercise: March 13 (Week 10 review).ipynb
ATMS 305: More working with matplotlib
and basemap
Since basemap
is part of matplotlib
, we can use the mapping capabilities of basemap
along with the plotting capabilities of matplotlib
for ultimate in geo-geekiness. This capability is very useful for visualizing geoscience data.
Now, let's open a file with xarray, and get the variables available. You can change the time and the run as you wish in the URL. These files are hosted at NOAA/NWS/NCEP, and updated in real time.
Conveniently store the coordinate variables:
Let's grab temperature on isobaric surfaces (temperature at a constant pressure value in the atmosphere). What are the dimensions?
Let's grab the map at the initial time, and at 850 hPa.
Now let's use Basemap to generate a contour map over the US!
Let's do a filled contour instead!
Let's change the contour interval and the colormap!
Lines and contours. Why not?
Cross-sections
We can also draw vertical cross sections using the vertical coordinate as the y-axis and latitude and longitude as the x-axis.
Here, we don't need a map. We can just use matplotlib. Lets contourf the temperature and contour the u-wind. Meteorologists - see the thermal wind in action!
Time-height cross sections
Here, we want values at a specific point over time.