Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docstring of make_xarray_grid #399

Merged
merged 2 commits into from
Dec 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions verde/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,23 @@ def make_xarray_grid(
extra_coords_names=None,
):
"""
Create an :class:`xarray.Dataset` grid from numpy arrays
Create an :class:`xarray.Dataset` grid from 2D numpy arrays

This functions creates an :class:`xarray.Dataset` out of 2d gridded data
This function creates an :class:`xarray.Dataset` out of 2d gridded data
including easting and northing coordinates, any extra coordinates (like
upward elevation, time, etc) and data arrays.

Use this to transform the outputs of :func:`verde.grid_coordinates` and
the ``predict`` method of a gridder into an :class:`xarray.Dataset`.

.. important::

This function does not perform any interpolation or gridding. If you
are dealing with 1d arrays and need to interpolate them on a regular
grid (a.k.a _grid_ them) you might want to use one of the available
interpolators in Verde, like :class:`verde.Spline`,
:class:`verde.KNeighbors`, :class:`Linear`, etc.

.. note::

This is a utility function to help create 2D grids (i.e., grids with
Expand Down