pyinterp.Axis

Contents

pyinterp.Axis#

class pyinterp.Axis(self, values: numpy.ndarray[tuple[int], numpy.dtype[numpy.float64]], epsilon: float = 1e-06, is_circle: bool = False)#

Bases: pybind11_object

Create a coordinate axis for variable values.

A coordinate axis is a Variable that specifies one of the coordinates of a variable’s values.

Parameters:
  • values – Axis values.

  • epsilon – Maximum allowed difference between two real numbers in order to consider them equal. Defaults to 1e-6.

  • is_circle – True, if the axis can represent a circle. Defaults to false.

Attributes

is_circle

Test if this axis represents a circle.

Public Methods

back(self)

Get the last value of this axis.

find_index(self, coordinates[, bounded])

Find grid elements that contain or are closest to coordinate positions.

find_indexes(self, coordinates)

Search for axis elements around all coordinate positions.

flip(self[, inplace])

Reverse the order of elements in this axis.

front(self)

Get the first value of this axis.

increment(self)

Get the increment value if axis is regular.

is_ascending(self)

Test if the data is sorted in ascending order.

is_regular(self)

Check if this axis values are spaced regularly.

max_value(self)

Get the maximum coordinate value.

min_value(self)

Get the minimum coordinate value.

Special Methods

__copy__(self)

Implement the shallow copy operation.

__eq__(self, other)

Override the default behavior of the == operator.

__getitem__(*args, **kwargs)

Overloaded function.

__getstate__(self, /)

__len__(self)

Return the length of the axis.

__ne__(self, other)

Override the default behavior of the != operator.

__repr__(self)

Return the string representation of this Axis.

__setstate__(self, arg0)