Skip to main content

pyinterp

PyPI Conda Build Status License Binder

Fast interpolation of geo-referenced data for Python and xarray.

pyinterp interpolates gridded fields in 2, 3 or 4 dimensions and scattered observations, such as model outputs, satellite tracks or in situ measurements. Its core is written in C++ and runs on all the cores of the machine; it knows that longitudes wrap around the globe, that a time axis holds dates, and that a field may have undefined values, near the coasts for instance.

Installation

pip install "pyinterp[xarray]"

or, with conda:

conda install -c conda-forge pyinterp

Binary wheels are published for Linux, macOS (Apple Silicon) and Windows, for Python 3.12 and later. The xarray extra is needed only for the xarray interface; see the installation guide.

Quick start

Once pyinterp is imported, xarray data arrays have a pyinterp accessor that works like DataArray.interp:

import numpy as np
import xarray as xr

import pyinterp
import pyinterp.tests

# A global mean sea surface, stored as (lat, lon) with longitudes in [0, 360)
ds = pyinterp.tests.load_grid2d()

# Interpolate on a new grid: the longitude axis is periodic, so the grid can
# be queried in [-180, 180)
mss = ds.mss.pyinterp.interp(
    lon=np.arange(-180, 180, 0.1),
    lat=np.arange(-80, 80, 0.1),
    method="bicubic",
)

# Interpolate point by point, along a track
track = ds.mss.pyinterp.interp(
    lon=xr.DataArray(np.linspace(-170, 170, 1000), dims="obs"),
    lat=xr.DataArray(np.linspace(-60, 60, 1000), dims="obs"),
)

Scattered observations are indexed in an R*-tree:

from pyinterp.geometry import geographic

rng = np.random.default_rng(0)
lon, lat = rng.uniform(-180, 180, 10_000), rng.uniform(-80, 80, 10_000)
values = np.cos(np.radians(lat)) * np.sin(np.radians(lon))

# Index the observations on the WGS-84 ellipsoid
tree = pyinterp.RTree3D(spheroid=geographic.Spheroid())
tree.packing(np.column_stack((lon, lat)), values)

# Estimate the field at new positions from the 11 nearest observations
estimate, neighbors = pyinterp.inverse_distance_weighting(
    tree, np.array([[10.0, 45.0], [-70.0, -30.0]]), k=11
)

The gallery shows these and the other features on real data.

Why pyinterp?

xarray.DataArray.interp and scipy.interpolate are general-purpose tools. pyinterp is built for geo-referenced data:

  • Periodic longitudes: a grid stored in [0, 360) is interpolated in [-180, 180), and across the antimeridian, without rolling the data.

  • Dates: time axes of type datetime64 are handled with integer arithmetic, at any resolution, without conversion to floats.

  • Speed: the interpolators are written in C++ and process the points in parallel; the axes find the cell of a point by a direct computation when they are regular. Bilinear interpolation runs 5 times faster than SciPy on one core and 38 times faster on all the cores; see the benchmarks.

  • Undefined values: the gaps of a field, such as the land of an ocean grid, can be filled beforehand, so that the windowed methods (bicubic, splines, Akima, Steffen…) do not spread them; at the edges of the grid, their window can shrink to the available data.

  • Beyond grids: scattered data, statistics and geometry use the same coordinates and the same conventions.

What is inside

  • Regular grids: 1D to 4D interpolation (nearest, bilinear, inverse distance weighting, bicubic, splines, Akima, Steffen, polynomial), with temporal axes, through xarray or NumPy.

  • Conservative regridding: area-weighted averages between rectilinear grids, which preserve the integral of the field, on the sphere or on the ellipsoid.

  • Reduced Gaussian grids: interpolation of the ECMWF N and O grids in 2D, 3D and time, reading only the part of the field the points need.

  • Scattered data: R*-trees in Cartesian or geodetic coordinates, with inverse distance weighting, radial basis functions, kriging and window functions, and optimal interpolation.

  • Gap filling: LOESS, Gauss-Seidel relaxation, multigrid and FFT inpainting.

  • Statistics: 1D and 2D binning, histograms, descriptive statistics and T-Digest quantiles, which can be merged across Dask chunks.

  • Geometry: bindings to Boost.Geometry in Cartesian and geographic coordinates, geohash encoding, and orbit utilities for satellite tracks.

