Skip to content

Commit 57776ab

Browse files
authored
Clearer terminology for coordinate variables (#1296)
* Clearer terminology for coordinate variables * Update terms
1 parent aa40864 commit 57776ab

File tree

1 file changed

+31
-13
lines changed

1 file changed

+31
-13
lines changed

doc/data-structures.rst

+31-13
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ Coordinates can also be set or removed by using the dictionary like syntax:
199199
del foo['ranking']
200200
foo.coords
201201
202+
For more details, see :ref:`coordinates` below.
203+
202204
Dataset
203205
-------
204206

@@ -472,19 +474,35 @@ objects in the ``coords`` attribute:
472474
ds.coords
473475
474476
Unlike attributes, xarray *does* interpret and persist coordinates in
475-
operations that transform xarray objects.
476-
477-
One dimensional coordinates with a name equal to their sole dimension (marked
478-
by ``*`` when printing a dataset or data array) take on a special meaning in
479-
xarray. They are used for label based indexing and alignment,
480-
like the ``index`` found on a pandas :py:class:`~pandas.DataFrame` or
481-
:py:class:`~pandas.Series`. Indeed, these "dimension" coordinates use a
482-
:py:class:`pandas.Index` internally to store their values.
483-
484-
Other than for indexing, xarray does not make any direct use of the values
485-
associated with coordinates. Coordinates with names not matching a dimension
486-
are not used for alignment or indexing, nor are they required to match when
487-
doing arithmetic (see :ref:`coordinates math`).
477+
operations that transform xarray objects. There are two types of coordinates
478+
in xarray:
479+
480+
- **dimension coordinates** are one dimensional coordinates with a name equal
481+
to their sole dimension (marked by ``*`` when printing a dataset or data
482+
array). They are used for label based indexing and alignment,
483+
like the ``index`` found on a pandas :py:class:`~pandas.DataFrame` or
484+
:py:class:`~pandas.Series`. Indeed, these "dimension" coordinates use a
485+
:py:class:`pandas.Index` internally to store their values.
486+
487+
- **non-dimension coordinates** are variables that contain coordinate
488+
data, but are not a dimension coordinate. They can be multidimensional
489+
(see :ref:`examples.multidim`), and there is no relationship between the
490+
name of a non-dimension coordinate and the name(s) of its dimension(s).
491+
Non-dimension coordinates can be useful for indexing or plotting; otherwise,
492+
xarray does not make any direct use of the values associated with them.
493+
They are not used for alignment or automatic indexing, nor are they required
494+
to match when doing arithmetic
495+
(see :ref:`coordinates math`).
496+
497+
.. note::
498+
499+
xarray's terminology differs from the `CF terminology`_, where the
500+
"dimension coordinates" are called "coordinate variables", and the
501+
"non-dimension coordinates" are called "auxiliary coordinate variables"
502+
(see :issue:`1295` for more details).
503+
504+
.. _CF terminology: http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#terminology
505+
488506

489507
Modifying coordinates
490508
~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)