Skip to content

Instantly share code, notes, and snippets.

View sgdecker's full-sized avatar

Steven Decker sgdecker

  • Rutgers University
  • New Brunswick, NJ
View GitHub Profile
@sgdecker
sgdecker / bug.ipynb
Created August 12, 2021 14:57
Problem with interactive use of declarative syntax
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
GDATTIM = f0
GLEVEL = 500
GVCORD = PRES
GFUNC = vor(wnd)
GDFILE = $MODEL/gfs/18072300_gfs003.gem
CINT = 4
LINE = 1//2
MAP = 8
MSCALE = 0
TITLE = 1
@sgdecker
sgdecker / gfs_vort.py
Created July 27, 2018 17:48
Plot Vorticity at Pole from GFS Data
from datetime import datetime
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
import numpy as np
import xarray as xr
from metpy.units import units
import metpy.calc as mpcalc
# Grab a recent GFS run on Grid 3
@sgdecker
sgdecker / svp.py
Created June 29, 2018 00:01
Saturation Vapor Pressure Comparisons
import numpy as np
import matplotlib.pyplot as plt
from metpy.units import units
from metpy.calc import saturation_vapor_pressure
import timeit
def goffgratch46(Tin):
"""Computes saturation vapor pressure (mb) from temperature using the
Goff and Gratch (1946) formulation as quoted by Alduchov and Eskridge
(1996)"""