neclib.data.interpolate#

class Interpolator(align_by=None, attrs=None)[source]#

Bases: Generic[T]

Interpolate Python objects.

Example

>>> interp = neclib.data.interpolate.Interpolator(align_by="x", attrs=["x", "y"])
>>> x = SimpleNamespace(x=1, y=2)
>>> xs = [SimpleNamespace(x=0, y=0), SimpleNamespace(x=2, y=100)]
>>> interp(x, xs)
SimpleNamespace(x=1.0, y=50.0)
Parameters:
  • align_by (Optional[str]) –

  • attrs (Optional[Sequence[str]]) –

class LinearInterp(align_by=None, attrs=None)[source]#

Bases: Interpolator[T]

Interpolate Python objects.

Example

>>> interp = neclib.data.interpolate.LinearInterp(align_by="x", attrs=["x", "y"])
>>> x = SimpleNamespace(x=1, y=2)
>>> xs = [SimpleNamespace(x=0, y=0), SimpleNamespace(x=2, y=100)]
>>> interp(x, xs)
SimpleNamespace(x=1.0, y=50.0)
Parameters:
  • align_by (Optional[str]) –

  • attrs (Optional[Sequence[str]]) –