The design notes explain how the axes, the R*-trees and the coordinate conversions work.

Contributing and citing

pyinterp is developed by CNES and CLS under the BSD-3-Clause license. Bug reports, questions and pull requests are welcome on GitHub; see the contributing guide. If pyinterp helps your research, please cite it using the metadata of the CITATION.cff file.

Metadata

Release files for pyinterp 2026.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyinterp 2026.11.0
File Size Uploaded Provenance Actions
pyinterp-2026.11.0.tar.gz 7.0 MB With provenance Details for pyinterp-2026.11.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pyinterp 2026.11.0
File Actions
pyinterp-2026.11.0-cp315-abi3t-win_amd64.whl CPython 3.15 abi3t Windows x86-64 Details for pyinterp-2026.11.0-cp315-abi3t-win_amd64.whl
pyinterp-2026.11.0-cp315-abi3t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.15 abi3t Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for pyinterp-2026.11.0-cp315-abi3t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pyinterp-2026.11.0-cp315-abi3t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.15 abi3t Linux glibc 2.28+ ARM64, Linux glibc 2.27+ ARM64 Details for pyinterp-2026.11.0-cp315-abi3t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
pyinterp-2026.11.0-cp315-abi3t-macosx_13_0_arm64.whl CPython 3.15 abi3t macOS 13.0+ ARM64 Details for pyinterp-2026.11.0-cp315-abi3t-macosx_13_0_arm64.whl
pyinterp-2026.11.0-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details for pyinterp-2026.11.0-cp314-cp314t-win_amd64.whl
pyinterp-2026.11.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for pyinterp-2026.11.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pyinterp-2026.11.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details for pyinterp-2026.11.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
pyinterp-2026.11.0-cp314-cp314t-macosx_13_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 13.0+ ARM64 Details for pyinterp-2026.11.0-cp314-cp314t-macosx_13_0_arm64.whl
pyinterp-2026.11.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for pyinterp-2026.11.0-cp312-abi3-win_amd64.whl
pyinterp-2026.11.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for pyinterp-2026.11.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pyinterp-2026.11.0-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details for pyinterp-2026.11.0-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
pyinterp-2026.11.0-cp312-abi3-macosx_13_0_arm64.whl CPython 3.12 abi3 macOS 13.0+ ARM64 Details for pyinterp-2026.11.0-cp312-abi3-macosx_13_0_arm64.whl

Total release size: 112.8 MB

Release files / pyinterp-2026.11.0.tar.gz

Download URL pyinterp-2026.11.0.tar.gz
Size 7.0 MB
Tags Source
SHA-256 checksum
How to use checksums
b5b58d7e409dca9429f62d917ced1d6c28a81cf1245ba5ac225dd1cdca5fd679
BLAKE2b-256 checksum
How to use checksums
93bc9eca7e63ea10bdef19e6ba89063ae72a47e4a357f951d96349dee89f36ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pyinterp-2026.11.0-cp315-abi3t-win_amd64.whl

Download URL pyinterp-2026.11.0-cp315-abi3t-win_amd64.whl
Size 6.2 MB
Tags CPython 3.15 Windows x86-64 abi3t
SHA-256 checksum
How to use checksums
fe7316dc1f94df0a8ecb520651664b42fa08923d67f9a1356b04460a44260195
BLAKE2b-256 checksum
How to use checksums
e4e9d7fdf6ac41aca48ea8fcbf67a6965c6e6fd719977c52c8089023e6f76fad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pyinterp-2026.11.0-cp315-abi3t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pyinterp-2026.11.0-cp315-abi3t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 11.5 MB
Tags CPython 3.15 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3t
SHA-256 checksum
How to use checksums
29e96bd916158a065aeaae2b93fcc6705c407afe3d04e45c53a216d3377e5eb9
BLAKE2b-256 checksum
How to use checksums
d92fbb17fcc3c410d184e35f6dae424b5a2317e0719d51138a0b853ce0eae455
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pyinterp-2026.11.0-cp315-abi3t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL pyinterp-2026.11.0-cp315-abi3t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 9.9 MB
Tags CPython 3.15 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 abi3t
SHA-256 checksum
How to use checksums
0720293a0154c56751e13aa075e515d675d765598aba6cc879984d39cd07ec18
BLAKE2b-256 checksum
How to use checksums
9dc980f2b0c6a1afdb2020f6b677dcb3a57747919c40f03a0d58ca4fadaa5642
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pyinterp-2026.11.0-cp315-abi3t-macosx_13_0_arm64.whl

