grapa.curve.math_on_curves
- grapa.curve.math_on_curves(curve_a: Curve, curve_b: Curve | float | int, interpolate=-1, offsets: bool = False, operator='add') Curve
Math operations on Curves, element-wise or interpolated along x data.
- Parameters:
curve_a – a Curve object
curve_b – a Curve object, or e.g. a float
interpolate –
interpolate, or not, the data on the x-axis
0: no interpolation, only consider y() values
1: interpolation, x are the points contained in curve_a.x() or in curve_b.x()
2: interpolation, x are the points of curve_a.x(), restricted to min&max of curve_b.x()
-1: 0 if same x values (gain time), otherwise 1
offsets – if True, adds Curves after computing offsets and muloffsets. If False, adds on the raw data.
operator – MathOperator.ADD, MathOperator.SUB, MathOperator.MUL, MathOperator.DIV
- Returns:
a Curve object