Data.offset(points, offsets, along, offset_axis, units='same', offset_units='same', mode='valid', method='linear', verbose=True)[source]

Offset one axis based on another axis’ values.

Useful for correcting instrumental artifacts such as zerotune.

  • points (1D array-like) – Points.

  • offsets (1D array-like) – Offsets.

  • along (str or int) – Axis that points array lies along.

  • offset_axis (str or int) – Axis to offset using offsets.

  • units (str (optional)) – Units of points array.

  • offset_units (str (optional)) – Units of offsets aray.

  • mode ({'valid', 'full', 'old'} (optional)) – Define how far the new axis will extend. Points outside of valid interpolation range will be written nan.

  • method ({'linear', 'nearest', 'cubic'} (optional)) – The interpolation method. Note that cubic interpolation is only possible for 1D and 2D data. See griddata for more information. Default is linear.

  • verbose (bool (optional)) – Toggle talkback. Default is True.

>>> points  # an array of w1 points
>>> offsets  # an array of d1 corrections
>>> data.offset(points, offsets, 'w1', 'd1')