Skip to content

Utils¤

Here are some utility classes that are used in the microlux library.

Classes¤

microlux.Iterative_State ¤

Bases: NamedTuple

A NamedTuple representing the state of an iterative process in the microlux module.

Attributes:

  • sample_num (int) –

    The number of samples.

  • theta (Array) –

    The sampling angles.

  • roots (Array) –

    The roots array.

  • parity (Array) –

    The parity array.

  • ghost_roots_distant (Array) –

    The ghost roots distant array, used to detect the buried images (hidden cusps)

  • sort_flag (Union[bool, Array]) –

    A boolean flag indicating whether the roots are sorted and matched.

  • Is_create (Array) –

    The Is_create array. A boolean flag indicating whether the image is created or destroyed.


microlux.Error_State ¤

Bases: NamedTuple

Error_State is a NamedTuple that holds various attributes related to the error state in the adaptive sampling.

Attributes:

  • mag (Array) –

    Current magnification values.

  • mag_no_diff (int) –

    The number of magnification values without sufficient difference.

  • outloop (int) –

    A integer flag indicating whether the iteration should be terminated.

  • error_hist (Array) –

    The current error estimated in each sampling interval.

  • epsilon (float) –

    The absolute tolerance value.

  • epsilon_rel (float) –

    The relative tolerance value.

  • exceed_flag (bool) –

    The flag indicating whether the current sampling number exceeds the length of the array.