Skip to content

Instantly share code, notes, and snippets.

View jweisbaum's full-sized avatar

Jon Weisbaum jweisbaum

  • Hallowell, ME
View GitHub Profile
@jthielen
jthielen / wrf_python_extraction.py
Created May 3, 2019 18:44
Use wrf-python, xarray, and pyproj to post-process WRF output
from wrf import getvar
from netCDF4 import Dataset
import xarray as xr
import pyproj
# Extract the variables of interest at time index 17
ds = Dataset('../wrfout_d02_2015-07-12_1200.nc')
variables = [getvar(ds, var, 17) for var in ('z', 'dbz', 'pressure', 'ter', 'ua',
'va', 'wa', 'temp', 'rh')]
data = xr.merge(variables)