xbout.geometries.apply_geometry

Contents

xbout.geometries.apply_geometry#

xbout.geometries.apply_geometry(ds, geometry_name, *, coordinates=None, grid=None)[source]#
Parameters:
  • ds (xarray.Dataset) – Dataset (from

  • geometry_name (str) – Name under which the desired geometry function was registered

  • coordinates (dict of str, optional) – Names to give the physical coordinates corresponding to ‘x’, ‘y’ and ‘z’; values corresponding to ‘x’, ‘y’ and ‘z’ keys in the passed dict are used as the names of the dimensions. Any not passed are given default values. If not specified, default names are chosen.

  • grid (Dataset, optional) – Dataset containing extra geometrical information not stored in the dump files that is needed to add coordinates for the geometry being applied. For example, should contain 2d arrays Rxy, Zxy and psixy for toroidal geometry.

Return type:

updated_ds

Raises:

UnregisteredGeometryError