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.load_dataset('rasm')
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-7-7588dce177cb> in <module>()
----> 1 ds = xr.tutorial.load_dataset('rasm')
/build/python-xarray-CIPaSu/python-xarray-0.11.0/xarray/tutorial.py in load_dataset(*args, **kwargs)
106 "`tutorial.open_dataset(...).load()`.",
107 DeprecationWarning, stacklevel=2)
--> 108 return open_dataset(*args, **kwargs).load()
/build/python-xarray-CIPaSu/python-xarray-0.11.0/xarray/tutorial.py in open_dataset(name, cache, cache_dir, github_url, branch, **kws)
66 # May want to add an option to remove it.
67 if not _os.path.isdir(longdir):
---> 68 _os.mkdir(longdir)
69
70 url = '/'.join((github_url, 'raw', branch, fullname))
FileNotFoundError: [Errno 2] No such file or directory: '/sbuild-nonexistent/.xarray_tutorial_data'
In [8]: ds