podpac.interpolators.NearestPreview

class podpac.interpolators.NearestPreview(**kwargs)[source]

Bases: podpac.core.data.interpolators.NearestNeighbor

Nearest Neighbor (Preview) Interpolation

method

Current interpolation method to use in Interpolator (i.e. ‘nearest’). This attribute is set during node evaluation when a new Interpolation class is constructed. See the podpac.data.DataSource interpolation attribute for more information on specifying the interpolator method.

Type

str

dims_supported

List of unstacked dimensions supported by the interpolator. This attribute should be defined by the implementing Interpolator. Used by private convience method _filter_udims_supported().

Type

list

spatial_tolerance

Maximum distance to the nearest coordinate in space. Cooresponds to the unit of the space measurement.

Type

float

time_tolerance

Maximum distance to the nearest coordinate in time coordinates. Accepts p.timedelta64() (i.e. np.timedelta64(1, ‘D’) for a 1-Day tolerance)

Type

float

Methods

__init__(**kwargs)

can_interpolate(udims, source_coordinates, …)

Interpolate data from requested coordinates to source coordinates.

can_select(udims, source_coordinates, …)

Evaluate if interpolator can downselect the source coordinates from the requested coordinates for the unstacked dims supplied.

init()

Overwrite this method if a Interpolator needs to do any additional initialization after the standard initialization.

interpolate(udims, source_coordinates, …)

Interpolate data from requested coordinates to source coordinates.

select_coordinates(udims, …)

Downselect coordinates with interpolator method

Attributes

definition

Interpolator definition

dims_supported

method

A trait for unicode strings.

methods_supported

name

Interpolator definition

spatial_tolerance

A float trait.

time_tolerance

A trait whose value must be an instance of a specified class.

Members

__init__(**kwargs)
can_select(udims, source_coordinates, eval_coordinates)[source]

Evaluate if interpolator can downselect the source coordinates from the requested coordinates for the unstacked dims supplied. If not overwritten, this method returns an empty tuple (tuple())

Parameters
Returns

Returns a tuple of dimensions that can be selected with this interpolator If no dimensions can be selected, method should return an emtpy tuple

Return type

tuple

method

A trait for unicode strings.

methods_supported = ['nearest_preview']
select_coordinates(udims, source_coordinates, source_coordinates_index, eval_coordinates)[source]

Downselect coordinates with interpolator method

Parameters
  • udims (tuple) – dimensions to select coordinates

  • source_coordinates (podpac.Coordinates) – Description

  • source_coordinates_index (list) – Description

  • eval_coordinates (podpac.Coordinates) – Description

Returns

returns the new down selected coordinates and the new associated index. These coordinates must exist in the native coordinates of the source data

Return type

(podpac.Coordinates, list)

Raises

NotImplementedError