hyperspy.misc.axis_tools module

hyperspy.misc.axis_tools.check_axes_calibration(ax1, ax2, rtol=1e-07)

Check if the calibration of two Axis objects matches.

Raises a logger warning if there is a mismatch. scale and offset are compared as floats using np.allclose, while units is compared with a simple inequality (!=).

Parameters:
  • ax1 (Axis objects) – Axes objects that should be compared.

  • ax2 (Axis objects) – Axes objects that should be compared.

  • rtol (float) – Tolerance passed to np.allclose for comparison. Default 1e-7.

Returns:

If the two axes have identical calibrations.

Return type:

bool