Working with Multidimensional Coordinates¶
Author: Ryan Abernathey
Many datasets have physical coordinates which differ from their logical coordinates. Xarray provides several ways to plot and analyze such datasets.
In [1]: import numpy as np
In [2]: import pandas as pd
In [3]: import xarray as xr
In [4]: import netCDF4
In [5]: import cartopy.crs as ccrs
In [6]: import matplotlib.pyplot as plt
As an example, consider this dataset from the xarray-data repository.
In [7]: ds = xr.tutorial.open_dataset('rasm').load()
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-7-7ddfc509c01f> in <module>()
----> 1 ds = xr.tutorial.open_dataset('rasm').load()
/build/python-xarray-iAuVdG/python-xarray-0.12.1/xarray/tutorial.py in open_dataset(name, cache, cache_dir, github_url, branch, **kws)
64 # May want to add an option to remove it.
65 if not _os.path.isdir(longdir):
---> 66 _os.mkdir(longdir)
67
68 url = '/'.join((github_url, 'raw', branch, fullname))
FileNotFoundError: [Errno 2] No such file or directory: '/sbuild-nonexistent/.xarray_tutorial_data'
In [8]: ds