pyinterp.reduced_gaussian.interpolate

Contents

pyinterp.reduced_gaussian.interpolate#

pyinterp.reduced_gaussian.interpolate(source, lon, lat, time=None, *, fields=None, time_method='linear', interval=None, max_step_gap=None, bounds_error=False, num_threads=0)[source]#

Interpolate the fields of a grid or a series at points.

Each point is located once on the mesh: its cell then serves every field, every level and both time steps it reads.

Parameters:
  • source (Grid | Series) – A Grid, or a Series of grids in time.

  • lon (ArrayLike) – Longitudes of the points, in degrees, in any turn.

  • lat (ArrayLike) – Latitudes of the points, in degrees.

  • time (ArrayLike | None) – Dates of the points, required for a series.

  • fields (Sequence[str] | None) – Names of the fields to interpolate; all by default.

  • time_method (TimeMethod) – "linear" blends the two steps that bracket a date, "nearest" reads the nearest one.

  • interval (Duration) – Width of the analysis intervals (timedelta64, or an integer in the unit of the series). A date is then read between the two ends of the interval it falls in, on a lattice whose phase is the first step; an interval that lost one of its ends is read off the other alone, one that lost both is NaN. By default the two steps that bracket the date are read.

  • max_step_gap (Duration) – Largest time between the two steps a date reads; a wider pair is treated as a missing step.

  • bounds_error (bool) – Raise an IndexError for a point outside the mesh or the series, or reading a corner a zone does not hold, instead of returning NaN.

  • num_threads (int) – Number of threads; 0 uses all the cores.

Returns:

shape (n,) for a field given as (points,), (n, levels) for one given as (points, levels).

Return type:

A dict from field name to values