mesh

mesh1d

lerp.mesh1d

alias of BreakPoints

mesh2d

class lerp.mesh2d(x=[], d=None, x_label=None, x_unit=None, label=None, unit=None, clipboard=False, extrapolate=True, contiguous=False, step=False, **kwargs)

Fundamental 2D object, strict monotonic

Instantiation by giving (x, d) parameters or by loading a csv-file.

Parameters:
  • x (numpy.array or mesh1d) – 1D array of x-coordinates of the mesh on which to interpolate
  • d (numpy.array) – 1D array of d-coordinates of the mesh on result to be interpolated
  • options (dict [optiona]) –
  • clipboard (boolean [optional]) – when set, override any instantiation with x and d
  • fileName (string) – Complete address to csv-file, further

Notes

Currently supported features:
  • calling the object cur(x) return the interpolated value at x.
  • common operations: +, -, , /
  • standard functions:func:len(), print()
T
apply(f, axis='d', inplace=False)

Apply a function along axis

Parameters:
  • f (function) –
  • axis (string) – “x” or “d”
  • inplace (boolean) – True if you want the mesh1d to be modified inplace
Returns:

Depends if inplace is set to False or True

Return type:

Nothing or mesh1d

d

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

diff(n=1)

Checked

difff
dropnan()

Drop NaN values and return new mesh2d.

extrapolate(x, *args, **kwargs)

np.interp function with linear extrapolation np.polyfit np.poly1d

gradient(x=None)
interpolate(x, assume_sorted=False, *args, **kwargs)

Purpose of this method is to return a linear interpolation of a d vector for an unknown value x. If the targeted value is out of the x range, the returned d-value is the first, resp. the last d-value.

No interpolation is made out of the x definition range. For such a functionality, use:py:meth:extrapolate instead.

:param x:: iterable or single element,: :param kind: :type kind: str or int, optional :param Specifies the kind of interpolation as a string (‘linear’, ‘nearest’,: :param ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’ where ‘slinear’, ‘quadratic’: :param and ‘cubic’ refer to a spline interpolation of first, second or third: :param order) or as an integer specifying the order of the spline: :param interpolator to use. Default is ‘linear’.:

Returns:
  • A single element or a numpy.array if the x parameter was
  • a numpy.array or a list
plot(data, *args, **kwargs)
polyfit(degree=2)
push(x=None, d=None)

Pushes an element/array to the array

Notes

The element or the array is added and sorted inplace

Parameters:
  • x (single numeric, array, numpy.array) –
  • d (single numeric, array, numpy.array) –
read_clipboard()
resample(x)
steps
to_clipboard(transpose=False, decimal=', ')
to_csv(fileName=None, nbreDecimales=2)

Export CUR data into csv

Parameters:
  • fileName (String) – Complete path + filename where csv data will be wrote. Default to ‘C:/temp/aze.csv’
  • nbreDecimales (integer) –
x

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

mesh3d

class lerp.mesh3d(x=[], y=[], d=None, x_label=None, x_unit=None, y_label=None, y_unit=None, label=None, unit=None, extrapolate=True, clipboard=False, sort=True, *pargs, **kwargs)

Interpolate over a 2-D grid.

x, y and d are arrays of values used to approximate some function f: d = f(x, y). This class returns a function whose call method uses spline interpolation to find the value of new points.

Parameters:
  • x (array_like) –
  • Y (array_like) –

    Arrays defining the data point coordinates.

    If the points lie on a regular grid, x can specify the column coordinates and Y the row coordinates

Examples

Construct a 2-D grid and interpolate on it:

from scipy import interpolate
x = np.arange(-5.01, 5.01, 0.25)
y = np.arange(-5.01, 5.01, 0.25)
xx, yy = np.meshgrid(x, y)
z = np.sin(xx**2+yy**2)
T
apply(f, inplace=False)
d

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

diff(axis=0, n=1)
extrapolate(x, y)
from_pandas(obj)
interpolate(x=None, y=None)
plot(xy=False, filename=None, **kwargs)
pop(axis=0)
push(s=None, d=None, axis=0, inplace=False)
read_clipboard()
reshape(sort=True)
sort()
to_gpt(fileName=None)
x

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

y

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

mesh4d

class lerp.mesh4d(x=[], y=[], z=[], d=None, x_label=None, x_unit=None, y_label=None, y_unit=None, z_label=None, z_unit=None, label=None, unit=None, extrapolate=False, dtype='float64')
d

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

interpolate(x=None, y=None, z=None)

a

push(s=None, d=None, axis=0)
read_pickle(fileName=None)
reshape()
shape
sort()
to_pickle(fileName=None)
x

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

y

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

z

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

mesh5d

class lerp.mesh5d(x=[], y=[], z=[], v=[], d=None, x_label=None, x_unit=None, y_label=None, y_unit=None, z_label=None, z_unit=None, v_label=None, v_unit=None, label=None, unit=None, extrapolate=True, dtype='float64')
d

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

read_pickle(fileName=None)
reshape()
shape
sort()
to_pickle(fileName=None)
v

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

x

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

y

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

z

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.