hyperspy.misc.math_tools module

hyperspy.misc.math_tools.antisymmetrize(a)
hyperspy.misc.math_tools.anyfloatin(things)

Check if iterable contains any non integer.

hyperspy.misc.math_tools.closest_nice_number(number)
hyperspy.misc.math_tools.get_linear_interpolation(p1, p2, x)

Given two points in 2D returns y for a given x for y = ax + b

Parameters
  • p1,p2 ((x, y)) –

  • x (float) –

Returns

y

Return type

float

hyperspy.misc.math_tools.hann_window_nth_order(m, order)

Calculates 1D Hann window of nth order

mint

number of points in window (typically the length of a signal)

orderint

Filter order

Returns

window – window

Return type

array

hyperspy.misc.math_tools.isfloat(number)

Check if a number or array is of float type.

This is necessary because e.g. isinstance(np.float32(2), float) is False.

hyperspy.misc.math_tools.order_of_magnitude(number)

Order of magnitude of the given number

Parameters

number (float) –

Returns

Return type

Float

hyperspy.misc.math_tools.outer_nd(*vec)

Calculates outer product of n vectors

Parameters

vec (vector) –

Returns

out

Return type

ndarray

hyperspy.misc.math_tools.symmetrize(a)