Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Computing Q-vectors and Q-vector divergence for a real case.

By: Kevin Goebbert

This example uses GFS output to compute the 850-hPa Q-vectors and Q-vector divergence for 12 UTC 26 October 2010.

Import needed modules

Use Xarray to access GFS data from THREDDS resource and uses metpy accessor to parse file to make it easy to pull data using common coordinate names (e.g., vertical) and attach units.

Subset data based on latitude and longitude values and select only data from 850 hPa

Compute Q-vectors

Use the MetPy module to compute Q-vectors from requisite data and additionally compute the Q-vector divergence (and multiply by -2) to calculate the right hand side forcing of the Q-G Omega equation.

Plot Data

Use Cartopy to plot data on a map using a Lambert Conformal projection.

<Figure size 1400x1200 with 2 Axes>