Skip to content

Commit

Permalink
Addition of links on the filling NaN values.
Browse files Browse the repository at this point in the history
  • Loading branch information
fbriol committed Jul 29, 2019
1 parent ddab30b commit cd4701c
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 9 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ This software also uses [CMake](https://cmake.org/) to configure the project
and [Googletest](https://github.com/google/googletest) to perform unit testing
of the library kernel.

## Fill undefined values

The undefined values in the grids do not allow interpolation of values located
in the neighborhood. This behavior is a concern when you need to interpolate
values near the mask of some fields. The library provides utilities to fill the
undefined values:

* `loess` to fill the undefined values on the boundary between the defined/undefined
values using local regression.
* `gauss_seidel` to fill all undefined values in a grid using the Gauss-Seidel
method by relaxation.

## Geographic indexers

### N-Dimensional Grids
Expand Down
10 changes: 10 additions & 0 deletions docs/source/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ This first version can interpolate 2D fields using :py:class:`bivariate
<pyinterp.trivariate.Trivariate>` interpolators and :py:class:`unstructured
grids <pyinterp.rtree.RTree>`.

The undefined values in the grids do not allow interpolation of values located
in the neighborhood. This behavior is a concern when you need to interpolate
values near the mask of some fields. The library provides utilities to fill the
undefined values:

* :py:func:`loess <pyinterp.fill.loess>` to fill the undefined values on the
boundary between the defined/undefined values using local regression
* :py:func:`gauss_seidel <pyinterp.fill.gauss_seidel>` to fill all undefined
values (NaN) in a grid using the Gauss-Seidel method by relaxation.

The library core is written in C++ using the `Boost C++ Libararies
<https://www.boost.org/>`_, `Eigen3 <http://eigen.tuxfamily.org/>`_, `GNU
Scientific Library <https://www.gnu.org/software/gsl/>`_ and `pybind11
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ Gauss-Seidel
############

The :py:func:`second <pyinterp.fill.gauss_seidel>` method consists of replacing
all undefined values (Nan) in a grid using the Gauss-Seidel method by
all undefined values (NaN) in a grid using the Gauss-Seidel method by
relaxation. This `link
<https://math.berkeley.edu/~wilken/228A.F07/chr_lecture.pdf>`_ contains more
information on the method used.
Expand Down
2 changes: 1 addition & 1 deletion src/pyinterp/bicubic.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def bicubic(grid2d: grid.Grid2D,
bounds_error (bool, optional): If True, when interpolated values
are requested outside of the domain of the input axes (x,y), a
:py:class:`ValueError` is raised. If False, then value is set
to Nan. Default to ``False``
to NaN. Default to ``False``
num_threads (int, optional): The number of threads to use for the
computation. If 0 all CPUs are used. If 1 is given, no parallel
Expand Down
2 changes: 1 addition & 1 deletion src/pyinterp/bivariate.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def bivariate(grid2d: grid.Grid2D,
bounds_error (bool, optional): If True, when interpolated values
are requested outside of the domain of the input axes (x,y), a
:py:class:`ValueError` is raised. If False, then value is set
to Nan. Default to ``False``
to NaN. Default to ``False``
num_threads (int, optional): The number of threads to use for the
computation. If 0 all CPUs are used. If 1 is given, no parallel
computing code is used at all, which is useful for debugging.
Expand Down
2 changes: 1 addition & 1 deletion src/pyinterp/core/include/pyinterp/bivariate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Interpolate the values provided on the defined bivariate function.
used to interpolate.
bounds_error (bool, optional): If True, when interpolated values are
requested outside of the domain of the input axes (x,y), a ValueError
is raised. If False, then value is set to Nan.
is raised. If False, then value is set to NaN.
num_threads (int, optional): The number of threads to use for the
computation. If 0 all CPUs are used. If 1 is given, no parallel
computing code is used at all, which is useful for debugging.
Expand Down
2 changes: 1 addition & 1 deletion src/pyinterp/core/include/pyinterp/trivariate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Interpolate the values provided on the defined trivariate function.
used to interpolate values on the surface (x, y).
bounds_error (bool, optional): If True, when interpolated values are
requested outside of the domain of the input axes (x,y,z), a ValueError
is raised. If False, then value is set to Nan.
is raised. If False, then value is set to NaN.
num_threads (int, optional): The number of threads to use for the
computation. If 0 all CPUs are used. If 1 is given, no parallel
computing code is used at all, which is useful for debugging.
Expand Down
2 changes: 1 addition & 1 deletion src/pyinterp/core/module/bicubic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ nearest-neighbor interpolation.
:py:data:`pyinterp.core.Axis.Boundary.kUndef`
bounds_error (bool, optional): If True, when interpolated values are
requested outside of the domain of the input axes (x,y), a ValueError
is raised. If False, then value is set to Nan.
is raised. If False, then value is set to NaN.
num_threads (int, optional): The number of threads to use for the
computation. If 0 all CPUs are used. If 1 is given, no parallel
computing code is used at all, which is useful for debugging.
Expand Down
2 changes: 1 addition & 1 deletion src/pyinterp/trivariate.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def trivariate(grid3d: grid.Grid3D,
bounds_error (bool, optional): If True, when interpolated values
are requested outside of the domain of the input axes (x,y), a
:py:class:`ValueError` is raised. If False, then value is set
to Nan. Default to ``False``
to NaN. Default to ``False``
num_threads (int, optional): The number of threads to use for the
computation. If 0 all CPUs are used. If 1 is given, no parallel
computing code is used at all, which is useful for debugging.
Expand Down
4 changes: 2 additions & 2 deletions src/pyinterp/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

def release(full: bool = False) -> str:
"""Returns the software version number"""
# c133d9af2aee7c2bd37212fc8cd757a695b3cc5e
# ddab30ba4cf5b5d44a049f62741801df8d44886e
result = "0.0.2"
if full:
result += " (12 July 2019)"
result += " (29 July 2019)"
return result

0 comments on commit cd4701c

Please sign in to comment.