piel.integration.type_conversion#

This file provides a set of utilities in converting between common data types to represent information between different toolsets.

Module Contents#

Functions#

convert_array_type(array, output_type)

convert_2d_array_to_string(list_2D)

This function is particularly useful to convert digital data when it is represented as a 2D array into a set of strings.

absolute_to_threshold(→ package_array_types)

This function converts the computed optical transmission arrays to single bit digital signals.

Attributes#

array_types

tuple_int_type

package_array_types

array_types#
tuple_int_type#
package_array_types#
convert_array_type(array: array_types, output_type: package_array_types)[source]#
convert_2d_array_to_string(list_2D: list[list])[source]#

This function is particularly useful to convert digital data when it is represented as a 2D array into a set of strings.

Parameters:

list_2D (list[list]) – A 2D array of binary data.

Returns:

A string of binary data.

Return type:

binary_string (str)

Usage:

list_2D=[[0], [0], [0], [1]] convert_2d_array_to_string(list_2D) >>> “0001”

absolute_to_threshold(array: array_types, threshold: float = 1e-06, dtype_output: int | float | bool = int, output_array_type: package_array_types = 'jax') package_array_types[source]#

This function converts the computed optical transmission arrays to single bit digital signals. The function takes the absolute value of the array and compares it to a threshold to determine the digital signal.

Parameters:
  • array (array_types) – The optical transmission array of any dimension.

  • dtype_output (int | float | bool, optional) – The output type. Defaults to int.

  • threshold (float, optional) – The threshold to compare the array to. Defaults to 1e-6.

  • output_array_type (array_types, optional) – The output type. Defaults to “jax”.

Returns: