Skip to content

Commit

Permalink
Moved regridding schemes to dedicated part in the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
schlunma committed Nov 9, 2023
1 parent e0011dd commit 64e1d12
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 16 deletions.
1 change: 0 additions & 1 deletion doc/api/esmvalcore.preprocessor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ Preprocessor functions

.. autodata:: esmvalcore.preprocessor.DEFAULT_ORDER
.. automodule:: esmvalcore.preprocessor
.. automodule:: esmvalcore.preprocessor.regrid_schemes
20 changes: 20 additions & 0 deletions doc/api/esmvalcore.regridding_schemes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. _regriddin_schemes:

Regridding schemes
==================

Iris natively supports data regridding with its :meth:`iris.cube.Cube.regrid`
method and a set of predefined regridding schemes provided in the
:mod:`~iris.analysis` module (further details on this are given `here
<https://scitools-iris.readthedocs.io/en/latest/userguide/interpolation_and_regridding.html>`__).
In this module, further regridding schemes are provided that are compatible
with :meth:`iris.cube.Cube.regrid`.

Example:

.. code:: python
from esmvalcore.preprocessor.regrid_schemes import ESMPyAreaWeighted
regridded_cube = cube.regrid(target_grid, ESMPyAreaWeighted())
.. automodule:: esmvalcore.preprocessor.regrid_schemes
1 change: 1 addition & 0 deletions doc/api/esmvalcore.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ library. This section documents the public API of ESMValCore.
esmvalcore.iris_helpers
esmvalcore.local
esmvalcore.preprocessor
esmvalcore.regridding_schemes
esmvalcore.typing
esmvalcore.experimental
35 changes: 20 additions & 15 deletions doc/recipe/preprocessor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -896,20 +896,24 @@ third party regridding schemes designed for use with :doc:`Iris
Built-in regridding schemes
~~~~~~~~~~~~~~~~~~~~~~~~~~~

* ``linear``: Bilinear regridding. For source data on a regular grid, uses
:obj:`iris.analysis.Linear` with `extrapolation_mode='mask'`. For source data
on an irregular grid, uses
:class:`esmvalcore.preprocessor.regrid_schemes.ESMPyLinear`.
* ``nearest``: Nearest-neighbor regridding. For source data on a regular
grid, uses :obj:`iris.analysis.Nearest` with `extrapolation_mode='mask'`. For
source data on an irregular grid, uses
:class:`esmvalcore.preprocessor.regrid_schemes.ESMPyNearest`. For source data
on an unstructured grid, uses
:class:`esmvalcore.preprocessor.regrid_schemes.UnstructuredNearest`.
* ``area_weighted``: First-order (area-weighted) regridding. For source data on
a regular grid, uses :obj:`iris.analysis.Area-weighted`. For source data on
an irregular grid, uses
:class:`esmvalcore.preprocessor.regrid_schemes.ESMPyAreaWeighted`.
* ``linear``: Bilinear regridding.
For source data on a regular grid, uses :obj:`~iris.analysis.Linear` with
`extrapolation_mode='mask'`.
For source data on an irregular grid, uses
:class:`~esmvalcore.preprocessor.regrid_schemes.ESMPyLinear`.
Source data on an unstructured grid is not supported, yet.
* ``nearest``: Nearest-neighbor regridding.
For source data on a regular grid, uses :obj:`~iris.analysis.Nearest` with
`extrapolation_mode='mask'`.
For source data on an irregular grid, uses
:class:`~esmvalcore.preprocessor.regrid_schemes.ESMPyNearest`.
For source data on an unstructured grid, uses
:class:`~esmvalcore.preprocessor.regrid_schemes.UnstructuredNearest`.
* ``area_weighted``: First-order conservative (area-weighted) regridding.
For source data on a regular grid, uses :obj:`~iris.analysis.AreaWeighted`.
For source data on an irregular grid, uses
:class:`~esmvalcore.preprocessor.regrid_schemes.ESMPyAreaWeighted`.
Source data on an unstructured grid is not supported, yet.

See also :func:`esmvalcore.preprocessor.regrid`

Expand Down Expand Up @@ -950,7 +954,8 @@ tolerance.
mdtol: 0.7
Another example is bilinear regridding with extrapolation.
This can be achieved with the :class:`iris.analysis.Linear` and the ``extrapolation_mode`` keyword.
This can be achieved with the :class:`iris.analysis.Linear` scheme and the
``extrapolation_mode`` keyword.
Extrapolation points will be calculated by extending the gradient of the
closest two points.

Expand Down

0 comments on commit 64e1d12

Please sign in to comment.