flasc.utilities.optimization.match_y_curves_by_offset

flasc.utilities.optimization.match_y_curves_by_offset#

flasc.utilities.optimization.match_y_curves_by_offset(yref, ytest, dy_eval=None, angle_wrapping=True)[source]#

Match two curves by finding the optimal offset.

This function is used to match two curves by finding the optimal offset between the two curves. The function will minimize the mean squared error between the two curves for a range of offsets.

Parameters:
  • yref (np.array) -- Reference curve.

  • ytest (np.array) -- Test curve.

  • dy_eval (np.array) -- Range of offsets to evaluate. Default is None.

  • angle_wrapping (bool) -- Use angle wrapping for evaluation. Default is True.

Returns:

dwd_opt: Optimal offset. J_opt: Optimal cost function value.

Return type:

Tuple (float, float) with the following elements