Download URL pyinterp-2026.11.0-cp315-abi3t-macosx_13_0_arm64.whl
Size 7.7 MB
Tags CPython 3.15 abi3t macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
a41b891acc49db140e9eaa7d0c4a7b502845783a933127f926c9cd78f02efbd1
BLAKE2b-256 checksum
How to use checksums
6f493c47ca48256eb8a6009e42e7a56505f251362655f36a0ca3d87d34a31224
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pyinterp-2026.11.0-cp314-cp314t-win_amd64.whl

Download URL pyinterp-2026.11.0-cp314-cp314t-win_amd64.whl
Size 6.3 MB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
0732ac00e632762c84e692d8f1b6febd84a2102bfd96db596fed2cf63f47015e
BLAKE2b-256 checksum
How to use checksums
489e6b8864fbc01318a88141ebc7e354c25d1e3e13363c9d96d84998e1b65345
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pyinterp-2026.11.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pyinterp-2026.11.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 11.5 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
28c48a1225950a10140ea47ebe49369424f579f51d28f790f325c7bb8fcdefab
BLAKE2b-256 checksum
How to use checksums
21ebc3e27151d4d7432dc15847ed84a6fa91d64358e268865a08cfc8028de5b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pyinterp-2026.11.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL pyinterp-2026.11.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 9.9 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
45a09806f00a067aacf22586d3ee8f0642e1df09bd2a30201ec43f29a9da9006
BLAKE2b-256 checksum
How to use checksums
c77251864753e43da3c68e5d596a0fb34f014cb002b87503dadb823c32c58220
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pyinterp-2026.11.0-cp314-cp314t-macosx_13_0_arm64.whl

Download URL pyinterp-2026.11.0-cp314-cp314t-macosx_13_0_arm64.whl
Size 7.7 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
c9e62f8cfa390591e3d9ca2d715ba39d66fcdf0d0c7f9131ce80240d4d710c94
BLAKE2b-256 checksum
How to use checksums
1ddde2e4b62bd713d0156d43e80001ce3cae15656593920188cf28362b929518
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pyinterp-2026.11.0-cp312-abi3-win_amd64.whl

Download URL pyinterp-2026.11.0-cp312-abi3-win_amd64.whl
Size 6.1 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e5d61278c29cd8ff2f2e0d1f7873e48c10131a89c0fa3fda0dd8b2091adad90f
BLAKE2b-256 checksum
How to use checksums
54a6c92b5174a3f13e3aeffebb03039c221fa5743a2f19495333df973616f454
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pyinterp-2026.11.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pyinterp-2026.11.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 11.5 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
eebd7928e5e0cff39c3e1ca9ee9e2ac40d2615d8e58dc21f815378ee82109c1c
BLAKE2b-256 checksum
How to use checksums
ffd4c742858bb2ff2b7ef9fdb6ae456e40eb167f311dbf04eca2e63f8a17a031
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pyinterp-2026.11.0-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL pyinterp-2026.11.0-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 9.9 MB
Tags CPython 3.12 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
a5d04d35aacf4da4e0d98a89bb73c6179ab859ae83c8b3e7834fa68d84d947d1
BLAKE2b-256 checksum
How to use checksums
f369b9878a530db4884db9632aec80c2b34690655ec544bc8f57ff11b5b2a4d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / pyinterp-2026.11.0-cp312-abi3-macosx_13_0_arm64.whl

Download URL pyinterp-2026.11.0-cp312-abi3-macosx_13_0_arm64.whl
Size 7.7 MB
Tags CPython 3.12 abi3 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
31fb6f10546bdcfac52d2cd82f4953eca58ceaedd299c60020e9061db4334b18
BLAKE2b-256 checksum
How to use checksums
81a30b2f2e11c3f366090bce0c3b70f275dd11226b9476a06abc9b3cfe12e8d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for pyinterp 2026.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 13 files in this release have been uploaded with provenance metadata.

Select from 13 files

Attestation for pyinterp-2026.11.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2026.11.0 This release

13 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page