edges_cal.xrfi.robust_divide

edges_cal.xrfi.robust_divide(num, den)[source]

Prevent division by zero.

This function will compute division between two array-like objects by setting values to infinity when the denominator is small for the given data type. This avoids floating point exception warnings that may hide genuine problems in the data.

Parameters:
  • num (array) – The numerator.

  • den (array) – The denominator.

Returns:

out (array) – The result of dividing num / den. Elements where b is small (or zero) are set to infinity.