From cd4701c9d31dd51b7d28e0a3dfcdd060bb46607c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fre=CC=81de=CC=81ric=20Briol?= Date: Mon, 29 Jul 2019 18:30:20 +0200 Subject: [PATCH] Addition of links on the filling NaN values. --- README.md | 12 ++++++++++++ docs/source/about.rst | 10 ++++++++++ docs/source/examples.rst | 2 +- src/pyinterp/bicubic.py | 2 +- src/pyinterp/bivariate.py | 2 +- src/pyinterp/core/include/pyinterp/bivariate.hpp | 2 +- src/pyinterp/core/include/pyinterp/trivariate.hpp | 2 +- src/pyinterp/core/module/bicubic.cpp | 2 +- src/pyinterp/trivariate.py | 2 +- src/pyinterp/version.py | 4 ++-- 10 files changed, 31 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1f4ba5e1..9935f668 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/source/about.rst b/docs/source/about.rst index 0a505412..85ff366f 100644 --- a/docs/source/about.rst +++ b/docs/source/about.rst @@ -13,6 +13,16 @@ This first version can interpolate 2D fields using :py:class:`bivariate ` interpolators and :py:class:`unstructured grids `. +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 ` to fill the undefined values on the + boundary between the defined/undefined values using local regression +* :py:func:`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 `_, `Eigen3 `_, `GNU Scientific Library `_ and `pybind11 diff --git a/docs/source/examples.rst b/docs/source/examples.rst index 2cc34347..0107f98c 100644 --- a/docs/source/examples.rst +++ b/docs/source/examples.rst @@ -261,7 +261,7 @@ Gauss-Seidel ############ The :py:func:`second ` 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 `_ contains more information on the method used. diff --git a/src/pyinterp/bicubic.py b/src/pyinterp/bicubic.py index ec12c0e4..90be0c42 100644 --- a/src/pyinterp/bicubic.py +++ b/src/pyinterp/bicubic.py @@ -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 diff --git a/src/pyinterp/bivariate.py b/src/pyinterp/bivariate.py index 608ea753..0d742124 100644 --- a/src/pyinterp/bivariate.py +++ b/src/pyinterp/bivariate.py @@ -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. diff --git a/src/pyinterp/core/include/pyinterp/bivariate.hpp b/src/pyinterp/core/include/pyinterp/bivariate.hpp index 525c7d91..d7d15060 100644 --- a/src/pyinterp/core/include/pyinterp/bivariate.hpp +++ b/src/pyinterp/core/include/pyinterp/bivariate.hpp @@ -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. diff --git a/src/pyinterp/core/include/pyinterp/trivariate.hpp b/src/pyinterp/core/include/pyinterp/trivariate.hpp index e3624d98..f1fe8ffc 100644 --- a/src/pyinterp/core/include/pyinterp/trivariate.hpp +++ b/src/pyinterp/core/include/pyinterp/trivariate.hpp @@ -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. diff --git a/src/pyinterp/core/module/bicubic.cpp b/src/pyinterp/core/module/bicubic.cpp index d248a902..393a9848 100644 --- a/src/pyinterp/core/module/bicubic.cpp +++ b/src/pyinterp/core/module/bicubic.cpp @@ -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. diff --git a/src/pyinterp/trivariate.py b/src/pyinterp/trivariate.py index 8f47f798..5e62e38f 100644 --- a/src/pyinterp/trivariate.py +++ b/src/pyinterp/trivariate.py @@ -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. diff --git a/src/pyinterp/version.py b/src/pyinterp/version.py index 6fa813ef..23176691 100644 --- a/src/pyinterp/version.py +++ b/src/pyinterp/version.py @@ -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