Skip to content

Instantly share code, notes, and snippets.

@rabernat
Created December 11, 2024 22:40
Show Gist options
  • Save rabernat/08f12863696051b6ab219e35a37a1ea8 to your computer and use it in GitHub Desktop.
Save rabernat/08f12863696051b6ab219e35a37a1ea8 to your computer and use it in GitHub Desktop.
import xarray as xr
url = "https://www.ncei.noaa.gov/thredds-ocean/dodsC/woa23/DATA/temperature/netcdf/decav/1.00/woa23_decav_t16_01.nc"
ds = xr.open_dataset(url, decode_times=False)
t_diff = ds.t_an - ds.t_an.isel(depth=0)
t_diff.sel(lat=0, method="nearest").plot(x="lon", ylim=(5000, 0), vmax=0, vmin=-25)
t_diff.sel(lat=0, method="nearest").squeeze().plot.contour(levels=[-22], ylim=(5000, 0), colors='w')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment