podpac.data.Interpolation

class podpac.data.Interpolation(definition='nearest')[source]

Bases: object

Create an interpolation class to handle one interpolation method per unstacked dimension. Used to interpolate data within a datasource.

Parameters

definition (str, tuple (str, list of podpac.core.data.interpolator.Interpolator), dict) – Interpolation definition used to define interpolation methods for each definiton. See podpac.data.DataSource.interpolation for more details.

Raises

InterpolationException – Raised when definition parameter is improperly formatted

Methods

__init__([definition])

interpolate(source_coordinates, source_data, …)

Interpolate data from requested coordinates to source coordinates

select_coordinates(source_coordinates, …)

Select a subset or coordinates if interpolator can downselect.

Attributes

config

definition

Members

__init__(definition='nearest')[source]
config = {}
definition = None
interpolate(source_coordinates, source_data, eval_coordinates, output_data)[source]

Interpolate data from requested coordinates to source coordinates

Parameters
  • source_coordinates (podpac.Coordinates) – Description

  • source_data (podpac.core.units.UnitsDataArray) – Description

  • eval_coordinates (podpac.Coordinates) – Description

  • output_data (podpac.core.units.UnitsDataArray) – Description

Returns

returns the new output UnitDataArray of interpolated data

Return type

podpac.core.units.UnitDataArray

Raises

InterpolationException – Raises InterpolationException when interpolator definition can’t support all the dimensions of the requested coordinates

select_coordinates(source_coordinates, source_coordinates_index, eval_coordinates)[source]

Select a subset or coordinates if interpolator can downselect.

At this point in the execution process, podpac has selected a subset of source_coordinates that intersects with the requested coordinates, dropped extra dimensions from requested coordinates, and confirmed source coordinates are not missing any dimensions.

Parameters
  • source_coordinates (podpac.Coordinates) – Intersected source coordinates

  • source_coordinates_index (list) – Index of intersected source coordinates. See podpac.data.DataSource for more information about valid values for the source_coordinates_index

  • eval_coordinates (podpac.Coordinates) – Requested coordinates to evaluate

Returns

Returns tuple with the first element subset of selected coordinates and the second element the indicies of the selected coordinates

Return type

(podpac.Coordinates, list)