interpolate

  • Routines to interpolate data from pre-computed spatial grids

Calling Sequence

import geoid_toolkit.interpolate
geoid_h = geoid_toolkit.interpolate.geoid_height(lon, lat, model='EGM2008')

Source code

class geoid_toolkit.interpolate.Interpolate(coords, values=None, **kwargs)[source]

Class for interpolating data from pre-computed spatial grids

update(values)[source]

Update the interpolation grid values

static _interp(points, coords, fp, **kwargs)[source]

Interpolate data from pre-computed spatial grids

Parameters:
points: tuple

Tuple of arrays containing the points to interpolate

coords: tuple

Tuple of arrays containing the coordinates of the grid

fp: np.ndarray

Array of values on the grid to interpolate

method: str, default “linear”

Interpolation method to use

  • 'linear': linear interpolation

  • 'nearest': nearest-neighbor interpolation

extrapolate: str, default “linear”

Extrapolation method to use

  • 'linear': linearly extrapolate

  • 'nearest': use nearest-neighbor value

  • 'fill_value': replace with fill value

  • 'zero': replace with zero

fill_value: float, default np.nan

Invalid values

Returns:
f: np.ndarray

Interpolated values

geoid_toolkit.interpolate.geoid_height(longitude: ndarray, latitude: ndarray, model: str = 'EGM2008', tide_system: str = 'mean_tide', method: str = 'linear', **kwargs)[source]

Interpolate geoid heights to input lat/lon points

Parameters:
longitude: np.ndarray

Longitudes of output points

latitude: np.ndarray

Latitudes of output points

model: str, default “EGM2008”

Geoid model to use in the interpolation

tide_system: str, default “mean_tide”

Output tide-system for the geoid model

  • 'mean_tide': mean-tide system

  • 'tide_free': tide-free system

  • 'zero_tide': zero-tide system

method: str, default “linear”

Interpolation method to use

  • 'linear': linear interpolation

  • 'nearest': nearest-neighbor interpolation

kwargs: keyword arguments

Additional keyword arguments for the Interpolate class

Returns:
geoid_undulation: np.ndarray

Geoid undulation at input lat/lon points